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
TV TV_Script  

TV_Script

TV Script.lsl

Category: TV
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for TV_Script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. TV_Script_1.lsl
1
2 key ownerkey;
3
4 string tvname = "HiroTV";
5
6 integer numberitems = 0;
7 integer selected = 1;
8
9 integer storelisten = 0;
10
11 float r=1.0;
12 float g=1.0;
13 float b=1.0;
14
15 integer switchtime = 15;
16
17 updatetext()
18 {
19 if(r==-1)
20 llSetText("",<0,0,0>,100);
21 else
23 "\nPicture "+(string) selected +" of "+(string)numberitems, <r,g,b>, 1.5);
24
26 }
27
28
29 Init()
30 {
31 ownerkey = llGetOwner();
32 llInstantMessage(ownerkey,"HiroTV script reset!");
34 updatetext();
35
36 llListenRemove(storelisten);
37 storelisten = llListen(0,"",ownerkey,"");
38
39 }
40
41 switchpic()
42 {
43 selected++;
44 if(selected > numberitems)
45 selected = selected - numberitems;
46 updatetext();
47
48 }
49
50
51 default
52 {
54 {
55 Init();
56 llSetTimerEvent(switchtime);
57 }
58
59 on_rez(integer param)
60 {
61 Init();
62 llSetTimerEvent(switchtime);
63
64 }
65
66 listen(integer channel, string name, key id, string msg)
67 {
68 list command = llParseString2List(msg,[":"],[]);
69 if(llList2String(command,0)==tvname)
70 // ALL COMMANDS MUST START WITH THE TVNAME
71 {
72 string whichcommand=llList2String(command,1);
73 if(whichcommand=="setname")
74 {
75 string newname=llList2String(command,2);
76 if(newname!="")
77 {
78 llSay(0,"HiroTV '"+tvname+"' has been renamed: '"+newname+"'.");
79 tvname=newname;
80
81 }
82 else
83 {
84 llSay(0,"Sorry, you must enter a name for your vendor. Please try again.");
85 }
86 }
87 else if(whichcommand == "setcolor")
88 {
89 list colors = llParseString2List(llList2String(command,2),[","],[]);
90 r = (float)(llList2String(colors,0));
91 if(r != -1)
92 {
93 r = r / 255;
94 }
95 g = ((float)(llList2String(colors,1))/255);
96 b = ((float)(llList2String(colors,2))/255);
97 updatetext();
98 }
99 else if(whichcommand == "settimer")
100 {
101 switchtime = (integer)llList2String(command,2);
102 llInstantMessage(ownerkey,"HiroTV will now switch every "+(string)switchtime+" seconds.");
103 llSetTimerEvent(switchtime);
104 }
105 else if(whichcommand == "reset")
106 {
108 }
109 }
110 else
111 if(llList2String(command,0)=="GetHiroTVName")
112 {
113 llSay(0,"My name is: "+tvname);
114 }
115 } // end listen
116
117 touch( integer n)
118 {
119 // llSay(0,"changing");
120 switchpic();
121 }
122
123 timer()
124 {
125 switchpic();
126 }
127
128 }// END //

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