Shihan Feiri Posted August 3, 2011 Posted August 3, 2011 Is posible and if is, what to use, that script triger predefined event in precise time (second life time ). For example: betwen 02:00pm and 04:00 pm that script change color in red in 08:00pm - 10pm to change color in green etc.And color changing is just example. If someone have similar script pls IM me. tnx
Darkie Minotaur Posted August 3, 2011 Posted August 3, 2011 Could you be a bit more precise about what you mean by precise? It's basically possible using a timer and one of the different function that give you the time - e.g. llGetUnixTime
Shihan Feiri Posted August 3, 2011 Author Posted August 3, 2011 ok, I talk about RL time. If is 2pm script stop with use one data ( eg. Green color) and start to use predefined data (eg. Red data) for this time until next time period. So eg. in 2pm script use data 1, in 3 pm script use data 2, in 3 pm script use data 3 etc.
Void Singer Posted August 3, 2011 Posted August 3, 2011 I think what Darkie is getting at is... "how precise do you need to be?" having something happen at an exact predetermined second is pretty hard to near impossible with LSL. for instance, the region the object is on may be down, or the object may be in inventory so can't do anything. but, if you want to use a certain set of data if it's after X:YZ time, then that's easy. Just check llGetUnixTime, or llGetWallclock and see decide from that what to use right now.
NicholasKulp Posted August 3, 2011 Posted August 3, 2011 Well, if your answer is 'not that precise... but within like, a second' then you can just get the time, convert to hours, and just put in some ifs or whiles.
Dora Gustafson Posted August 4, 2011 Posted August 4, 2011 There is no need to make a loop for checking the actual timeThe following script will set the color when entered and then on every second hour on hours=0,2,4,6,8,10,12,14,16,18,20,22That is 12 events in 24 hours // time synchronized color changer// will change on full even hours// based on PST (SL time) time// by Dora Gustafson, Studio Dora 2011vector black=< 0.0, 0.0, 0.0>;vector red=< 1.0, 0.0, 0.0>;vector green=< 0.0, 1.0, 0.0>;vector blue=< 0.0, 0.0, 1.0>;timeColor(){ integer nowSec=(integer)llGetWallclock(); integer nowTwoHour=2*(nowSec/7200); integer nxtTwoHour=nowTwoHour+2; integer timeUntilEvent=nxtTwoHour*3600-nowSec; llSetTimerEvent( (float)timeUntilEvent ); if (nowTwoHour==0) llSetColor( black, ALL_SIDES); else if (nowTwoHour==2) llSetColor( red, ALL_SIDES); else if (nowTwoHour==4) llSetColor( blue, ALL_SIDES); else if (nowTwoHour==6) llSetColor( green, ALL_SIDES); else if (nowTwoHour==8) llSetColor( black, ALL_SIDES); else if (nowTwoHour==10) llSetColor( red, ALL_SIDES); else if (nowTwoHour==12) llSetColor( blue, ALL_SIDES); else if (nowTwoHour==14) llSetColor( green, ALL_SIDES); else if (nowTwoHour==16) llSetColor( black, ALL_SIDES); else if (nowTwoHour==18) llSetColor( red, ALL_SIDES); else if (nowTwoHour==20) llSetColor( blue, ALL_SIDES); else if (nowTwoHour==22) llSetColor( green, ALL_SIDES);}default{ state_entry() { timeColor(); } timer() { timeColor(); }} The colors in the script are just an example and will not match the wishes in the OP Note: time calculations are not optimized but written step by step for clarity
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