summaryrefslogtreecommitdiff
path: root/scripts/testing/lsl/axon_test_region_driver.lsl
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-11-14 15:22:47 -0800
committerGraham Linden <graham@lindenlab.com>2018-11-14 15:22:47 -0800
commitaa0115053aaa28de1c472410931c57b3e43b72a7 (patch)
tree9a8ba45529cb125a2ae5cd4672b3fd093af9b45c /scripts/testing/lsl/axon_test_region_driver.lsl
parent4662ba8a2693780198d555a49a00cfafba838d41 (diff)
parent1d022e86c84039f88c531e91ce857666acd224a1 (diff)
Merge
Diffstat (limited to 'scripts/testing/lsl/axon_test_region_driver.lsl')
-rw-r--r--scripts/testing/lsl/axon_test_region_driver.lsl54
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..dcf146a9cf
--- /dev/null
+++ b/scripts/testing/lsl/axon_test_region_driver.lsl
@@ -0,0 +1,54 @@
+list buttons = ["anim start", "anim stop", "step", "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: