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
Weapons Kill_List_Control  

Kill_List_Control

Kill List Control.lsl

Category: Weapons
By : Charlie Omega
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Kill_List_Control
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Kill_List_Control_1.lsl
1
2 // Xavier#s Gun Control Script
3 // : Master Computer Relay on 2167811067 ( send / receive )
4 // : Updates guns Friends list on 2167812300 ( transmit list)
5 // : Receives Gun reply#s on 2166617540 / Set ON/OFF / Confirm list, Confirmed On / Off)
6
7 // Init Lists
8 list Ops = ["Charlie Omega"];
9 list kos;
10
11 integer guns_on = FALSE;
12
13 integer talk_channel = 0;
14
15 // Function to Talk
16 talk(integer atchan, string saydis)
17 {
18 if(talk_channel == 0)
19 {
20 llSay(talk_channel,saydis);
21 }
22 else
23 {
24 llShout(talk_channel,saydis);
25 }
26
27 }
28
29 // Functions to check Ops list
30 integer isNameOnList( string name, list test )
31 {
32 list single_name_list;
33 single_name_list += name;
34
35 return (-1 != llListFindList( test, single_name_list ) );
36 }
37
38 // Function Display List Data
39 display(string test)
40 {
41 string textstring = "";
42
43 if(test == "OPS")
44 {
45 textstring = llList2CSV(Ops);
46
47 }
48
49 if(test == "kos")
50 {
51 textstring = llList2CSV(kos);
52 }
53
54 if( textstring == "" )
55 {
56 talk( talk_channel, test + " - Returned no Data");
57 }
58 else
59 {
60 talk( talk_channel, textstring);
61 }
62
63 }
64
65 // Function Add to Friends List
66 addlist(string name)
67 {
68 kos += name;
69
70 }
71
72 // Function Kill from kos list
73 offlist(string name)
74 {
75
76 list single_name_list;
77 single_name_list += name;
78
79 integer nameat = llListFindList(kos, single_name_list );
80 if(nameat > -1)
81 {
82 kos = llDeleteSubList(kos, nameat,nameat );
83 }
84 else
85 {
86 talk( talk_channel, name + " - Invalid Data");
87 }
88 }
89
90 // Function to shout to all Guns
91 tellgun(string commands)
92 {
93
94 if(commands == "ON" )
95 {
96 llShout(2166617540,"GON");
97 guns_on = TRUE;
98 }
99
100 if(commands == "OFF" )
101 {
102 llShout(2166617540,"GOFF");
103 guns_on = FALSE;
104 }
105
106 if(commands == "UPDATE" )
107 {
108 string textstring = llList2CSV(kos);
109 llShout(2167812300, textstring);
110 }
111
112
113 }
114
115
116 status()
117 {
118
119 string report;
120
121 if(guns_on == TRUE)
122 {
123 report = " Status - Online";
124
125 }
126 else
127 {
128 report = " Status - Offline";
129 }
130
131 talk(talk_channel, report);
132
133 }
134
135
136 help()
137 {
138 talk(talk_channel,"__________________________________");
139 talk(talk_channel,"| |");
140 talk(talk_channel,"| Combat Computer Options |");
141 talk(talk_channel,"|--------------------------------------------|");
142 talk(talk_channel,"| ADD < Name > - add to kill list |");
143 talk(talk_channel,"| REMOVE < Name > - remove from kill list |");
144 talk(talk_channel,"| LIST ( ops / koss ) - display list |");
145 talk(talk_channel,"| GUNS ( on / off ) - turn guns on / off |");
146 talk(talk_channel,"| GUNS Update - copy friends list to guns |");
147 talk(talk_channel,"| STATUS - Display current system status |");
148 talk(talk_channel,"|_________________________________|");
149 }
150
151 default
152 {
154 {
155 llListen(0, "", "", ""); // Local Reception
156 llListen(2167811067, "", "", ""); // Relay Reception
157 llListen(2166617540, "", "", ""); // Gun Transmission Reception
158 }
159
160 listen(integer channel, string name, key id, string message)
161 {
162
163 talk_channel = channel;
164
165 string temp_message = llToUpper(message);
166 integer strlong = llStringLength(message);
167
168 if( isNameOnList(name,Ops)==TRUE | channel == 2167811067 )
169 {
170
171 if(llGetSubString(temp_message, 0, 3)=="LIST")
172 {
173 string test = llGetSubString(temp_message, 5, strlong);
174 display(test);
175 }
176
177 if(llGetSubString(temp_message, 0, 2)=="ADD")
178 {
179 string test = llGetSubString(message, 4, strlong);
180 addlist(test);
181 }
182
183 if(llGetSubString(temp_message, 0, 5)=="REMOVE")
184 {
185 string test = llGetSubString(message, 5, strlong);
186 offlist(test);
187 }
188
189 if(llGetSubString(temp_message, 0, 3)=="GUNS")
190 {
191 string test = llGetSubString(temp_message, 5, strlong);
192 tellgun(test);
193 }
194 if(llGetSubString(temp_message, 0, 7)=="COMMANDS")
195 {
196 string test = llGetSubString(temp_message, 5, strlong);
197 help();
198
199 }
200 if(llGetSubString(temp_message, 0, 5)=="STATUS")
201 {
202 string test = llGetSubString(temp_message, 5, strlong);
203 status();
204
205 }
206
207 } // end commands reception
208
209 if(channel == 2166617540)
210 {
211 llSay(0, name + " - " + message);
212 llShout(2167811067, name + " - " + message);
213 }
214
215 }
216
217 }// END //

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