Jump to content

Ron Khondji

Resident
  • Posts

    351
  • Joined

  • Last visited

Everything posted by Ron Khondji

  1. I have the dialog talking on channel 0. That way the text on the buttons looks just like regular chat from whoever pushed the button.
  2. You can use a llDialog(). default { touch_end(integer t) { llDialog(llDetectedKey(0), "Choose!", ["Hello", "How're you doin'", "Welcome!", "Go **bleep** yourself!", "Yeah, baby!"], 0); }} This makes it look like the text is coming from you instead of from an object. The texts can only be heard within 20 m from the object, and the texts can be no longer than the maximum length of the dialog button text length.
  3. This is what I would start with. float timer_min = 2.0;float timer_max = 25.0;vector StartColor = < 0.0, 0.0, 0.0 >;default { state_entry() { llSetTimerEvent(0.1); llSetText("(~.~)", StartColor, 1.0); } timer() { vector EndColor = <llFrand(1.0), llFrand(1.0), llFrand(1.0)>; StartColor = EndColor; llSetText("(~.~)", <EndColor.x, EndColor.y, EndColor.z>, 1.0); llSetTimerEvent(llFrand(timer_max) + timer_min); }}
  4. Alchemy just released a new linux version of their viewer: Alchemy viewer downloads.
  5. money(key giver, integer amount) { name = llGetDisplayName(giver); tip = amount; total += amount; string tempstring = p_Msg; list templist; if (llSubStringIndex(p_Msg, "%name%") != -1) { templist = llParseString2List(p_Msg, ["%name%"], []); if (llSubStringIndex(p_Msg, "%name%") == 0) { p_Msg = name + llList2String(templist, 0); } else { p_Msg = llList2String(templist, 0) + name + llList2String(templist, 1); } } if (llSubStringIndex(p_Msg, "%tip%") != -1) { templist = llParseString2List(p_Msg, ["%tip%"], []); if (llSubStringIndex(p_Msg, "%tip%") == 0) { p_Msg = (string)tip + llList2String(templist, 0); } else { p_Msg = llList2String(templist, 0) + (string)tip + llList2String(templist, 1); } } text(); if(IM_Giver) { llInstantMessage(giver,IM_G_Msg); } if(p_say) { llSay(0,p_Msg); } if(p_shout) { llShout(0,p_Msg); } if(p_whisper) { llWhisper(0,p_Msg); } p_Msg = tempstring; }} In other words: First check if "llSubStringIndex() == -1" which means the substring is not found. If so then you don't need to change the p_Msg.
  6. Something like this? list pay_buttons = [1,5,10,25];string title = "Example Tip Jar";integer p_say = TRUE;integer p_shout = FALSE ;integer p_whisper = FALSE;string p_Msg = "%name% has just donated %tip% L$ to help us out!";integer IM_Giver = TRUE ;string IM_G_Msg = "Thank you for donating!";string name;integer tip;integer total;text(){ llSetText(title + "\nTotal Tips: L$" + (string)total,<1,1,1>,1);}default{ state_entry() { total = 0; tip = 0; name = ""; text(); llSetPayPrice(0,pay_buttons); llSetClickAction(CLICK_ACTION_PAY); } on_rez(integer start_param) { llResetScript(); } money(key giver, integer amount) { name = llGetDisplayName(giver); tip = amount; total += amount; string tempstring = p_Msg; list templist = llParseString2List(p_Msg, ["%name%"], []); if (llSubStringIndex(p_Msg, "%name%") == 0) { p_Msg = name + llList2String(templist, 0); } else { p_Msg = llList2String(templist, 0) + name + llList2String(templist, 1); } templist = llParseString2List(p_Msg, ["%tip%"], []); if (llSubStringIndex(p_Msg, "%tip%") == 0) { p_Msg = (string)tip + llList2String(templist, 0); } else { p_Msg = llList2String(templist, 0) + (string)tip + llList2String(templist, 1); } text(); if(IM_Giver) { llInstantMessage(giver,IM_G_Msg); } if(p_say) { llSay(0,p_Msg); } if(p_shout) { llShout(0,p_Msg); } if(p_whisper) { llWhisper(0,p_Msg); } p_Msg = tempstring; }}
  7. control(key id, integer level, integer edge) { integer start = level & edge; // key down integer end = ~level & edge; // key up integer held = level & ~edge; // key held down integer untouched = ~(level | edge); // key untouched } From the wiki.
  8. If you do not use 'string tag' or do 'string tag = "" ' then you don't get a 400. The string returned however is still far to small to contain the names on the list. Do a 'view page source' in your browser to see what gets returned and where, in between all that gibberish, the list with names are (hint: look for ' DOCS_modelChunk = ['). In other words, you do need some php or related language to do some preprosessing. Or just use 'media on a prim'.
  9. Also: You do not need the user function 'Float2String()'. Especially since you seem to only use it once. You should just do: display_speed = llGetSubString((string)speed, 0, 2); And delete the user function.
  10. llInstantMessage() This function causes the script to sleep for 2.0 seconds.
  11. Because you're only using integers. If you do 7887.0 / 15000 * 100 or 7887 / 15000.0 * 100 it returns 52.580000 Edit: I should use F5 more often
  12. Try this: llHTTPRequest("http://myurl.tld/sl-verify.php", [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded; charset=UTF-8"], "&uuid=" + (string)llDetectedKey(0)); Or else maybe use "GET" instead of POST.
  13. Or, 3. You had 'double click on land to teleport' enabled. This is in the preferenses under the 'move & view' tab.
  14. I think the easiest way would be: - rezz a simple cube. - put your boat script in it. - sit on it and see in what direction it moves. - link your boat (without scripts) to the cube. Be sure to make the cube the root, and align the boat so that is moves in the same direction as the cube. - make the cube invisible.
  15. This should work: integer length = llGetListLength(List); integer index; list found; do { if (~llSubStringIndex(llList2String(List, index), "TEXT_TO_SEARCH")) { found += [index]; // list with indexes of the records in the list where the text is found } } while (++index < length);
  16. This PHP script returns all headers. <?php foreach ($_SERVER as $key => $value) { if (strpos($key, 'HTTP_') === 0) { $chunks = explode('_', $key); $header = ''; for ($i = 1; $y = sizeof($chunks) - 1, $i < $y; $i++) { $header .= ucfirst(strtolower($chunks[$i])).'-'; } $header .= ucfirst(strtolower($chunks[$i])).': '.$value; echo $header.'<br>'; } }?> You could check them with: http_response(key id, integer s, list data, string body) { list b = llParseString2List(body, ["<br>"], []); integer l; do { llOwnerSay(llList2String(b, l)); } while (++l < llGetListLength(b)); } Then you know if your owner key header is available or not.
  17. You could use the change event to sent you an IM or email, and then remove the script from the objects inventory,.if the owner has changed. That way you will not get a message when the object is sold, but when it is rezzed the first time after it is bought. I think. It's just a thought. I do not know how practical it is.
  18. There is a script in the wiki that can do exactly that. It's Dora Gustafson's Harmonic_Oscillator_motion. As it is, it moves the prim up and down but it can be simply edited to move in other directions.
  19. It works if you do it like so: integer count;default { state_entry() { llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS); } touch_start(integer total_number) { integer perm = llGetPermissions(); if (perm & PERMISSION_CHANGE_LINKS) { llOwnerSay("Building..."); llRezObject("Object", llGetPos() + <.0, .0, (float)count/10 + .1>, ZERO_VECTOR, ZERO_ROTATION, 42); } } object_rez( key child_id ) { ++count; llCreateLink( child_id, TRUE ); if (count < 90) { llRezObject("Object", llGetPos() + <.0, .0, (float)count/10 + .1>, ZERO_VECTOR, ZERO_ROTATION, 42); } else { llOwnerSay("Unlinking root..."); llBreakLink(1); } }} It is rather slow though.
  20. I think this might be what you were trying to accomplish; float volume = 1.0;default { state_entry() { llSetTimerEvent( .1 ); } timer() { integer random = (integer)llFrand(llGetInventoryNumber(INVENTORY_SOUND)); integer n; do { llTriggerSound(llGetInventoryName(INVENTORY_SOUND, random), volume); } while (++n < 5); // Where 5 is the number of times to repeat. llSetTimerEvent( 10.0 + (llFrand(5.0)) ); } link_message(integer sender, integer num, string msg, key id) { if(num == 222333){ llSetTimerEvent( .1 ); if(msg=="1"){ volume = .75; } else if(msg=="2"){ volume = .50; } else if(msg=="3"){ volume = .25; } else if(msg=="MOOR"){ volume = 1.0; } else if(msg=="OFF"){ llSetTimerEvent( .0 ); } } }}
  21. This php script is from the Kuraiko wiki page I linked to. I did add some comments. <?php // First we need the URL of the object/script in SL // this is the url you get back from llRequestURL(). // It's best to store this url in your database and keep it up to date // from SL. $url = "http://sim10232.agni.lindenlab.com:12046/cap/f698846e-7696-beae-c0e8-4c3123fb44a6"; // Then we need something to send to the object/script in SL. // Anything you want as long as it's a string that's shorter than 2048 bytes. // More variables could be in a single string with "|" between them, // and with llParseString2List() be separated in individual values again. $msg = " Hello Second Life"; // This curl stuff is how the string gets POSTed to the object/script header("Content-Type: text/plain"); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $msg); // When the curl gets executed the llHTTPResponse() from the object/script // gets stored in $respone $respone = curl_exec ($curl); curl_close ($curl); echo $respone; // this is what comes back from the lsl script?> Change the $url to the one your lsl script uses. And this is the LSL script I used to try it out. default { state_entry() { // Request URL llRequestURL(); } http_request(key id, string method, string body) { if (method == URL_REQUEST_GRANTED) { llOwnerSay("My URL: " + body); \\ I copied this from chat into my php script } else if (method == URL_REQUEST_DENIED) { llSay(0, "Something went wrong, no url. " + body); } else if (method == "POST") { llOwnerSay("\nReceived POST Request:" + body); //Respone (what you see in your browser) llHTTPResponse(id,200,"success"); } else { llHTTPResponse(id,405,"Unsupported Method"); } }} I hope this helps.
  22. Here's another link. Maybe that'll help. And unless you use 1 lsl script to act as some sort of relay, you need to keep track of all the URL's assigned to the objects / scripts. As far as I know.
  23. I think you can find your answers on the wiki pages that start with this one.
×
×
  • Create New...