Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Teleport-Script mit Menue
#1
Das Script:

PHP-Code:
// 12/01/08 List command doesn't work. Useless anyways hehe!
string  _notecard "hyperjumps";
key avatar;

integer chatChannel 212;
integer channel=155;
string HELP_MSG "Wuuschhhhhhhhhh ...";


list    
_teleporterURLs;
list    
_teleporterStatons;
list    
theStatons;

integer _linenum 0;
integer curStatonOffset 0;
integer statonChunk 6;
integer curStatonEnd 5;
integer totalStatons 0;
integer dialogActive 0;
integer curIdx  = -1;
string dispStatonStr "";

string NEXT_MSG "Next >>";
string PREV_MSG "<< Prev";
string LIST_MSG "List";

string CUR_SET  "c";
string ALL_SET  "a";

list 
cmdNextChunk = [">>""next""Next"];
list 
cmdPrevChunk = ["<<""prev""Prev"];
list 
cmdLsCur     = ["ls""list"];
list 
cmdLsAll     = ["la""listall"];
list 
cmdSearch    = ["s""search"];

string newURL;
string newDesc;

//-----------------------

reset_teleporter()
{
    
llSetText("starting teleporter....",<1,1,1>,1.0 );
    
llListen(77"""""");
    
curStatonOffset 0;
    
curStatonEnd 5;
    
_linenum 0;
    
dialogActive 0;
    
_teleporterURLs = [];
    
_teleporterStatons = [];
    
totalStatons 0;
    
curIdx = -1;
    
dispStatonStr "";
    
llGetNotecardLine(_notecard_linenum);
}

add_staton(string line)
{
  
//  list words = llParseString2List(line, [" ", " ", "="], []);
    
list words llParseString2List(line, ["="], []);
    if (
llGetListLength(words) < 2)
    {
        return;
    }
    
string url llList2String(wordsllGetListLength(words) - 1);
    
string staton "";
    
integer i;

    for (
i=0i<llGetListLength(words) - 1i++)
    {
        if (
llStringLength(staton) > 0)
        {
            
staton += " ";
        }
        
staton += llList2String(wordsi);
    }

    
_teleporterURLs += [url];
    
_teleporterStatons += [staton];
}


curStatons()
{
    
theStatons = [PREV_MSGLIST_MSGNEXT_MSG];

    
integer i;
    
dispStatonStr "";

    for (
curStatonOffset<= curStatonEndi++)
    {
        if (
curIdx == i)
        {
            
dispStatonStr += "*";
        } else {
                
dispStatonStr += "  ";
        }
        
dispStatonStr += (string) (1) + ") ";
        
dispStatonStr += llList2String(_teleporterStatonsi);
        
dispStatonStr += "\n";

        
theStatons += (string)(1);
    }
}


doNextSet()
{
    
curStatonOffset += statonChunk;
    
curStatonEnd curStatonOffset + (statonChunk 1);

    if (
curStatonOffset >= totalStatons)
    {
        
curStatonOffset 0;
        
curStatonEnd curStatonOffset + (statonChunk 1);
    }

    if (
curStatonEnd >= totalStatons)
    {
        
curStatonEnd totalStatons 1;
    }
}


doPrevSet()
{
    if (
curStatonOffset 1  && ((curStatonOffset statonChunk) < 1))
    {
        
curStatonOffset 0;
    } else {
            
curStatonOffset -= statonChunk;
    }

    
curStatonEnd curStatonOffset + (statonChunk 1);

    if (
curStatonEnd >= totalStatons)
    {
        
curStatonEnd totalStatons 1;
    }

    if (
curStatonOffset 0)
    {
        
curStatonEnd totalStatons 1;
        
curStatonOffset totalStatons - (statonChunk 1);
    }
}

doListStatons(string mode)
{
    
integer i;
    
integer startPos;
    
integer endPos;

    if (
mode == "a")
    {
        
startPos 0;
        
endPos totalStatons 1;
    }
    else
    {
            
startPos curStatonOffset;
        
endPos curStatonEnd;
    }

    for (
startPos<= endPosi++)
    {
        
string newURL llList2String(_teleporterURLsi);
        
string newDesc llList2String(_teleporterStatonsi);
         
//llSay(0, (string)(i + 1) + ": " + newDesc + " = " + newURL);
    
}
}


doSearch(list theTerms)
{
    
integer i;
    
string thePhrase llToLower(llDumpList2String(theTerms" "));
    
llSay(0"the term is " thePhrase);

    for (
0totalStatonsi++)
    {
        
string curString llList2String(_teleporterStatonsi);
        if (
llSubStringIndex(llToLower(curString), thePhrase) != -1)
        {
            
string newURL llList2String(_teleporterURLsi);
            
llSay(0, (string)(1) + ": " curString " = " newURL);
        }
    }
}

//-----------------------

