Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string card;
- integer line;
- key query;
- integer part;
- integer handle;
- integer channel;
- list Soundlist = [];
- list SoundNames = [];
- menu(key id)
- {
- list b;
- if (llGetListLength(SoundNames) < 13)
- {
- b = SoundNames;
- } else
- {
- if (part > llGetListLength(SoundNames)) part = 0;
- b = llList2List(SoundNames, part * 11, part * 11 + 9) + ["More"];
- }
- llDialog(id, "Choose a station:", b, channel);
- }
- default
- {
- state_entry()
- {
- if (llGetInventoryNumber(INVENTORY_NOTECARD) == 0)
- {
- llOwnerSay("No notecard found for loading station URLs, please drop one in.");
- } else {
- card = llGetInventoryName(INVENTORY_NOTECARD, 0);
- query = llGetNotecardLine(card, line = 0);
- }
- }
- changed(integer c)
- {
- if (c & CHANGED_INVENTORY) llResetScript();
- }
- dataserver(key id, string data)
- {
- if (query != id) return;
- if (data == EOF) return;
- integer i = llSubStringIndex(data, "=");
- if (i >= 0) {
- SoundNames += [llGetSubString(data, 0, i - 1)];
- Soundlist += [llDeleteSubString(data, 0, i)];
- }
- query = llGetNotecardLine(card, ++line);
- }
- touch_start(integer total_number)
- {
- key id = llDetectedKey(0);
- {
- llListenRemove(handle);
- channel = (integer)llFrand(555555) + 10000;
- handle = llListen(channel, "", id, "");
- menu(id);
- llSetTimerEvent(30.0);
- }
- }
- timer()
- {
- llListenRemove(handle);
- llSetTimerEvent(0.0);
- }
- listen(integer channel, string name, key id, string message)
- {
- if (message == "More")
- {
- part += 1;
- llSetTimerEvent(30.0);
- menu(id);
- return;
- }
- integer index = llListFindList(SoundNames, [message]);
- if (index < 0) return;
- //llTriggerSound("splash", 1);
- llTriggerSound((llList2String(Soundlist, index)), 1);
- llSetText((llList2String(Soundlist, index)), <1,1,1>, 1);
- llListenRemove(handle);
- llSetTimerEvent(0.0);
- }
- }
- ----------------------------------------------------------
- //Notecard with uuid's of sonds named "SoundNames".
- launch = "e6a715af-de8d-768b-954f-fb2cd9f2a9c7"
- fly = f8344cc5-88bd-87e0-fa74-85996aa2b756
- land = 71b2a36b-8b45-5631-2704-afca205ffd59
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement