Advertisement
Gayngel

Untitled

Feb 20th, 2015
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. integer listen_handle;
  2. integer channel = -329;
  3. key ToucherID;
  4. string Mainmessage = "\nPlease make a choice.";
  5. string SettingsMsg = "Please choose a setting.";
  6. string TransparencyMsg = "Choose to show or hide the object.";
  7. string DeleteMsg = "Are you sure you want to delete the object?";
  8. string ReturnMsg = "Do you want to return the object to your inventory?";
  9.  
  10. list mainpage = ["On", "Off", "Settings", "Delete", "Return"];
  11. list settings = ["Size", "Transparency", "Delete", "Return"];
  12. list resize = ["1m", "2m", "3m", "4m", "5m", "6m", "7m", "8m", "9m", "10m", "On"];
  13. list transparency = ["Show", "Hide"];
  14. list delete = ["Yes","No"];
  15. list returnIt = ["Yes return it", "No don't return it"];
  16.  
  17. DialogMenu()
  18. {
  19. llListenRemove(listen_handle);
  20. listen_handle = llListen(channel, "", ToucherID, "");
  21. llSetTimerEvent(60.0);
  22. }
  23.  
  24. MainMenu()
  25. {
  26. DialogMenu();
  27. llDialog(ToucherID, Mainmessage, mainpage, channel);
  28.  
  29. }
  30.  
  31. settingsMenu()
  32. {
  33. DialogMenu();
  34. llDialog(ToucherID, SettingsMsg, settings, channel);
  35.  
  36. }
  37.  
  38. resizeMenu()
  39. {
  40. string ScaleMsg = "\n Please select what size the object should be. It should be the same size as your landing point. Then turn it on. \nCurrent size is " + (string)scale + "m.";
  41. DialogMenu();
  42. llDialog(ToucherID, ScaleMsg, resize, channel);
  43.  
  44. }
  45.  
  46. TransparencyMenu()
  47. {
  48. DialogMenu();
  49. llDialog(ToucherID, TransparencyMsg, transparency, channel);
  50.  
  51. }
  52.  
  53. DeleteMenu()
  54. {
  55. DialogMenu();
  56. llDialog(ToucherID, DeleteMsg, delete, channel);
  57.  
  58. }
  59.  
  60. ReturnMenu()
  61. {
  62. DialogMenu();
  63. llDialog(ToucherID, ReturnMsg, returnIt, channel);
  64.  
  65. }
  66.  
  67. default
  68.  
  69. {
  70.  
  71. touch_end(integer num)
  72. {
  73. ToucherID = llGetOwner();
  74.  
  75. if( llDetectedKey(0) == ToucherID)
  76. {
  77. MainMenu();
  78.  
  79.  
  80. }
  81. }
  82.  
  83.  
  84. listen(integer channel, string name, key id, string message)
  85. {
  86.  
  87.  
  88. if (message == "On")
  89. {
  90.  
  91. // do something;
  92. llListenRemove(listen_handle);
  93.  
  94. }
  95.  
  96. else if (message == "Off")
  97. {
  98. llListenRemove(listen_handle);
  99. llSensorRemove();
  100.  
  101.  
  102. }
  103.  
  104. else if (message = "Settings")
  105. {
  106. settingsMenu();
  107. }
  108.  
  109. else if (message == "Size")
  110. {
  111. resizeMenu();
  112. }
  113.  
  114.  
  115.  
  116. else if (message == "1m")
  117. {
  118. //set scale
  119.  
  120. }
  121.  
  122. else if (message == "2m")
  123. {
  124. //set scale
  125.  
  126. }
  127.  
  128. else if (message == "3m")
  129. {
  130. //set scale
  131.  
  132. }
  133.  
  134. else if (message == "4m")
  135. {
  136. //set scale
  137.  
  138. }
  139.  
  140. else if (message == "5m")
  141. {
  142. //set scale
  143.  
  144.  
  145. }
  146.  
  147. else if (message == "6m")
  148. {
  149. //set scale
  150.  
  151. }
  152.  
  153. else if (message == "7m")
  154. {
  155. //set scale
  156.  
  157. }
  158.  
  159. else if (message == "8m")
  160. {
  161. //set scale
  162.  
  163. }
  164.  
  165. else if (message == "9m")
  166. {
  167. //set scale
  168.  
  169. }
  170.  
  171. else if (message == "10m")
  172. {
  173. //set scale
  174. }
  175.  
  176. else if (message == "Transparency")
  177. {
  178. TransparencyMenu();
  179. }
  180.  
  181. else if (message == "Show")
  182. {
  183. llSetAlpha(1.0,ALL_SIDES);
  184. }
  185.  
  186. else if (message == "Hide")
  187. {
  188. llSetAlpha(0.0,ALL_SIDES);
  189. }
  190.  
  191. else if (message == "Delete")
  192. {
  193. DeleteMenu();
  194. }
  195.  
  196. else if (message == "Return")
  197.  
  198. {
  199. ReturnMenu();
  200. }
  201.  
  202. if (message == "Yes")
  203. {
  204. llDie();
  205. }
  206.  
  207. else if (message == "No")
  208. {
  209. MainMenu();
  210. }
  211.  
  212. else if (message == "Yes return it")
  213. {
  214. //return object
  215. }
  216.  
  217. else if (message == "No don't return it")
  218. {
  219. MainMenu();
  220. }
  221.  
  222.  
  223. llSetTimerEvent(0);
  224. }
  225.  
  226.  
  227. timer()
  228. {
  229. // stop timer
  230. llSetTimerEvent(0);
  231.  
  232. llListenRemove(listen_handle);
  233. llOwnerSay("Dialog timed out. Please touch the sweeper and try again.");
  234. }
  235.  
  236. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement