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

LSL Wiki : GetUserInput

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ia360925.us.archive.org

GetUserInput


This function doesn't exist in LSL, but it can be implemented.
The objective of the following script is to fill a global variable during the rezzing of the object.
Sort of like an Initial Configuration or First Run.

The event is triggered also on touch, as a developing helper.
Hope it helps - Solrac Creber
PD: Thanks Katt Arliss for unclogging my eyes!! Your tip did the trick!

vector thevec=<0.0,0.0,0.0>;
integer g_thequestion=0;

default
{
    on_rez(integer val){
        llSay(0,"I need to be configured");
        llSay(0,"Running startup configuration");
        state config;
    }
    state_entry()
    {
        llSay(0, "Ready to work.");
    }

    touch_start(integer total_number)
    {
        state config;
    }
}

state config{
    state_entry(){
        llSay(0,"enterin Config");
        llOwnerSay("You may configure the door any time ");
        llOwnerSay("by typing 'reconfig'");
        llOwnerSay("------------");        
        llOwnerSay("Pivot Config");
        llOwnerSay("------------");        
        llOwnerSay("Doors usualy pivot in the Z axis,");
        llOwnerSay("but this door can pivot in any axis");
        llOwnerSay("dependind on the answers you'll give.");

        llOwnerSay("------------");        
        llOwnerSay("Type the degrees for the X axis");
        g_thequestion=1;
        llListen(0,"",llGetOwner(),"");
    }

    listen(integer channel, string name, key id, string message){
        if(g_thequestion == 1){
            thevec.x=(float)message;
            llOwnerSay("Type the degrees for the Y axis");
            ++g_thequestion;
        }else if(g_thequestion == 2){
            thevec.y=(float)message;
            llOwnerSay("Type the degrees for the Z axis");
            ++g_thequestion;
        }else if(g_thequestion == 3){
            thevec.z=(float)message;
            llOwnerSay("You have set the door to pivos according to the following:");
            llOwnerSay("rotation: "+ (string)thevec);
        }else {
            //not a very elegant way to bail out but, it's what we've got. Ideas Welcome.
           if(TRUE){state default;}
        }    
    }
    
}
There is no comment on this page. [Display comments/form]