/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// // CONFIGURATION // ////////////////////////////////////////////////////////// // // // You can add or remove destinations to this list. To // add a destination, you need the region name and a // position on that SIM. Best is, for now, to just rez // a box somewhere and place it where your vehicle's // landing point should be. Then add them to this list, // using the format: // // Region Name/x/y/z // // Where x, y an z represent the coordinates of the // primitive you rezzed. You can look at the example // regions adde below for help. list JUMPS = ["New Orleans Island/109/119/509", "12th Man/40/56/759"]; // // // END CONFIGURATION // ////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // INTERNALS // /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // /////////////////////////////////////////////////////////////////////////// integer wasMenuIndex = 0; list wasDialogMenu(list input, list actions, string direction) { integer cut = 11-wasListCountExclude(actions, [""]); if(direction == ">" && (wasMenuIndex+1)*cut+wasMenuIndex+1 < llGetListLength(input)) { ++wasMenuIndex; jump slice; } if(direction == "<" && wasMenuIndex-1 >= 0) { --wasMenuIndex; jump slice; } @slice; integer multiple = wasMenuIndex*cut; input = llList2List(input, multiple+wasMenuIndex, multiple+cut+wasMenuIndex); input = wasListMerge(input, actions, ""); return input; } /////////////////////////////////////////////////////////////////////////// // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // /////////////////////////////////////////////////////////////////////////// integer wasListCountExclude(list input, list exclude) { if(llGetListLength(input) == 0) return 0; if(llListFindList(exclude, (list)llList2String(input, 0)) == -1) return 1 + wasListCountExclude(llDeleteSubList(input, 0, 0), exclude); return wasListCountExclude(llDeleteSubList(input, 0, 0), exclude); } /////////////////////////////////////////////////////////////////////////// // Copyright (C) 2013 Wizardry and Steamworks - License: GNU GPLv3 // /////////////////////////////////////////////////////////////////////////// list wasListMerge(list l, list m, string merge) { if(llGetListLength(l) == 0 && llGetListLength(m) == 0) return []; string a = llList2String(m, 0); if(a != merge) return [ a ] + wasListMerge(l, llDeleteSubList(m, 0, 0), merge); return [ llList2String(l, 0) ] + wasListMerge(llDeleteSubList(l, 0, 0), llDeleteSubList(m, 0, 0), merge); } integer comChannel = 0; integer comHandle = 0; list menu_items = []; string destinations = ""; default { state_entry() { menu_items = []; destinations = ""; integer i = llGetListLength(JUMPS)-1; do { destinations += (string)i + ".) " + llList2String(llParseString2List(llList2String(JUMPS, i), ["/"], []), 0) + "\n"; menu_items += (string)i; } while(--i>-1); } changed(integer change) { if(change & CHANGED_REGION) { llSetForce((<.0,.0,9.82> * llGetObjectMass(llGetOwner())),FALSE); integer comChannel = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; if(llGetInventoryNumber(INVENTORY_OBJECT)) llRezObject(llGetInventoryName(INVENTORY_OBJECT, 0), llGetPos(), ZERO_VECTOR, ZERO_ROTATION, comChannel+18); llSensorRepeat("", NULL_KEY, AGENT, .1, .1, 1); } } no_sensor() { if(llGetAgentInfo(llGetOwner()) & AGENT_ON_OBJECT) llSetForce(ZERO_VECTOR, FALSE); } touch_start(integer total_number) { integer comChannel = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; comHandle = llListen(comChannel, "", llGetOwner(), ""); llDialog(llGetOwner(), "\nPlease choose your destination:\n" + destinations, wasDialogMenu(menu_items, ["<= Back", "", "Next =>"], ""), comChannel); llSetTimerEvent(30); } timer() { llSetTimerEvent(0); llListenRemove(comHandle); llOwnerSay("Sorry, menu timeout..."); } listen(integer channel, string name, key id, string message) { if(message == "<= Back") { llSetTimerEvent(60); llDialog(id, "\nPlease choose your destination:\n" + destinations, wasDialogMenu(menu_items, ["<= Back", "", "Next =>"], "<"), channel); return; } if(message == "Next =>") { llSetTimerEvent(60); llDialog(id, "\nPlease choose your destination:\n" + destinations, wasDialogMenu(menu_items, ["<= Back", "", "Next =>"], ">"), channel); return; } llOwnerSay(llList2String(JUMPS, (integer)message)); llRegionSay(channel+4, llList2String(JUMPS, (integer)message)); } }