Change font size
It is currently Sun Jul 22, 2018 3:21 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 3 posts ]
Author Message
 Post subject: Elevator Script
PostPosted: Wed Feb 27, 2008 12:36 pm 
Site Admin
User avatar

Joined: Sun Feb 03, 2008 9:10 am
Posts: 48
Location: Suburbia Americana in the Houston Texas area
This is the more or less final incarnation of my 'teleporter' script (it could use some cosmetic work ;))

I use it as an elevator in my skyscrapers. The idea is to have one on each floor, and have it return to that floor when the listen expires, thus making an elevator available at approximately one minute intervals on each floor. This one is for the lobby floor at Herman Tower in Nexus Prime.

{L_CODE}:
integer lhandle = 0;

default
{
    state_entry()
    {
        llSay(0, "Elevator ready! Touch and/or sit, then give command in open chat (up/dn)");
    }
   
    touch_start(integer num_times)
    {
        lhandle = llListen(0, "", "", "");
        llSetTimerEvent(60);
        llSay(0, "60 seconds to be seated and give command on open chat (up/dn)");
    }
   
    listen(integer chan, string name, key dakey, string msg)
    {
        if(msg == "roof")
        {
            llSetPos(<168.128,156.090,75.124>);
        }
        if((msg == "9th")||(msg == "ninth")||(msg == "penthouse"))
        {
            llSetPos(<168.128,157.965,70.015>);
        }
        if((msg == "8th")||(msg == "eighth"))
        {
            llSetPos(<168.128,157.965,64.929>);
        }
        if((msg == "7th")||(msg == "seventh"))
        {
            llSetPos(<168.128,157.965,59.962>);
        }
        if((msg == "6th")||(msg == "sixth"))
        {
            llSetPos(<168.128,157.965,54.955>);
        }
        if((msg == "5th")||(msg == "fifth"))
        {
            llSetPos(<168.128,157.965,49.932>);
        }
        if((msg == "4th")||(msg == "fourth"))
        {
            llSetPos(<168.128,157.965,45.004>);
        }
        if((msg == "3rd")||(msg == "third"))
        {
            llSetPos(<168.128,157.965,40.037>);
        }
        if((msg == "2nd")||(msg == "second"))
        {
            llSetPos(<168.128,157.965,35.018>);
        }
        if((msg == "1st")||(msg == "first"))
        {
            llSetPos(<168.128,157.965,29.929>);
        }
        else if(msg == "lobby")
        {
             llSetPos(<168.128,157.965,25.005>);
        }
    }
   
    timer()
    {
        llSay(0, "Listen has expired - Sit/touch again to give a new command (up/dn)");
        llSetTimerEvent(0);
        llListenRemove(lhandle);
        llSetPos(<168.128,157.965,25.005>);
    }
}



Cheers!
Hiro
:D

_________________
http://opensimulator.org http://osgrid.org http://simhost.com
---------------------------------------------------------------------------------------------------------------------------
The wind
scours the earth for prayers
The night obscures them


Last edited by Hiro Protagonist on Thu Feb 28, 2008 8:59 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Elevator Script
PostPosted: Thu Feb 28, 2008 8:50 am 
Site Admin
User avatar

Joined: Sun Feb 03, 2008 9:10 am
Posts: 48
Location: Suburbia Americana in the Houston Texas area
Am I the only one to find a couple of embarrassingly bad errors in this script?

Will post the fixes in a few mins :mrgreen:

Cheers!
Hiro

UPDATE:

I fixed it :lol:

_________________
http://opensimulator.org http://osgrid.org http://simhost.com
---------------------------------------------------------------------------------------------------------------------------
The wind
scours the earth for prayers
The night obscures them


Top
 Profile  
 
 Post subject: Re: Elevator Script
PostPosted: Sun Mar 02, 2008 11:32 am 
Furious Typer
User avatar

Joined: Sat Feb 02, 2008 10:02 pm
Posts: 104
Location: Romania, Bucharest
Wanted to submit this elevator script a while ago. I made this script over the crude teleporter, which can be set to go to different positions over chat. Instructions about the chat commands are to be kept as text or somewhere separately, or can be put on a touch event. This one uses l0, l1, etc.

// Crude Teleporter, elevator model.

float stop = 5; // Lock the elevator for this number of seconds so noone else can call it back instantly.

vector position0 = <12.493,208.501,22.375>;
vector position1 = <12.493,208.501,33.375>;
vector position2 = <12.493,208.501,44.375>;

string sound = ""; // Elevator movement sound.

default
{
state_entry()
{
llPreloadSound(sound);
llListen(0, "", NULL_KEY, "");
llSetPos(position0);
}

listen(integer channel, string name, key id, string message)
{
if (message == "l0")
{
llPlaySound(sound, 1);
llSetPos(position0);
llSay(0, "Level 0");
llSleep(stop);
}
if (message == "l1")
{
llPlaySound(sound, 1);
llSetPos(position1);
llSay(0, "Level 1");
llSleep(stop);
}
if (message == "l2")
{
llPlaySound(sound, 1);
llSetPos(position2);
llSay(0, "Level 2");
llSleep(stop);
}
}
}


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


Who is online

Users browsing this forum: No registered users and 1 guest


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