Tim Flynn Posted August 25, 2012 Share Posted August 25, 2012 I have a bunch of blinking lights and I want to see if there is any way I can sync them to start and stop blinking at the same time.If it exists, would anyone be willing to sell this ancient, secret forbidden script technology? :-D Link to comment Share on other sites More sharing options...
Alicia Sautereau Posted August 25, 2012 Share Posted August 25, 2012 just use a master light that sends out a region message on/off and the other lights a listner to change between on/off, it`s that simple Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 25, 2012 Share Posted August 25, 2012 It depends in a way on how fast the lights are supposed to blink and how perfect you want the synchronization to be. The faster they blink, the harder the problem will be to solve. You might tell your master script to do llSetTimerEvent(0.1);....timer(){ if (~(llGetUnixTime() - (gTime + 1))) { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, ALL_SIDES,TRUE]); gTime = llGetUnixTime(); llRegionSay(gChan,(string)gTime); } else { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, ALL_SIDES,FALSE]); }} EDIT: Ooops.. Got this master script backward at first.. Fixed now. Then tell your slave lights to do this llListen(gChan,"","","");llSetTimerEvent(0.1);....listen(integer channel, string name, key id, string msg){ gTime = (integer msg); gBlink = TRUE;}timer(){ if (gBlink && (~(llGetUnixTime() - (gTime + 1))) { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, ALL_SIDES,TRUE]); gBlink = FALSE; } else { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT,ALL_SIDES,FALSE]); }} That should make the master and the slaves blink at exactly the same llGetUnixTime, with no more than a 0.1 second error. 1 Link to comment Share on other sites More sharing options...
Tim Flynn Posted August 25, 2012 Author Share Posted August 25, 2012 These lights will not be blinking very fast. They will be blinking very, very slowly, preferably fading in and out in the background. I'm still learning about master and slave controllers at this stage though. Do I just make an object using a master script, and have all my lights act with the secondary script? Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 25, 2012 Share Posted August 25, 2012 Yup. Link to comment Share on other sites More sharing options...
Tim Flynn Posted August 25, 2012 Author Share Posted August 25, 2012 Perfect. Thanks for the info! Everything needs to be perfect, neat and orderly in my city. Link to comment Share on other sites More sharing options...
MidniteNoon Posted July 5, 2014 Share Posted July 5, 2014 ok how about if ya want the lights to be very random? ( a set of 10 lights and want them to blink at diff intervals) Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 5, 2014 Share Posted July 5, 2014 Then forget my fancy method for keeping the lights in sync within 0.1 sec and go with the simpler method of having your master script send a toggle message at random times for all the slaves scripts to hear. Link to comment Share on other sites More sharing options...
Recommended Posts
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