Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Train Train_Scheduler  

Train_Scheduler

Train_Scheduler

Category: Train
By : Barney Boomslang
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Train_Scheduler
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Train_Scheduler_1.lsl
1 // copyright 2007 Barney Boomslang
2 //
3 // this is under the CC GNU GPL
4 // http://creativecommons.org/licenses/GPL/2.0/
5 //
6 // prim-based builds that just use this code are not seen as derivative
7 // work and so are free to be under whatever license pleases the builder.
8 //
9 // Still this script will be under GPL, so if you build commercial works
10 // based on this script, keep this script open!
11
12 // This script is the scheduler for the train stations. It will show the
13 // next train going, it's destination and when appropriate, send a rezzer
14 // command via chat to the train rezzer
15
16 integer last = -1;
17
18 // set this to the number of seconds after the full hour to start the train
19 integer offset = 1800;
20
21 setTimer()
22 {
23 integer sec = (integer)llGetWallclock() + offset;
24 integer h = sec / 3600;
25 h = h * 3600;
26 integer minutes = 60 - (sec - h) / 60;
27 if((last > 0) && (minutes > last))
28 {
29 llShout(474747, "start train");
30 }
31 if(minutes < 5)
32 {
33 llSetText("Next train in " + (string)minutes + " minutes", <1,0,0>, 1.0);
34 }
35 else if(minutes < 10)
36 {
37 llSetText("Next train in " + (string)minutes + " minutes", <1,1,0>, 1.0);
38 }
39 else
40 {
41 llSetText("Next train in " + (string)minutes + " minutes", <0,1,0>, 1.0);
42 }
43 last = minutes;
44 }
45
46 default
47 {
49 {
50 setTimer();
51 llSetTimerEvent(60.0);
52 }
53
54 on_rez(integer start_param)
55 {
57 }
58
59 timer()
60 {
61 setTimer();
62 }
63 }

Back to the Best Free Tools in Second Life and OpenSim.