Jump to content

GloriaGlitter

Resident
  • Posts

    80
  • Joined

  • Last visited

Everything posted by GloriaGlitter

  1. Thanks Fritigern - that makes sense.
  2. I am staring a project using a dialog menu and I'm starting with a basic script taken from LSL library. There is a timer event to close the menu after a period of time as well as a Close button. For some reason the menu doesn't close on timeout although the closing message is displayed and the event uses the same line of code as the Close button. It is not crucial to my project but I'd like to know if there is a bug in the script. Here is the script: list buttons = [ "Green", "Red", "CLOSE", "Yellow"]; string dialogInfo = "\nPlease make a choice."; key ToucherID; integer dialogChannel; integer listenHandle; default { state_entry() { dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); } touch_start(integer num_detected) { ToucherID = llDetectedKey(0); llListenRemove(listenHandle); listenHandle = llListen(dialogChannel, "", ToucherID, ""); llDialog(ToucherID, dialogInfo, buttons, dialogChannel); llSetTimerEvent(60.0); // Here we set a time limit for responses } listen(integer channel, string name, key id, string message) { if (message == "CLOSE") { llSetTimerEvent(0); llListenRemove(listenHandle); return; } llListenRemove(listenHandle); // stop timer since the menu was clicked llSetTimerEvent(0); if (message == "Red") { // process Red here } else if (message == "Green") { // process Green here } else { // do any other action here } } timer() { // stop timer llSetTimerEvent(0); llListenRemove(listenHandle); llWhisper(0, "Sorry. You snooze; you lose."); } }
  3. Thanks guys, my script works perfectly now. Regarding why I wanted the pose balls tidied up is so that the place doesn't look untidy for the next visitor
  4. Thanks Fenix - actually the 'hide' message will go out on a channel number - I just had it on channel 0 while testing so I could see if it was working. I suppose I meant lag instead of spam in that you are right, I wanted to avoid repeatedly sending the 'hide' message as it only needs to be said once and to reset when avatars again come within range. Edit - implemented the changes you suggested and all works well. Thanks
  5. I found a script in a forum post that came close to what I wanted which is to say something when one or more avatars are in range and to say something else when there are no avatars in range. The reason to say something when there are no avatars around to hear is that it is a command to listening poseballs to turn invisible. The idea is to keep the land looking tidy when there are no avatars about. The following script works ok except the timer keeps repeating the llSay when no avatars are around causing spam . I know I need to remove the timer but when I do, the script doesn't work at all. Here is the script I have: integer SomebodyNear = 0; default { state_entry() { llSetTimerEvent(10.0); } timer() { llSensor("",NULL_KEY,AGENT,5,PI); } sensor(integer num_detected) { if (SomebodyNear == 0) { llSay(0, "Click board to Show/Hide poseballs"); SomebodyNear = 1; } } no_sensor() { llSay(0, "hide"); SomebodyNear = 0; } }
×
×
  • Create New...