Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Need a quickie script please...

Esch Snoats
Artist, Head Minion
Join date: 2 May 2006
Posts: 261
09-09-2009 13:52
I've been searching the forums for an hour and haven't found exactly what I need, so hope someone can help me out please.

I need a script that simply talks on a chat channel to another script to send a command to activate that 2nd script, which is an animated prim. The 2nd script will run for X seconds and stop till the first script tells it to run again.

I found through other scripts in the search how to set the chat channel and what not, but I have zero clue how to have the 1st script tell the 2nd script to start running the script that's inside it.

Thanks for your help!
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
09-09-2009 13:59
Post what you got so far. Scripts cannot use chat channels to itself if they are in the same object, linkmessages are used for that. Chat is between two different objects and/or attachments.
Esch Snoats
Artist, Head Minion
Join date: 2 May 2006
Posts: 261
09-09-2009 14:09
I don't have anything put together yet, I'm cobbling this all together from other scripts I'm finding on the forums. This last bit was just the only thing I couldn't find and/or understand how to do on my own.

Both scripts would be in two separate prims not linked to one another.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
whats that?
09-09-2009 14:14
You certainly confused me:
From: Esch Snoats
I need a script that simply talks on a chat channel to another script to send a command to activate that 2nd script, which is an animated prim.
...a script that is a prim?
From: Esch Snoats
...but I have zero clue how to have the 1st script tell the 2nd script to start running the script that's inside it,
... a script inside a script?
_____________________
From Studio Dora
Esch Snoats
Artist, Head Minion
Join date: 2 May 2006
Posts: 261
09-09-2009 14:18
No, sorry about that..

I want script A inside prim A to talk to script B inside prim B. :D
Destiny Niles
Registered User
Join date: 23 Aug 2006
Posts: 949
09-09-2009 14:24
OBJECT 1
CODE

integer listen_channel = 9999;
default
{
touch_start(integer num_detected)
{
llRegionSay(listen_channel,"DO IT");
}
}





OBJECT 2
CODE

integer listen_channel = 9999;
default
{
state_entry()
{
llListen(listen_channel, "", NULL_KEY, "");
}
listen( integer channel, string name, key id, string message )
{
if (message =="DO IT")
{
state move_it;
}
}
on_rez(integer param)
{
llResetScript();
}
}

state move_it
{
state_entry()
{
llSetTimerEvent(10);
// put you stuff here
}
timer()
{
llSetTimerEvent(0);
//put your stuff here also
state default;
}
}

Esch Snoats
Artist, Head Minion
Join date: 2 May 2006
Posts: 261
09-09-2009 15:00
Awesome, thank you very much for your help! I will try it out tonight when I can get back in world and get back to you.