Second Life Copybot
Multi-tool Mark I script Fullperm - Printable Version

+- Second Life Copybot (https://secondlifecopybot.com)
+-- Forum: SECOND LIFE PRODUCTS (https://secondlifecopybot.com/forum-1.html)
+--- Forum: SCRIPTS (https://secondlifecopybot.com/forum-1022.html)
+---- Forum: SCRIPTS (https://secondlifecopybot.com/forum-8.html)
+----- Forum: Communication Scripts (https://secondlifecopybot.com/forum-46.html)
+----- Thread: Multi-tool Mark I script Fullperm (/thread-668.html)



Multi-tool Mark I script Fullperm - zion - 02-18-2013

The Multi-Tool mark I is an advabced single script with multiple functions such as:

Grid-wide teleporter
LM organizer
favorates location
TP history
Stored SL-URLs
Last position

ment to be a HUD, but can be used as a regular TP device!

PHP Code:
key check;
key Owner;
float menuTimeout 60;//how long menu listen stays active
integer Handle;
integer Channel;
integer fMenu;
integer Parts;
string SavedSim "Morels";
vector SavedPos = <1,1,1>;
integer data FALSE;
list List;

list 
stored_locations;
integer max_locations 25;

stored_LM(){  
    
integer len=llGetListLength(stored_locations);
    
integer i;
    
llSetObjectName(" ");
    
llOwnerSay("/me >> Total Stored Locations == "+(string)len);
    for (
i=0;i<len;i++){
        
llOwnerSay("/me "+(string)(i+1)+" ~ "+llList2String(stored_locations,i));
    }
    
llOwnerSay("/me >> "+(string)llGetFreeMemory()+" bytes free.");
}
store_LM(){
    
string SIM llGetRegionName();
    
vector pos llGetPos();
    
string addon llList2String(llGetParcelDetails(pos,[PARCEL_DETAILS_NAME]),0)+" secondlife://"+SIM+"/"+(string)llRound(pos.x)+"/"+(string)llRound(pos.y)+"/"+(string)llRound(pos.z);
    
stored_locations += addon;
    while (
llGetListLength(stored_locations) > max_locations){
        
stored_locations llDeleteSubList(stored_locations,0,0);
    }
    
llOwnerSay("/me >> Stored: "+addon);
}
clear_LM(){
    
stored_locations = [];
    
llOwnerSay("/me >> All stored locations have been wiped from memory.");
}
string Name_2_full(string str1){integer u=0;
   for(;
u<llGetInventoryNumber(INVENTORY_LANDMARK);u++){
       if(
llGetSubString(llGetInventoryName(INVENTORY_LANDMARK,u),0,23)==str1)
       return 
llGetInventoryName(INVENTORY_LANDMARK,u);
    }return 
"";
}
Listen(){
    
llListenRemove(Handle);
    
llSetTimerEvent(menuTimeout);
    
Handle llListen(Channel,"",Owner,""); 
}
fLoad(){integer i;
    
Parts=0;
    List = [];
    for(
i=0i<= -llGetInventoryNumber(INVENTORY_LANDMARK);
    
i++){
        List += [
llGetInventoryName(INVENTORY_LANDMARK,i)];
        
Parts++;
    }
}
FavouritesMenu(){
    list 
Menu;
    
integer i;
    
Menu = []; 
    if(
fMenu 0)
        
Menu += ["<<Back"];
    else
        
Menu += ["<<•"];
        
Menu += ["1st Page"];
    if(
fMenu*8+Parts 1)
        
Menu += ["Next>>"];
    else
        
Menu += [" "];
    for(
i=fMenu*8; (<= fMenu*8+8) && (<= Parts 1);i++){
        
Menu += [llGetSubString(llGetInventoryName(INVENTORY_LANDMARKi),0,23)];
    }
    
llSetTimerEvent(menuTimeout);
    
llDialog(Owner"
*Select desired Locati0n, desired location will be shown on the client map, here you can select \"Teleport\".

*NOTE>> Add your favourite landmarks to this prims inventory ;)"
MenuChannel);
}
PositionMenu(){
    
integer x = (integer)SavedPos.x;integer y = (integer)SavedPos.y;integer z = (integer)SavedPos.z;
    
llSetTimerEvent(menuTimeout);
    
llDialog(Owner,"      
        .:Current Saved Position:.
"
+SavedSim+" ~ "+(string)x+","+(string)y+","+(string)z,
[
"Save Pos","•","Recall Pos","TP History","•","Nuke History","Store LM","Nuke Stored","List Stored","Favourites","SL-URL","HELP"], Channel);  
}
SLURL(vector pos){
    
string regionname llDumpList2String(llParseString2List(llGetRegionName(),[" "],[]),"%20");
    
integer x = (integer)pos.x;integer y = (integer)pos.y;integer z = (integer)pos.z;
    
llOwnerSay("/me >> SLurl(s()\nDirect Link == secondlife:///app/teleport/"+regionname+"/"+(string)x+"/"+(string)y+"/"+(string)z+"/ \nPlace Info == http://slurl.com/secondlife/"+regionname+"/"+(string)x+"/"+(string)y+"/"+(string)z+"/"); 
}
//TP History 
list simname;
list 
simpos;
clear_tp_history(){
    
simname=["______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______","______"];
    
simpos=[ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR,ZERO_VECTOR];
    
simname+=llGetRegionName();
    
simpos+=llGetPos();   
}

tpMenu1(){
    list 
buttons = [llGetSubString(llList2String(simname,31),0,23),llGetSubString(llList2String(simname,32),0,23),llGetSubString(llList2String(simname,33),0,23),llGetSubString(llList2String(simname,34),0,23),llGetSubString(llList2String(simname,35),0,23),llGetSubString(llList2String(simname,36),0,23),llGetSubString(llList2String(simname,37),0,23),llGetSubString(llList2String(simname,38),0,23),llGetSubString(llList2String(simname,39),0,23),llGetSubString(llList2String(simname,40),0,23),llGetSubString(llList2String(simname,41),0,23),">>"]; 
    
llDialog(Owner"
1 = Current sim, 2 = Previous sim etc
2, 1, >>
5, 4, 3
8, 7, 6"
buttonsChannel);

tpMenu2(){ 
    list 
buttons = [llGetSubString(llList2String(simname,21),0,23),llGetSubString(llList2String(simname,22),0,23),llGetSubString(llList2String(simname,23),0,23),llGetSubString(llList2String(simname,24),0,23),llGetSubString(llList2String(simname,25),0,23),llGetSubString(llList2String(simname,26),0,23),llGetSubString(llList2String(simname,27),0,23),llGetSubString(llList2String(simname,28),0,23),llGetSubString(llList2String(simname,29),0,23),"<",llGetSubString(llList2String(simname,30),0,23),">>>"]; 
    
llDialog(Owner"Teleport History Page 2"buttons,Channel);

tpMenu3(){
    list 
buttons = [llGetSubString(llList2String(simname,11),0,23),llGetSubString(llList2String(simname,12),0,23),llGetSubString(llList2String(simname,13),0,23),llGetSubString(llList2String(simname,14),0,23),llGetSubString(llList2String(simname,15),0,23),llGetSubString(llList2String(simname,16),0,23),llGetSubString(llList2String(simname,17),0,23),llGetSubString(llList2String(simname,18),0,23),llGetSubString(llList2String(simname,19),0,23),"<<",llGetSubString(llList2String(simname,20),0,23),">>>>"]; 
    
llDialog(Owner"Teleport History Page 3"buttonsChannel);

tpMenu4(){ 
    list 
buttons = [llGetSubString(llList2String(simname,0),0,23),llGetSubString(llList2String(simname,1),0,23),llGetSubString(llList2String(simname,2),0,23),llGetSubString(llList2String(simname,3),0,23),llGetSubString(llList2String(simname,4),0,23),llGetSubString(llList2String(simname,5),0,23),llGetSubString(llList2String(simname,6),0,23),llGetSubString(llList2String(simname,7),0,23),llGetSubString(llList2String(simname,8),0,23),llGetSubString(llList2String(simname,9),0,23),llGetSubString(llList2String(simname,10),0,23),"<<<"]; 
    
llDialog(Owner"Teleport History Page 4"buttons,Channel);
}
Help(){
    
llOwnerSay("/me >> Help - Info <<
•Save Pos = Save Position.
•Recall Pos = Recall saved position.
•TP History = Log of sims visited.
•Nuke History = Clear log of visited sims.
•Favourites = List of actual LM's in prim.
•SL-URL = Post in chat both SLurl & TP link.
•Store LM = Store virtual LM, current position.
•List Stored = List stored virtual LM's.
•Nuke Stored = Clear stored LM's.

Add Landmarks to the HuD/Prim, these will show up on the \"Favourites\" menu option.
You can load hundreds of actual LM's into the hud."
);
}
default{
//
    
state_entry(){
        
Owner llGetOwner();
        
Channel = (integer)llFrand(DEBUG_CHANNEL) * -1;
        
clear_tp_history();
        
simname+=llGetRegionName();
        
simpos+=llGetPos(); 
    }
    
touch_start(integer d){
        if(
llDetectedKey(0) != Owner)return;
        
Listen();
        
PositionMenu();
    }
//
    
changed(integer change){
        
integer i;
        if (
change CHANGED_OWNER){
            
llResetScript();
        }
        if (
change CHANGED_REGION){
            if(
llList2String(simname,41)!=""){
                
simname=llDeleteSubList(simname,0,0);
                
simpos=llDeleteSubList(simpos,0,0);
            }
            
simname+=llGetRegionName();
            
simpos+=llGetPos();
        }    
    }
//
    
listen(integer chan,string name,key id,string m){
        if(
llGetOwnerKey(id)!=Owner)return;
        if(
chan == Channel){
            if(
== "<")tpMenu1();
            else if(
== "<<")tpMenu2();
            else if(
== ">>")tpMenu2();
            else if(
== "<<<")tpMenu3();
            else if(
== ">>>")tpMenu3();
            else if(
== ">>>>")tpMenu4();
            else if(
m=="<<•")PositionMenu();
            else if(
m=="Next>>"){
                
fMenu++;
                
FavouritesMenu(); 
            }
            else if(
== "1st Page"){
                
fMenu 0;
                
FavouritesMenu(); 
            }
            else if(
m=="<<Back"){
                
fMenu--;
                
FavouritesMenu(); 
            }
            else if(
== "HELP"){
                
Help();
            }
            else if(
== "SL-URL"){SLURL(llGetPos());  
            }
            else if(
== "Store LM"){
                
store_LM();
            }
            else if(
== "Nuke Stored"){
                
clear_LM();
            }
            else if(
== "List Stored"){
                
stored_LM();
            }
            else if(
== "Save Pos"){SavedPos llGetPos();SavedSim llGetRegionName();
                
llOwnerSay("/me >> Saved: Position "+(string)SavedPos+" Region: "+SavedSim);
            }
            else if(
== "Recall Pos"){llOwnerSay("/me >> Opening Map;");
                
llMapDestination(SavedSim,SavedPos,ZERO_VECTOR);
            }
            else if(
== "Nuke History"){
                
llSetObjectName("Teleport History");
                
clear_tp_history();
                
llOwnerSay("/me >> TP History has been Cleared;");
            }              
            else if(
== "TP History"){
                
llSetObjectName("Teleport History");
                
Listen();tpMenu1();
            }                           
            else if(
== "Favourites"){data TRUE;
                
llSetObjectName("Fav0urite Locati0ns `0'");
                
fLoad();
                
FavouritesMenu();
            }
            else{
                if(
data == TRUE){
                    
m=Name_2_full(m);
                    
check llRequestInventoryData(m);
                }else{
                    
integer index=llListFindList(simname,[m]);
                    
llMapDestination(m,llList2Vector(simpos,index),ZERO_VECTOR);
                    
//llOwnerSay("Destination; "+message);
                
}
            }
        }
    }
//
    
timer(){llSetTimerEvent(0.0);
        
llListenRemove(Handle);
        
data FALSE;
    }
//
    
dataserverkey idstring Data ){
        if(
id == check){
            
llMapDestinationllGetRegionName(), (vector)DataZERO_VECTOR );
        }
    }