diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-07-14 22:18:53 +0100 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-07-14 22:18:53 +0100 |
| commit | 41f7f7a68ee3d9b3eee55437ef0ffcd1d0277227 (patch) | |
| tree | 6ea7d9afc0d54d1582f39fec0b0bb52372fa40bc /scripts/testing/lsl/axon_test_region_driver.lsl | |
| parent | 99effd37ab6cc6611f75cdca9146cc3c46a86482 (diff) | |
SL-751 - lsl scripts for control of animated objects within a region
Diffstat (limited to 'scripts/testing/lsl/axon_test_region_driver.lsl')
| -rw-r--r-- | scripts/testing/lsl/axon_test_region_driver.lsl | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/scripts/testing/lsl/axon_test_region_driver.lsl b/scripts/testing/lsl/axon_test_region_driver.lsl new file mode 100644 index 0000000000..dfcbb9871a --- /dev/null +++ b/scripts/testing/lsl/axon_test_region_driver.lsl @@ -0,0 +1,54 @@ +list buttons = ["anim start", "anim stop", " ", "verbose on", "verbose off", " "]; +string dialogInfo = "\nPlease make a choice."; + +key ToucherID; +integer dialogChannel; +integer listenHandle; +integer commandChannel; + +default +{ + state_entry() + { + dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); + commandChannel = -2001; + } + + 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 == "-") + { + llDialog(ToucherID, dialogInfo, buttons, dialogChannel); + return; + } + + llListenRemove(listenHandle); + // stop timer since the menu was clicked + llSetTimerEvent(0); + + llOwnerSay("Sending message " + message + " on channel " + (string)commandChannel); + llRegionSay(commandChannel, message); + } + + timer() + { + // stop timer + llSetTimerEvent(0); + + llListenRemove(listenHandle); + llWhisper(0, "Sorry. You snooze; you lose."); + } +} + +// Local Variables: +// shadow-file-name: "$SW_HOME/axon/scripts/testing/lsl/axon_test_region_driver.lsl" +// End: |
