Don't click here unless you want to be banned.

LSL Wiki : LibrarySenRez

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
Meta-rez
This is a two-script method for blindly rezzing whatever you want.

Put the 'metarez' script in one. Put the 'rezslave' script in a bunch of times. Name the rezslave scripts squentially, like this: "rezslave 1", "rezslave 2", "rezslave 3"

it's fine to leave one called 'rezslave' with no number in there, but don't have two with the same number or you'll get two of whatever you're trying to rez. Maybe. ;)

To use it, spam the prim you put the stuff in with linked messages - repeatedly hit it with 1400 and a string separated by ; marks, representing the various parameters (in the order normally passed to llRezObject)

Example usage:
llMessageLinked(LINK_THIS, 1400, "lessonbot;" + vec2str(llGetPos()+<0,0,3>) + ";0,0,0;0,0,0,1;" + (string)iChan, (key)"");

Here's metarez:
integer rezsp;
list rezstatus;
list simpleRezQueue;

simpleRez( string str )
{
    integer i = llListFindList( rezstatus, [1] );

    if( i < 0 ) {
        simpleRezQueue = (simpleRezQueue=[]) + simpleRezQueue + [ str ];
        return;
    }

    rezstatus = llListReplaceList(rezstatus, [0], i, i);
    llMessageLinked( LINK_THIS, llList2Integer(rezstatus, i - 1), str, "" );
}

default
{
    state_entry()
    {
        llMessageLinked( LINK_THIS, 1798, "", "" );
        rezstatus = [];
    }

    link_message( integer sp, integer num, string str, key id )
    {
        if( num == 1799 ) {
            integer reqid = (integer)str;
            integer i = llListFindList(rezstatus, [reqid]);
            if( llGetListLength(simpleRezQueue) > 0 ) {
                llMessageLinked( LINK_THIS, reqid, llList2String(simpleRezQueue, 0), "" );
                simpleRezQueue = llDeleteSubList(simpleRezQueue, 0, 0);
            } else {
                if( i < 0 ) {
                    rezstatus = (rezstatus=[]) + rezstatus + [ reqid, 1 ];
                } else {
                    rezstatus = llListReplaceList(rezstatus, [ reqid, 1 ], i, i+1);
                }
            }
        } else if( num == 1400 ) {
            simpleRez(str);
        }
    }
}


And here's the slave:


vector str2vec(string s)
{
    list l = llParseString2List( s, [","], [] );
    return < (float)llList2String(l, 0), (float)llList2String(l, 1), (float)llList2String(l, 2) >;
}
rotation str2rot(string s)
{
    list l = llParseString2List( s, [","], [] );
    return < (float)llList2String(l, 0), (float)llList2String(l, 1), (float)llList2String(l, 2), (float)llList2String(l, 3) >;
}

integer myrequestid;

default
{
    state_entry()
    {
        list lNames = llParseString2List(llGetScriptName(), [" "], []);
        if( llGetListLength(lNames) < 2 ) myrequestid = 1700;
        else myrequestid = 1700 + (integer)llList2String(lNames,-1);
    }
    
    link_message( integer sp, integer ch, string msg, key id )
    {
        if( ch == myrequestid ) {
            list lData = llParseString2List(msg, [";"], []);
            llRezObject( llList2String(lData, 0), str2vec(llList2String(lData, 1)), str2vec(llList2String(lData, 2)),
                str2rot(llList2String(lData, 3)), (integer)llList2String(lData, 4));
            llMessageLinked( sp, 1799, "", "" );
        }
    }
}

Good luck.

Go back. ScriptLibrary
There is no comment on this page. [Display comments/form]