Change font size
It is currently Sun Jul 22, 2018 2:55 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: Radnom Scripts(Post#2 help wanted)
PostPosted: Tue Dec 29, 2009 12:56 pm 
Furious Typer

Joined: Mon Jan 12, 2009 10:47 am
Posts: 150
Yes, its actually stupid to call a lockable door some sort of security, but well the development counts...

Proudly annouce this one, should be quite secure, its still beta and lots of functions will come, but try it out:
{L_CODE}:
vector closed = <2,-0.5,0>;
integer open = FALSE;
string password = "furry";
integer chann = 66;
integer listener = TRUE;
default
{
    touch_start(integer num_detected)
    {
        if (open == FALSE)
        {
            llInstantMessage(llDetectedKey(0) , "Say Password in channel " + chann);
            llListen(chann, "","","");
            listener = TRUE;
            llSetTimerEvent(5.0);
        }
        else if (open == TRUE)
        {
            llSetPos(llGetPos() - closed);
            open = FALSE;
            llListenRemove(1);
            listener = FALSE;
        }
    }
    listen(integer channel, string name, key id, string message)
    {
        if (open == FALSE)
        {
            if (llToLower(message) == password)
            {
                llSetPos(llGetPos() + closed);
                open = TRUE;
                llListenRemove(1);
                listener = FALSE;
            }
            else if (llToLower(message) != password)
            {
                llWhisper(0, "Invalid password");
                llListenRemove(1);
                listener = FALSE;
            }
        }
    }
    timer()
    {
        if (listener == TRUE)
        {
            llListenRemove(1);
            llWhisper(0, "Timeout.");
            listener = FALSE;
            llSetTimerEvent(0.0);
        }
        else if (listener == FALSE)
        {
            llSetTimerEvent(0.0);
        }
    }
}


Ok next up we have following: A bit for the greifs to moun about, surely:
{L_CODE}:
list access_list_low = [""];
list access_list_high = [""];
float delay = 3;  //  How often the sensor scans in seconds.
float range = 94;  //  Sensor range in meters. Max is 96
integer stated = TRUE;

default
{
    state_entry()
    {
        llSetObjectName("Security System");
        llSensorRepeat("","",AGENT,range,PI,delay);
        llListen(2627, "",llGetOwner(),"");
    }
    listen(integer channel, string name, key id, string message)
    {
        if (llToLower(message) == "secure high")
        {
            llInstantMessage(llGetOwner(), "Security Setting is set to High");
            stated = FALSE;
        }
        else if (llToLower(message) == "secure low")
        {
            llInstantMessage(llGetOwner(), "Security Setting is set to Low");
            stated = TRUE;
        }
           
    }
    sensor(integer number)
    {
        if (stated == TRUE)
        {
            if(llListFindList(access_list_low, (list)llKey2Name(llDetectedKey(0))) == -1)
            {
                llInstantMessage(llDetectedKey(0),"\nUnathorized access.\nSending you home in 5 seconds.");
                llSleep(1.0);
                llTeleportAgentHome(llDetectedKey(0));
            }
        }
        else if (stated == FALSE)
        {
            if(llListFindList(access_list_high, (list)llKey2Name(llDetectedKey(0))) == -1)
            {
                llInstantMessage(llDetectedKey(0),"\nUnathorized access.\nSending you home in 5 seconds.");
                llSleep(1.0);
                llTeleportAgentHome(llDetectedKey(0));
            }
        }
    }
}


Works quite well :)

OK, this thing does basicly five things for ya: Right click->open->copy to inventory->feel good
JUst extracts all contents but not itself and you can enter your support contact under the objects desc.
{L_CODE}:
default
{
    state_entry()
    {
        llSleep(2.0);
        llOwnerSay("Stand close to " + (string)llGetObjectName() + " at: " + (string)llGetPos() + " You will recieve your purchased items shortly!");
        integer i = 0;
       
        while (i < llGetInventoryNumber(INVENTORY_ALL))
        {
            if (llGetInventoryName (INVENTORY_ALL, i) != llGetScriptName() )
            {
                   llGiveInventory(llGetOwner(), llGetInventoryName (INVENTORY_ALL, i));
            }
            ++i;
        }
        llOwnerSay("If you havent recieved any contents, click the prim to execute another try.");
    }
    touch_start(integer total_number)
    {
        llSleep(2.0);
        llOwnerSay((string)llGetObjectName() + " will try to deliver your purchased items again. Please make sure you stand close to this object at: " + (string)llGetPos());
        integer i = 0;
       
        while (i < llGetInventoryNumber(INVENTORY_ALL))
        {
            if (llGetInventoryName (INVENTORY_ALL, i) != llGetScriptName() )
            {
                   llGiveInventory(llDetectedKey(0), llGetInventoryName (INVENTORY_ALL, i));
            }
            ++i;
        }
        llOwnerSay("If you still havent recieved your items, please contact the support at: " + (string)llGetObjectDesc());
    }
}


