Advertisement
Guest User

Second Life: Rezzer System Main v3

a guest
Dec 21st, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. //Rezzer-system-main-v3
  2. integer MEMORY_LENGTH = 250;
  3. list givenList;
  4. integer gInboundCmdChannel = 995;
  5. integer gOutboundCmdChannel = 996;
  6. string RSTART="rstart";
  7. integer multi = TRUE;
  8. integer gListenChannel = 989;
  9. integer gListenHandle;
  10. float gExpiration = 75.0;
  11. list menuitems;
  12. string notecard = "New Scene Help";
  13. vector myPos;
  14. integer tI;
  15. string tS;
  16. string gOpenClosed;
  17. string RSTOP="rstop";
  18. string OpenSound1 = "270ce06c-bce5-7d9f-af9f-1d0accaf3a5b"; //connection established sound
  19. float OpenVol1 = 1.0;
  20. string OpenSound2 = "395e6234-3b87-2394-1e6c-6569986916b1"; //transition sound
  21. float OpenVol2 = 1.0;
  22. string OpenSound3 = "64f092ad-7f34-5a44-f2c4-6559ecdd6b86"; //genie sound
  23. float OpenVol3 = 1.0;
  24. string OpenSound4 = "583f4aa4-5432-4555-8830-4b4a3bd0d808";
  25. float OpenVol4 = 1.0;
  26. string OpenSound5 = "64f092ad-7f34-5a44-f2c4-6559ecdd6b86";
  27. float OpenVol5 = 1.0;
  28. key tK;
  29. key crate = "bcf02ab6-1cf8-fc38-0a50-94f9cf1c6c8b";
  30.  
  31.  
  32. init() {
  33.  
  34. }
  35. default
  36. {
  37. on_rez(integer param) {
  38. llResetScript();
  39. init();
  40. }
  41. state_entry() {
  42. init();
  43. llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
  44. state ready;
  45. }
  46.  
  47.  
  48. }
  49. state ready
  50. {
  51. state_entry()
  52. {
  53. llOwnerSay( "Ready. Click to start." );
  54. llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
  55. if(OpenSound1 != "") llTriggerSound(OpenSound1, OpenVol1);
  56.  
  57. }
  58.  
  59. touch_start( integer num )
  60. {
  61. if ( llDetectedKey ( 0 ) == llGetOwner() )
  62. {
  63. llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
  64. if(OpenSound1 != "") llTriggerSound(OpenSound1, OpenVol1);
  65. state build;
  66.  
  67. }
  68. }
  69. }
  70.  
  71. state build
  72. {
  73. state_entry()
  74. {
  75.  
  76. llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
  77. llListen(gListenChannel, "", llGetOwner(),"");
  78. if(OpenSound2 != "") llTriggerSound(OpenSound2, OpenVol2);
  79.  
  80. }
  81. touch_end(integer total_number) {
  82. if(OpenSound1 != "") llTriggerSound(OpenSound1, OpenVol1);
  83. key who = llDetectedKey(0);
  84. integer cmdChannel = (integer)llFrand(-200000) - 100;
  85.  
  86. integer i;
  87. integer iCount=llGetInventoryNumber(INVENTORY_OBJECT);
  88. menuitems = [];
  89. for(i=iCount - 1; i>=0; i--)
  90. {
  91.  
  92. string name = llGetInventoryName(INVENTORY_OBJECT, i);
  93.  
  94. if (llGetScriptName() != name) {
  95.  
  96. menuitems += name;
  97.  
  98. }
  99. }
  100.  
  101. list choices = llList2ListStrided(menuitems, 0, -1, 2);
  102. llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, .05);
  103. if(OpenSound2 != "") llTriggerSound(OpenSound2, OpenVol2);
  104. llDialog(who, "Select a menu item", menuitems, cmdChannel);
  105. gListenHandle = llListen(cmdChannel, "", who, "");
  106. }
  107.  
  108. listen(integer ch, string name, key id, string message) {
  109. integer choice = llListFindList(menuitems, [message]);
  110. if (message == "New Scene") {
  111. llSay(0,"CLEAR");
  112. vector vThisPos=llGetPos();
  113. rotation rThisRot=llGetRot();
  114.  
  115. llOwnerSay( "New scene crate created" );
  116. if(OpenSound3 != "") llTriggerSound(OpenSound3, OpenVol2);
  117. //llGiveInventory(llDetectedKey(0), "New Scene Help");
  118. llRezObject(message, vThisPos+<0,0,.3>, ZERO_VECTOR, ZERO_ROTATION, 0 );
  119.  
  120. } else if (llToLower(message) == "clear"){
  121. if(OpenSound5 != "") llTriggerSound(OpenSound5, OpenVol5);
  122. llDie();
  123. } else {
  124. llSay(0,"CLEAR");
  125. vector vThisPos=llGetPos();
  126. rotation rThisRot=llGetRot();
  127. llRezObject(message, vThisPos+<0,0,.3>, ZERO_VECTOR, ZERO_ROTATION, 0 );
  128. llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);
  129. if(OpenSound4 != "") llTriggerSound(OpenSound4, OpenVol4);
  130. llSay(gOutboundCmdChannel, RSTART);
  131. llSay(0, "BUILD");
  132. }
  133. }
  134.  
  135. }
  136.  
  137. state needs_something
  138. {
  139. on_rez( integer num)
  140. {
  141. state default;
  142. }
  143.  
  144. touch_start( integer num )
  145. {
  146. if ( llDetectedKey ( 0 ) == llGetOwner() )
  147. {
  148. state default;
  149. }
  150. }
  151. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement