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
Pose Balls Pose_ball_4  

Pose_ball_4

Pose ball 4 - Click Broadcaster.lsl

Category: Pose Balls
By : Click Broadcaster
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Pose_ball_4
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Pose_ball_4_1.lsl
Get file # 2. Pose_ball_4__Click_Broadcaster_1.lsl
Get file # 3. Pose_ball__CONFIGURATION_NOTECARD_1.txt
1
2 1// remove this number for the script to work.
3
4 //Pose Ball script, Revision 4.3
5 //Click Broadcaster
6
7 // ** This script is NOT FOR SALE **
8 //You can use it in commercial products as long as you give this script to anyone who asks for it.
9 //You can use this source, distribute it and modify it freely. Please leave the credits intact!
10
11 integer visible = TRUE;
12
13 default
14 {
15 touch_start(integer total_number)
16 {
17 if(visible == TRUE)
18 {
20 visible = FALSE;
21 }
22 else
23 {
25 visible = TRUE;
26 }
27 }
28 }
29 // END //

Pose_ball_4

Pose ball 4.lsl

Category: Pose Balls
By : Click Broadcaster
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

1
2
3 //Pose Ball script, Revision 4.3
4 //Notecard configuration enabled, switchable link_message/touch_start/llListen support, sit_text, floating text, alpha.
5 //Version 4.3 fixs link_set hide/show and permission sensing issues.
6
7 //By CrystalShard Foo.
8 //Work started - October 10th.
9 //Last compile - November 7th.
10
11 //This script will let you choose if you want to turn the ball visible on CLICK, or by using a SHOW/HIDE voice command.
12 //You can also set the offset and the title of the ball, as well as the sit button text - all with a notecard.
13
14 //This script is free and comes without support. Dont contact me. Ask a local geek for help if it gets messy.
15
16 // ** This script is NOT FOR SALE **
17 //You can use it in commercial products as long as you give this script to anyone who asks for it.
18 //You can use this source, distribute it and modify it freely, but leave the credits intact!
19 //(You can add your own name to the list, ofcourse. Like, "Modified by John Doe")
20
21
22
23 string TITLE="Sit here"; //This text will appear in the floating title above the ball
24 string ANIMATION=""; //Put the name of the pose/animation here!
25 vector offset=<0,0,0.5>; //You can play with these numbers to adjust how far the person sits from the ball. ( <X,Y,Z> )
26 integer use_voice = FALSE;
27
28 string gNotecard = "Pose ball - CONFIGURATION";
29 integer gLine = 0;
30
31 integer listenHandle = -1;
32 integer masterswitch = TRUE;
33 integer visible = TRUE;
34 float base_alpha = 1.0;
35 key avatar;
36
37 key dataserver_key = NULL_KEY;
38
39 show()
40 {
41 visible = TRUE;
42 llSetText(TITLE, <1,1,1>,1);
43 llSetAlpha(base_alpha, ALL_SIDES);
44 }
45
46 hide()
47 {
48 visible = FALSE;
49 llSetText("", <1,1,1>,1);
51 }
52
53 next_line()
54 {
55 gLine++;
56 dataserver_key = llGetNotecardLine(gNotecard,gLine);
57 }
58
59 use_defaults()
60 {
61 llSetSitText("Sit Here");
62 if(visible == FALSE)
63 llSetText("",<1,1,1>,1);
64 else
65 llSetText(TITLE,<1,1,1>,1);
66 }
67
68 init()
69 {
70
71 if(llGetInventoryNumber(INVENTORY_ANIMATION) == 0) //Make sure we actually got something to pose with.
72 {
73 llWhisper(0,"Error: No animation found. Cannot pose.");
74 ANIMATION = "sit";
75 }
76 else
78
79 if(llGetInventoryNumber(INVENTORY_NOTECARD) != 0) //If the notecard is present, use it for configuration.
80 {
81 integer i;
84 {
85 gLine = 0;
86 dataserver_key = llGetNotecardLine(gNotecard, 0);
87 return;
88 }
89 use_defaults();
90 }
91 else //No configuration notecard found... lets use the defaults.
92 use_defaults();
93 }
94
95 default
96 {
98 {
99 llSetText("Starting up", <1,1,1>,1);
101 init();
102 }
103
104 link_message(integer sender_num, integer num, string str, key id)
105 {
106 if(num == 99)
107 {
108 if(str == "show")
109 {
110 masterswitch = FALSE;
111 hide();
112 return;
113 }
114
115 if(str == "hide")
116 {
117 masterswitch = TRUE;
118 show();
119 }
120 }
121 }
122
123 touch_start(integer detected)
124 {
125 if(use_voice == FALSE)
126 {
127 if(visible == TRUE)
128 hide();
129 else
130 show();
131 }
132 else
133 llSay(0,llDetectedName(0)+", say '/1 Hide' to hide me, or '/1 Show' to make me show. Or just right-click and sit on me to use me.");
134 }
135
136 changed(integer change)
137 {
138 if(change == CHANGED_LINK)
139 {
140 avatar = llAvatarOnSitTarget();
141 if(avatar != NULL_KEY)
142 {
143 hide();
145 }
146 else
147 {
149 llStopAnimation(ANIMATION);
150 if(masterswitch == TRUE)
151 {
152 llSetAlpha(base_alpha,ALL_SIDES);
153 llSetText(TITLE,<1,1,1>,1);
154 }
155 }
156 }
157
158 if(change == CHANGED_INVENTORY)
159 {
160 llSetText("Reloading configuration...",<1,1,1>,1);
161 init();
162 }
163 }
164
166 {
168 {
169 llStopAnimation("sit");
170 llStartAnimation(ANIMATION);
171 if(visible == TRUE)
172 base_alpha = llGetAlpha(ALL_SIDES);
173 else
174 base_alpha = 1.0;
176 llSetText("",<1,1,1>,1);
177 }
178 }
179
180 listen(integer channel, string name, key id, string message)
181 {
182 if(llStringLength(message)!=4)
183 return;
184
185 message = llToLower(message);
186
187 if(message == "show")
188 {
189 show();
190 return;
191 }
192 if(message == "hide")
193 hide();
194 }
195
196 dataserver(key queryid, string data)
197 {
198 if(queryid != dataserver_key)
199 return;
200
201 if(data != EOF)
202 {
203 if(llGetSubString(data,0,0) != ";")
204 {
205 if(llGetSubString(data,0,5) == "title:")
206 {
207 TITLE = llGetSubString(data,7,-1);
208 next_line();
209 return;
210 }
211 if(llGetSubString(data,0,6) == "offset:")
212 {
213 integer length = llStringLength(data);
214 if(llGetSubString(data,8,8) != "<" || llGetSubString(data,length - 1,length) != ">")
215 {
216 llSay(0,"Error: The numbers in the offset value lack the '<' and '>' signs. (Should be something like <3,1,6> )");
217 offset = <0,0,0.5>;
218 }
219 else
220 offset = (vector)llGetSubString(data,8,-1);
221
222 if(offset == <0,0,0>)
223 offset = <0,0,0.01>;
225 next_line();
226 return;
227 }
228 if(llGetSubString(data,0,5) == "voice:")
229 {
230 string value = llGetSubString(data,7,-1);
231 value = llToLower(value);
232
233 if(listenHandle != -1)
234 {
235 llListenRemove(listenHandle);
236 listenHandle = -1;
237 }
238
239 if(value !="no" && value != "yes" && value != "true" && value != "false")
240 use_voice = FALSE;
241 else
242 if(value == "no" || value == "false")
243 use_voice = FALSE;
244 else
245 {
246 use_voice = TRUE;
247 listenHandle = llListen(1,"","","");
248 }
249 next_line();
250 return;
251 }
252 if(llGetSubString(data,0,10) == "sit_button:")
253 {
254 llSetSitText(llGetSubString(data,12,-1));
255 next_line();
256 return;
257 }
258 next_line();
259 }
260 }
261 else
262 {
263 if(visible == FALSE)
264 llSetText("",<1,1,1>,1);
265 else
266 llSetText(TITLE,<1,1,1>,1);
267 }
268 }
269 }// END //

Pose_ball_4

Configuration notecard for pose ball

Category: Pose Balls
By : Click Broadcaster
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

1 // CATEGORY:Pose Balls
2 // NAME:Pose_ball__CONFIGURATION_NOTECARD
3 // PART:1
4 // AUTHOR:Anonymous
5 // CREATED:2010-01-10 05:20:56.000
6 // EDITED:2010-01-10 05:20:56.000
7 // ID:1072
8 // NUM:1096
9 // REV:1.0
10 // WORLD: Second Life
11 // DESCRIPTION:
12 // Pose ball - CONFIGURATION [NOTECARD].lsl
13 // CODE
14
15 title: Sit on me!
16
17 offset: <0,0,1>
18
19 voice: No
20
21 sit_button: Sit Here// END //

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