And my test bed which ended up as script telling you some stats about the sim its on:
{L_CODE}:
default
{
    state_entry()
    {
        llSetTimerEvent(300.0);
    }
    timer()
    {
        llInstantMessage(llGetOwner(), llGetRegionName() + " currently replies following: " + " Current Time = " + (string)llGetTimestamp() + " SIM FPS = " + (string)llGetRegionFPS() + " Time Dilation = " + (string)llGetRegionTimeDilation() + " Current Agentcount = " + (string)llGetRegionAgentCount());
    }
    touch_start(integer touches)
    {
        llInstantMessage(llGetOwner(), llGetRegionName() + " currently replies following: " + " Current Time = " + (string)llGetTimestamp() + " SIM FPS = " + (string)llGetRegionFPS() + " Time Dilation = " + (string)llGetRegionTimeDilation() + " Current Agentcount = " + (string)llGetRegionAgentCount());
    }
}


Multistaff Staffbell, rings the staff, next up is a teleport request going fromt he object...:
{L_CODE}:
//Staff Bell by Lila Magenta. Uncomment if more staff is used, insert keys.
key staff1 = "";
//key staff2 = "";
//key staff3 = "";
default
{
    state_entry()
    {
        llSetText("If Staff is not around click me!", <0,0,0>, 10.0);
    }
    touch_start(integer touches)
    {
        if (llDetectedKey(0) != llGetOwner())
        if (llDetectedKey(0) != staff1)
        //if (llDetectedKey(0) != staff2)
        //if (llDetectedKey(0) != staff3)
        {
            llWhisper(0, "Staff contacted, if available, will arrive shortly!");
            llInstantMessage(llGetOwner(), llDetectedName(0) + " rang the bell at " + llGetRegionName());
            llInstantMessage(staff1, llDetectedName(0) + " rang the bell at " + llGetRegionName());
            //llInstantMessage(staff2, llDetectedName(0) + " rang the bell at " + llGetRegionName());
            //llInstantMessage(staff3, llDetectedName(0) + " rang the bell at " + llGetRegionName());
        }
    }
}


And at last, my pose script, buggy and sometimes doesnt work, but its simple...very...:
{L_CODE}:
string anim ;
default
{
    changed(integer change)
    {
        if (change & CHANGED_LINK)
        {
            llSetAlpha(0.5,ALL_SIDES);
            anim = llGetInventoryName(INVENTORY_ANIMATION, 0);
            llSitTarget(<0,0,.1>, ZERO_ROTATION);
            key uuid = llAvatarOnSitTarget();
            if (uuid != NULL_KEY)
            {
                llRequestPermissions( uuid, PERMISSION_TRIGGER_ANIMATION );
            }
        }
    }
    run_time_permissions(integer change)
    {
        if (change & PERMISSION_TRIGGER_ANIMATION)
        {
            llSetAlpha(0.0,ALL_SIDES);
            llStopAnimation("sit");
            llStartAnimation(anim);
        }
    }
}


All these scripts are under GPL/GNU license, please post any mods to em here :)

Peace.

_________________
{L_IMAGE}


Last edited by Vincent Sylvester on Thu Dec 31, 2009 10:28 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Some stuff that came up randomly...
PostPosted: Thu Dec 31, 2009 12:21 pm 
Furious Typer

Joined: Mon Jan 12, 2009 10:47 am
Posts: 150
Now I some help with something.
{L_CODE}:
integer set = 9;
integer chan = 2;//the channel the ligth listens on
vector green = <0,1,0>;
vector yellow = <1,1,0>;
vector red = <1,0,0>;
vector cyan = <0.25,1,1>;
vector pink = <1,0,0.5>;
vector orange = <1,0.5,0>;
vector white = <1,1,1>;
vector black = <0,0,0>;
vector blue = <0,0,0>;//add more light below
default
{
    state_entry()
    {
        llListen(chan,"","","");
    }
    listen(integer channel, string name, key id, string message)
    {
        if(llToLower(message) == "mix1")
        {
            set = 1;
            llSetTimerEvent(0.8);//edit the timer if your mix is longer
        }
        else if(llToLower(message) == "mix2")
        {
            set = 2;
            llSetTimerEvent(0.8);
        }
        else if(llToLower(message) == "mix3")
        {
            set = 3;
            llSetTimerEvent(0.8);
        }
        else if(llToLower(message) == "stop")
        {
            llSetTimerEvent(0.0);
            //add here the default values
        }//add more if events if you have mroe mixtures, but remember that the controller must be able to handel em all.
    }
    timer()
    {
        if (set == 1)
        {
            //here you can create mixtures, max functions: 27 This can be in the root prim, for the movement, or the light itself with light, color changes and brightness
        }
        else if (set == 2)
        {
           
        }
        else if (set == 3)
        {
           
        }

    }
}


I want to put in a list return event for different 'information' like a fast turn of 180 deg or a slow one, so i need a couple of list return events coupled with a function that executes certain stuff when certain 'information' is given.
Just like: list set1 = ["fast 180 deg turn","light on","light brightness 100%"] will result a fast 180deg turn, the light goes on and its full brightness.

Hope someone can help.

Peace and a happy new year!

_________________
{L_IMAGE}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net