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
Vote Dialog_Vote  

Dialog_Vote

Dialog_Vote

Category: Vote
By : Fred Kinsei
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Dialog_Vote
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Dialog_Vote_1.lsl
1 //Credit to the creator:
2 //Made by SL resident Fred Kinsei
3 integer votes1;
4 integer votes2;
5 string vote1;
6 string vote2;
7 list buttons;
8 string question;
9 default
10 {
12 {
13 llListen(5, "", NULL_KEY, "");
14 llListen(-11, "", "", "");
15 }
16 listen(integer channel, string name, key id, string message)
17 {
18 if(channel==5)
19 {
20 list vote = llParseString2List(message, [" -"], []);
21 if(llList2String(vote,0) == "/vote")
22 {
23 question = llList2String(vote,1);
24 vote1 = llList2String(vote,2);
25 vote2 = llList2String(vote,3);
26 integer range = llList2Integer(vote,4);
27 if(range == 0)
28 range=96;
29 buttons = [vote1, vote2];
30 llDialog(llGetOwner(),"\n"+question,buttons,-11);
31 llSensor("", NULL_KEY, AGENT, range, TWO_PI);
32 }
33 }
34 if(channel==-11)
35 {
36 if(message == vote1)
37 {
38 votes1++;
39 }
40 if(message == vote2)
41 {
42 votes2++;
43 }
44 }
45 }
46 timer()
47 {
49 llOwnerSay(vote1 + ": " + (string)votes1);
50 llOwnerSay(vote2 + ": " + (string)votes2);
52 }
53 sensor(integer num)
54 {
56 integer i;
57 for(i=0;i<num;i++)
58 {
60 llDialog(llDetectedKey(i),"\n"+question,buttons,-11);
61 }
62 }
63 }

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