daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Jul 17th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string card;
  2. integer line;
  3. key query;
  4. integer part;
  5. integer handle;
  6. integer channel;
  7. list Soundlist = [];
  8. list SoundNames = [];
  9. menu(key id)
  10.  
  11. {
  12. list b;
  13. if (llGetListLength(SoundNames) < 13)
  14. {
  15. b = SoundNames;
  16. } else
  17.  {
  18. if (part > llGetListLength(SoundNames)) part = 0;
  19. b = llList2List(SoundNames, part * 11, part * 11 + 9) + ["More"];
  20. }
  21. llDialog(id, "Choose a station:", b, channel);
  22. }
  23. default
  24. {
  25. state_entry()
  26. {
  27. if (llGetInventoryNumber(INVENTORY_NOTECARD) == 0)
  28.  
  29. {
  30. llOwnerSay("No notecard found for loading station URLs, please drop one in.");
  31. } else {
  32. card = llGetInventoryName(INVENTORY_NOTECARD, 0);
  33. query = llGetNotecardLine(card, line = 0);
  34. }
  35. }
  36. changed(integer c)
  37. {
  38. if (c & CHANGED_INVENTORY) llResetScript();
  39. }
  40. dataserver(key id, string data)
  41. {
  42. if (query != id) return;
  43. if (data == EOF) return;
  44. integer i = llSubStringIndex(data, "=");
  45. if (i >= 0) {
  46. SoundNames += [llGetSubString(data, 0, i - 1)];
  47. Soundlist += [llDeleteSubString(data, 0, i)];
  48. }
  49. query = llGetNotecardLine(card, ++line);
  50. }
  51. touch_start(integer total_number)
  52. {
  53. key id = llDetectedKey(0);
  54. {
  55. llListenRemove(handle);
  56. channel = (integer)llFrand(555555) + 10000;
  57. handle = llListen(channel, "", id, "");
  58. menu(id);
  59. llSetTimerEvent(30.0);
  60. }
  61. }
  62. timer()
  63. {
  64. llListenRemove(handle);
  65. llSetTimerEvent(0.0);
  66. }
  67. listen(integer channel, string name, key id, string message)
  68. {
  69. if (message == "More")
  70. {
  71. part += 1;
  72. llSetTimerEvent(30.0);
  73. menu(id);
  74. return;
  75. }
  76. integer index = llListFindList(SoundNames, [message]);
  77. if (index < 0) return;
  78. //llTriggerSound("splash", 1);
  79. llTriggerSound((llList2String(Soundlist, index)), 1);
  80. llSetText((llList2String(Soundlist, index)), <1,1,1>, 1);
  81. llListenRemove(handle);
  82. llSetTimerEvent(0.0);
  83. }
  84. }
  85.  
  86. ----------------------------------------------------------
  87.  
  88. //Notecard with uuid's of sonds named "SoundNames".
  89.  
  90. launch = "e6a715af-de8d-768b-954f-fb2cd9f2a9c7"
  91. fly = f8344cc5-88bd-87e0-fa74-85996aa2b756  
  92. land =   71b2a36b-8b45-5631-2704-afca205ffd59
RAW Paste Data
Top