default
{
  
state_entry()  //on_rez(integer start_param)
   
{
       
reset_teleporter();
    }




    
dataserver(key query_idstring data)
    {
        if (
data != EOF)
        {
            
add_staton(data);
            
_linenum++;

            if (
_linenum == 0)
            {
                
llSetText("starting: \n" + (string)_linenum " statons ...",
                    <
1,1,1>,1.0 );
            }
            
llGetNotecardLine(_notecard_linenum);
            return;
        }
        
llListen(channel""NULL_KEY"");

        
totalStatons llGetListLength(_teleporterURLs);
        
llSay(0HELP_MSG);
        
dialogActive 1;
        
llSetText("SoA 2015 - Teleporter", <1,1,1>, 1.0 );
    }

    
touch_start(integer touchNumber)
    {

         
curStatons();

       
llDialog(llDetectedKey(0),
           
dispStatonStr,
           
theStatonschannel);
    
avatar llDetectedKey(0);
      }

    
listen(integer channelstring namekey idstring message)
    {

        if (
dialogActive == 0)
        {
            
llWhisper(0" ... still loading statons ...");
            return;
        }

        if (
message == "")
        {
            
message "cur";
        }


    
//    list words = llParseString2List(message, [" ", "="], []);
       
list words llParseString2List(message, [" "" ""="], []);
         list 
testFind llList2List(words00);

        if (
llListFindList(cmdNextChunktestFind) != -1)
        {
            
doNextSet();
            
curStatons();
            if (
channel == chatChannel)
            {
                
doListStatons(CUR_SET);
            }
            else
            {
                    
llDialog(iddispStatonStr,theStatonschannel);
            }
            return;
        }

        else if (
llListFindList(cmdPrevChunktestFind) != -1)
        {
            
doPrevSet();
            
curStatons();
            if (
channel == chatChannel)
            {
                
doListStatons(CUR_SET);
            }
            else
            {
                    
llDialog(iddispStatonStrtheStatonschannel);
            }
            return;
        }

        else if (
llListFindList(cmdSearchtestFind) != -1)
        {
            
doSearch(llList2List(words1, -1));
            return;
        }

        else if (
llListFindList(cmdLsAlltestFind) != -1)
        {
            
doListStatons(ALL_SET);
            return;
        }


        else if (
llListFindList(cmdLsCurtestFind) != -1)
        {
            
doListStatons(CUR_SET);
            return;
        }


        else if ((integer)
message && (integer)message 256)
        {

             
curIdx = (integer)message 1;

            
string newURL llList2String(_teleporterURLscurIdx);
           
// string newDesc = llList2String(_teleporterStatons, curIdx);
vector LookAt = <1,1,1>;

    
integer ullSubStringIndex(newURL"<");
integer v=llStringLength(newURL);
newDesc=llGetSubString(newURL,0,u-1);
newURL=llGetSubString(newURL,u,v);
 
// llSay(0, newDesc);


  //llSay(0, newURL);


     
vector dings =(vector)newURL;
    
osTeleportAgent(avatarnewDescdingsLookAt);
       
// llMapDestination(newDesc,dings, LookAt);
          
llResetScript(); // llSetParcelMusicURL(newURL);
        
}
    }


Beispiel-Notecard für hyperjumps:


PHP-Code:
menue-punkt1=region1<12520322)>
menue-punkt2=region2<371922)> 


Das Script läuft stabil ! Für Event-Regionen, die Channel anpassen.
www.kamen-fotografie.de | Fotos vom besten Fotografen
Zitieren
#2
Ich würde das auf fehlendes vertrauen in die Technik schließen. Das sehe ich auch sehr oft im RL.
Man traut dem drahtlosen Autoschlüssel nicht, dass das Auto zu ist, man zieht nochmal an der Tür.
Wenn man es normal zuschließt, macht man dies nicht.

Hier ist es halt, das es nicht ausreicht zu wissen das ein Script neu gestartet wird. Man muss sichergehen und es doppelt machen.
Zitieren
#3
Jedesmal wenn ich OpenSim im Debugger habe, und auf die Region teleporte, darf ich 3 exceptions wegklicken die von llResetScript ausgelöst wurden.
Woran es genau liegt kann ich aber nicht sagen, hab ich mir nicht genau angeschaut ^^
Scheint aber ein Tieferes Problem zu sein das man nicht mal eben so weg patchen kann.
Zitieren


Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
Question Tür script gesucht, Tür soll bei Eintritt ein paar meter vorher öffnen Kalkofe 9 646 11.10.2023, 05:37
Letzter Beitrag: Christoph Balhaus
  Rufknopf Script für Aufzug gesucht Xenos Yifu 4 1.990 03.04.2022, 19:09
Letzter Beitrag: Mareta Dagostino
  Geber/ Rezz Script Xenos Yifu 10 4.738 28.11.2020, 14:28
Letzter Beitrag: Kubwa
  Suche Script Gruppe Titoss 4 6.735 27.11.2020, 14:52
Letzter Beitrag: Dorena Verne
  Follow me Script brenner23 3 7.586 29.11.2018, 23:05
Letzter Beitrag: Manfred Aabye

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste