The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Intro
So just for the record: I'm a complete LSL n00b. So don't expect much from this page. Since I love the Open Source concept, I'd like to share some of my scripts with other SL Residents =)
Since these are contributions to the SL Wiki, all scripts are released under Creative Commons Attribution-Share Alike 3.0 License.
Simple Timer
This script displays a hovering countdown.
<lsl>
//////////////////////////////////////////////////////
// //
// Simple Countdown Script //
// Released under //
// Creative Commons Attribution-Share Alike 3.0 //
// by Zai Lynch //
// //
//////////////////////////////////////////////////////
integer DAYS = 28; // Days until the countdown finishs
integer HOURS = 6; // Hours until the countdown finishs
integer MINUTES = 42; // Minutes until the countdown finishs
integer SECONDS = 12; // Seconds until the countdown finishs
string TEXT = "The end of the world will come in"; // Additional text defining the event
string FINISHED = "uh oh..."; // Text displayed when event happened
vector COLOR = <1,1,1>; // Color of the displayed text
countdown()
{
llSetText(TEXT+"\n"+(string)(SECONDS/86400)+" days, "+(string)((SECONDS%86400)/3600)+" hours, "+(string)(((SECONDS%86400)%3600)/60)+" minutes, "+ (string)(((SECONDS%86400)%3600)%60)+ "seconds.",COLOR,1);
}
default
{
state_entry()
{
SECONDS = SECONDS + MINUTES * 60 + HOURS * 3600 + DAYS * 86400;
llSetTimerEvent(1);
countdown();
}
timer()
{
if (SECONDS > 0)
{
SECONDS = SECONDS - 1;
countdown();
}
else
{
llSetText(FINISHED, COLOR,1);
llSetTimerEvent(0);
}
}
}
</lsl>
|
|