Jump to content

Code to remotely launch another script.


msw Tomorrow
 Share

You are about to reply to a thread that has been inactive for 3919 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Looking for some code to have a on/off prim that triggers another script in a remote prim. Could be linked... Thanks

Apparently all the wiz kids here think I am looking for a free script... Looking for some code... to replace on/off touch and control a remote script... Example I have a filre script in a prim and I want to put a switch on the wall across the room to turn it on/off. I can handle textures etc but controlling a script has me frustrated.

Now if this is a big deal to all here and you are so **bleep** that you can't offer some help tthen don't... Have a great day.

Link to comment
Share on other sites

Look in the Wiki for information about listening and/or sending/receiving linked messages.  One of these should fit your needs and general examples are provided that you could add to your own script and modify for your specific application. LInked messages generally are the more efficient and lag free to use of the two if they are suitable for your purpose.

This forum is for helping people who are writing their own scripts.  If you need help with a script you are writing after reading those two areas, then post your script here and ask specific questions.

If you are looking for someone to write the script for you, post in the employment section.

Link to comment
Share on other sites

From the description, they are wanting to trigger something in a REMOTE prim.  Possibly same sim, possibly not.

 

If the prims are in the same sim, set up a llRegionSayTo() call and a matching Listen() event handler in the pair.  If they are NOT in the same sim, you'll be limited to either using http server/client in SL (using the llRequestURL(), llHTTPRequest(), llHTTPResponse(), and http_request() event methods.)

 

Link to comment
Share on other sites

Can either say on channel  /989 or write a simple script. I do not write code for people anymore like you asked, i got to much abuse from someone.

// Texture Flipper for a neon sign
// Constants
integer TIMER_INTERVAL = 2; // timer interval
string NEON_OFF_TEXTURE = "bcf8cd82-f8eb-00c6-9d61-e610566f81c5";
string NEON_ON_TEXTURE = "6ee46522-5c60-c107-200b-ecb6e037293e";
// global variables
integer gOn = TRUE; // If the neon is burning
integer gSide = 0; // which side to flip
integer gListenChannel = 989; // control channel
// functions
fliptexture(string texture) {
llSetTexture(texture, gSide);
}
usage(){
llOwnerSay("Turn on by saying: /"+(string)gListenChannel+" sign-on");
llOwnerSay("Turn off by saying: /"+(string)gListenChannel+" sign-off");
}

// states
default
{
state_entry() {
llSetTimerEvent(TIMER_INTERVAL);
llListen( gListenChannel, "", llGetOwner(), "" );
}
listen(integer channel, string name, key id, string msg) {
if (msg == "sign-on") {
fliptexture(NEON_ON_TEXTURE);
gOn = TRUE;
llSetTimerEvent(TIMER_INTERVAL); // start the timer
} else if (msg == "sign-off") {
fliptexture(NEON_OFF_TEXTURE); // start the timer
gOn = FALSE;
llSetTimerEvent(0.0);
} else {
usage();
}
}
timer() {
if (gOn){
fliptexture(NEON_OFF_TEXTURE);
gOn = FALSE;
} else {
fliptexture(NEON_ON_TEXTURE);
gOn = TRUE;
}
}
}

Link to comment
Share on other sites

Solved... Anyone can use this for multiple purposes.

 

///THIS SCRIPT GOES IN THE BUTTON PRIM///
integer channel = 127; // Can be whatever for different groups etc...
integer isOn;

default
{
    state_entry()
    {
    }
   
    touch_start(integer num)
    {
        if  (!isOn)
        {
            isOn = TRUE;
            llRegionSay(channel, "on");
        }
        else
        {
            isOn = FALSE;
            llRegionSay(channel, "off");
        }
    }
}

 

---------------------------------------------------------------------------------------------------------------------------------------

///THIS GOES IN SECOND SCRIPT - CAN HAVE MULTIPLE COPIES OF THIS AND ALL ACTIVATE///
integer channel = 127; // Must match

ParticleStart()
{
    llParticleSystem([
        PSYS_PART_FLAGS, 291,
        PSYS_SRC_PATTERN, 8,
        PSYS_PART_START_ALPHA, 1.00,
        PSYS_PART_END_ALPHA, 0.00,
        PSYS_PART_START_COLOR, <1.00,0.50,1.00>,
        PSYS_PART_END_COLOR, <1.00,0.50,1.00>,
        PSYS_PART_START_SCALE, <0.25,0.25,0.00>,
        PSYS_PART_END_SCALE, <1.00,1.00,0.00>,
        PSYS_PART_MAX_AGE, 30.00,
        PSYS_SRC_MAX_AGE, 0.00,
        PSYS_SRC_ACCEL, <0.00,0.00,0.00>,
        PSYS_SRC_ANGLE_BEGIN, 0.00,
        PSYS_SRC_ANGLE_END, 0.19,
        PSYS_SRC_BURST_PART_COUNT, 1,
        PSYS_SRC_BURST_RADIUS, 0.10,
        PSYS_SRC_BURST_RATE, 0.00,
        PSYS_SRC_BURST_SPEED_MIN, 0.35,
        PSYS_SRC_BURST_SPEED_MAX, 1.25,
        PSYS_SRC_OMEGA, <0.00,0.00,0.00>,
        PSYS_SRC_TEXTURE, "5e8ff00b-6164-fc6e-6a80-9d42720c4066"
    ]);

}

ParticleStop()
{
    llParticleSystem([]);
}

default
{
    state_entry()
    {
        llListen(channel,"","","");
    }
   
    listen (integer channel, string name, key id, string message)
    {
        if (message == "on")
        {
            ParticleStart();
        }
        if (message == "off")
        {
            ParticleStop();
        }
    }   
}

 

Yeah I do write my own scripts.... Just sayin. Enjoy the hearts.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3919 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...