Jump to content

Darkie Minotaur

Resident
  • Posts

    1,663
  • Joined

  • Last visited

Everything posted by Darkie Minotaur

  1. Just contact me inworld - I'm on in European evenings (GMT +1)
  2. I would expect that the copy permission under the everyone mask is what you're looking for.
  3. float f_alpha = 0.0;float f_step = 0.01;default { on_rez(integer start_param) { llResetScript(); } state_entry() { llSetTimerEvent(0.05); } timer() { if(f_alpha > 0) { f_alpha -= f_step; } else { llSleep(15); f_alpha = 1; llSetAlpha(f_alpha); llSleep(15); } llSetAlpha(f_alpha); }} Do it this way, then.
  4. If I understood you right, this hopefully does what you want float f_alpha = 0.0;float f_step = 0.01;default { on_rez(integer start_param) { llResetScript(); } state_entry() { llSetTimerEvent(0.05); } timer() { if(f_alpha > 0) { f_alpha -= f_step; } else { llSleep(15); llSetAlpha(f_alpha=1); llSleep(15); } llSetAlpha(f_alpha); }}
  5. I guess the script once upon a time lived a happy life in a vendor or a donation box with split profis before someone came and stuffed it in the narrow box of a simple donation box and t´hey chopped off the poor little scripts arms and legs so it would fit. It's the remains of the now useless limbs that get in your way. The following script should do the simple tricks you are looking after: list thanks = [" *REMOVED ALL MY WORDING AS IT WAS LENGTHY* "];float num_sayings;string floattext = "Donation Box";///////// BEGIN SCRIPT //////////////////integer totaldonated;default{ on_rez( integer sparam ) { llResetScript(); } state_entry() { num_sayings = llGetListLength(thanks); llSetPayPrice(PAY_DEFAULT, [25, 50, 100, 500]); llSetText(floattext + "\nL$0 Donated so far",<1,1,1>,1); } money(key id, integer amount) { totaldonated = totaldonated + amount; llSetText(floattext + "\nL$" + (string)totaldonated + " Donated so far",<1,1,1>,1); integer saying2say = llFloor(llFrand(num_sayings)); llSay(0, llList2String(thanks,saying2say)); }}
  6. You should be a bit more specific about what you mean by 'spinning'. But let me hazard a guess: You are using llTargetOmega on a non-phys object. In this case the spinning is a client side effect and can be different from client to client. You could make the object phys to see if things behave differerently.
  7. I've come across it some time ago in two cases. Both cases had to do with duplications - if I remember correctly once it was duplicated jump marks, the other time duplicated events.
  8. Peter was faster this time - but I would have thought you want 180 degree in relation to the rezzing prim - that would be: llRezObject("Object", llGetPos() + <0.0, 0.0, 1.0>, ZERO_VECTOR, llGetRot() * (llEuler2Rot(<0, 0, 180> * DEG_TO_RAD)), 0);
  9. Ehem - what exactely do you want to know? The example below does not rotate the rezzed prim.
  10. The only way I can tthink of is to store the values you want to track and in certain intervals check them against the current values. This is not really an edit check but rather a change check.
  11. It's not really inworld - but with a copy and paste, you can make it inworld: http://wiki.secondlife.com/wiki/User:Nandana_Singh/nPose
  12. If I understand you correctly, than you can do that quite easily with the method I proposed: integer SensorTargetName;list SensorTargetNames = ["ObjectA", "ObjectB"];ObjectDetected(integer index) { if(index == 0) { llSay(0,"Hello Objet A"); } else if (index ==1) { llSay(0,"Hello Objet B"); llSetColor(<0.5, 0.0, 0.0>, ALL_SIDES); } } default{ state_entry() { llSensor(llList2String(SensorTargetNames, SensorTargetName), "", ACTIVE | PASSIVE, 10, PI); llSetTimerEvent(2); } sensor(integer total_number) { ObjectDetected(SensorTargetName); } timer() { llSensor(llList2String(SensorTargetNames, SensorTargetName = !SensorTargetName), "", ACTIVE | PASSIVE, 10, PI); }} With two cases it's very simple - if you have more, you will have to iterate over a list - but the logic stays the same. A second way would be a second sensor in a second script.
  13. You could e.g. use a timer to repeat the sensor and om each timer event change the value of the variable SensorTargetName. Here's an example integer SensorTargetName;list SensorTargetNames = ["ObjectA", "ObjectB"];ObjectDetected(integer index) { llSay(0,"Hello Objet " + llList2String(SensorTargetNames, index)); } default{ state_entry() { llSensor(llList2String(SensorTargetNames, SensorTargetName), "", ACTIVE | PASSIVE, 10, PI); llSetTimerEvent(2); } sensor(integer total_number) { ObjectDetected(SensorTargetName); } timer() { llSensor(llList2String(SensorTargetNames, SensorTargetName = !SensorTargetName), "", ACTIVE | PASSIVE, 10, PI); }}
  14. If you open a page from the https enabled directory in a browser, do you get a warning or does the browser trust the cert authority?
  15. I've fiddling around with this - it was fun. Anyhow, you could use a thesaurus with an API that returns data without any mark up. Big Huge Thesaurus does that (it's free for up to 10,000 requests a day - you have to sign up to get an API key) - so I'm using that in the example (with the API key taken out, of course. The example which contains most of whart other people have proposed here should do about what you want key request_id;integer listen_handle;list requests;list req_ids;default { state_entry() { listen_handle = llListen(77,"","","");//listen for anything on chan 77 } listen(integer channel, string name, key id, string msg) { msg = llToLower(msg); integer pos; requests = []; req_ids = []; if (!~llSubStringIndex(msg," is ")){//if it's not there llRegionSayTo(id,0,"Please say something with ' is ' in it"); return; } else { list temp = llParseString2List(msg,[" "],[""]); integer max = llGetListLength(temp); while(max--){//count backwards, since we're deleting stuff string s = llList2String(temp,max); if(~llListFindList(["the","a","my","his","her","that","any", ",", "."],[s])){ temp = llDeleteSubList(temp,max,max); } } llSay(0, llDumpList2String(temp, " ,")); if(pos = llListFindList(temp, ["is"])) { req_ids += llHTTPRequest("http://words.bighugelabs.com/api/2/fc42d736f4db4a5f4a44529b76bbc307/" + llList2String(temp, pos - 1) + "/", [], ""); requests += llList2String(temp, pos - 1); } else { req_ids += ""; requests += ""; } if (pos < llGetListLength(temp) - 1) { req_ids += llHTTPRequest("http://words.bighugelabs.com/api/2/fc42d736f4db4a5f4a44529b76bbc307/" + llList2String(temp, pos + 1) + "/", [], ""); requests += llList2String(temp, pos + 1); } else { req_ids += ""; requests += ""; } } } http_response(key request_id, integer status, list metadata, string body) { integer pos; if((pos = llListFindList(req_ids, [request_id])) != -1) { if (status == 200) { list temp = llParseString2List(body, ["|", "\n"], []); llSay(0, "The first synonyme for " + llList2String(requests, pos) + " is " + llList2String(temp, 2)); } else { llSay(0, llList2String(requests, pos) + " hasn't been found in the thesaurus."); } } }}
  16. You never parse the message into a list list t = llParseString2List(message, [","], []);
  17. No and yes. No, you can't pass a list to a different script directly. But you can dump the list into a string, send the string and parse it into the list again in the receiving string. Look at llDumpList2String and llParseString2List. How you send the message - saying it in some way (llSay, llWhisper ...) depends on the situation.
  18. Innula made some helpful remarks about the parsing of the input string - you should look at them and consider them. Also, there are some things to say about the http request. If I get you right, the input "The house is green" should result in requests that look up "house" and "green". For getting the response, you use: request_id = llHTTPRequest("http://www.thesaurus.com/browse/" + final_Before_Is, [HTTP_METHOD,"POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], final_After_Is); This request means that "house" would go in the URL (for a GET request) and "green" goes into the body of the request (for a POST request. I doubt that the script at www.thesaurus.com looks at the body at all. You would have to make 2 requests - one for each word - the word you are looking for schould go in the URL. And you should make it a GET request - just replace the POST in the parameter list. That should get you a response - the may however be some other things you have to change. The next problem is what yu do in the http_response. What you do there is you test if the request id equals the request id that of the response id of the response just received. That#s good - but it will only tell you if the response received is the response to the request you have sent. It doesn't tell you anything of the contents of the response. In order to find out if the response yielded a successful look up in the thesaurus, you would have to parse the body of the response: http_response(key request_id, integer status, list metadata, string body) { if (request_id == requestid) { //look at the body for certain key words that will tell you if there's a meaningful response }} Here is the next problem: LSL will only return a certain number of characters (I can't remember how many) - but it's very likely that with all the information on the html page before you get to the actual search result, this result may get cut off. That again means, you would have to do the analysis of the result outside LSL - e.g. in a php script on a webserver.
  19. ok - if you have like 3 items, just keep 3 counters like item1, item2 and item3 as global variables. use the string variable to send which items has been taken and increment the according counter: link_message(integer sender_num, integer num, string msg, key id) { if (sender_num == 0) { if(msg == "item1) { ++item1 } else if (msg == "item2) { ++item2; } ... } } there are more elegant ways, but that would do.
  20. ok - in the touch event, after the llGiveInventory you use llMessageLinked(-4, 0, "", llDetectedKey(0)); - this sends a message with the key to scripts in the same prim. In the other script you use the link_message event: link_message(integer sender_num, integer num, string msg, key id) { if (sender_num == 0) { key receiver = id; //save id in some way } }
  21. I meant: What are you usuing to store the data. Well, never mind. Are you selling the item or just giving it away on a touch?
  22. what exactly do you mean by 'database'?
  23. The timer event is most frequently used for that - e.g. to time out a dialog.
×
×
  • Create New...