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
Books To_publish_your_own_books_in_Second  

To_publish_your_own_books_in_Second

This is a prim book, it has real pages that turns when you browse it. The book displays pictures ; not text (unless your picture contains text of course).
License: GNU General Public License

Category: Books
By : Adalace Jewell
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for To_publish_your_own_books_in_Second
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. To_publish_your_own_books_in_Second_1.lsl
1
2
3 // To publish your own books in Second Life, his book is free software, please read LICENSE file if you intend to modify it.
4 // In a nutshell: you may modify and redistribute, even sell, the book ; but the scripts and prims composing the book must retain full permissions for next owner .
5 // You can, however, distribute the content (your textures) with whatever permissions you want .
6 // What is it ?
7 // This is a prim book, it has real pages that turns when you browse it. The book displays pictures ; not text (unless your picture contains text of course).
8
9 // *********
10 // How to use?
11 // **********
12 // Rez the book and clic cover to open it. Then clic a page to flip it. The book close when you clic the backcover or cover so be carefull not to clic too fast as the pages take a short instant before appearing.
13 //
14 // How to make my own book?
15 // **********************
16 //
17 // You have textures for the pages, one for each. Your textures should all have same width per height ratio, or some will look flattened and others too long.
18 // You have two choice for texture naming, edit the Settings notecard to choose and then Reset the "Book" script:
19 // - Numerical
20 // In this mode, texture must be named page1 page2 page3 etc. Put this in the Settings notecard to use it (no spaces):
21 // PageNaming:numerical
22 // - Alphabetical
23 // In this mode, textures are put into pages in alphabetical order, to use it put this in the Settings notecard (no spaces):
24 // PageNaming:alphabetical
25 // - Drop the textures in the book inventory ; to do that, right-click the book, select edit then "more" and then the Content tab. Then you can drag-drop the textures.
26 // - Open the "Book" script in the contents and Reset it.
27 // - The book should work.
28 // You can resize the book to accomodate the aspect ratio (width/height) of your pictures.
29 //
30 // To change the cover and backcover, use SL building tools to change their texture (anybody who build a bit can show you if you don't know how).
31
32 ------------------------------------------
33 // Hereafter you will find:
34 // One script named "Book", one named "sheet" and one named "update-sheet"
35 // One note named "Settings"
36 //
37 // Book script
38 // -----------------
39 //Prim book scripts, animate a 3d prim book
40 //Copyright (C) 2005 Issarlk
41 //Retrieved from Free SL Scripts on http://www.gendersquare.org/sl
42 //
43 //This program is free software; you can redistribute it and/or
44 //modify it under the terms of the GNU General Public License
45 //as published by the Free Software Foundation; either version 2
46 //of the License, or (at your option) any later version.
47 // See: http://www.gnu.org/licenses/gpl.html
48
49 //
50 //This program is distributed in the hope that it will be useful,
51 //but WITHOUT ANY WARRANTY; without even the implied warranty of
52 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53 //GNU General Public License for more details.
54 //
55 //You should have received a copy of the GNU General Public License
56 //along with this program; if not, write to the Free Software
57 //Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
58 //List of links of our sheets
59 list sheet_links;
60 list free_sheet_links;
61 list in_use_sheet_links;
62 //commands to send to a sheet
63 list sheet_commands;
64 //link numbers of sheets in the four possible positions possible
65 // open standby, open, closed, closed standby
66 list pos_sheet_links = [0,0,0,0];
67 //Type of page naming.
68 integer pagenaming; //0=numerical 1=alphabetic order
69 list pagetexturenames = []; //used for alphabetic order
70
71 //notecard reading
72 integer line;
73 key queryid;
74 //Blank texture
75 key blank_texture = "5748decc-f629-461c-9a36-a35a221fe21f";
76
77 init()
78 {
79 sheet_links = [];
80 in_use_sheet_links = [];
81 sheet_commands = [];
82 //tell cover that the book is closed
84 //tell sheets to reinitialise
86 }
87 //open book
88 open()
89 {
90 //tell cover to open
92 pos_sheet_links = [0,0,0,0];
93 }
94 //same, but closes
95 close()
96 {
97 //close book
98 //tell sheets to reinitialise
100 pos_sheet_links = [0,0,0,0];
101 //tell covers to close
103 }
104 integer findFreeSheet() {
105 integer nb;
106 //llOwnerSay("findFreeSheet, free_sheet_links: " + llList2CSV(free_sheet_links) + " in_use_sheet_links: " + llList2CSV(in_use_sheet_links));
107 if(llGetListLength(free_sheet_links) > 0) {
108 //free sheets are available, use one
109 nb = (integer)llList2Integer(free_sheet_links, 0);
110 free_sheet_links = llDeleteSubList(free_sheet_links, 0, 0);
111 } else {
112 //No more available. Got to recycle one
113 nb = (integer)llList2Integer(in_use_sheet_links, 0);
114 in_use_sheet_links = llDeleteSubList(in_use_sheet_links, 0, 0);
115 sheet_command(nb, "init");
116 }
117 in_use_sheet_links += [nb];
118 return nb;
119 }
120 //Release a sheet no longer used
121 release_sheet(integer link_number) {
122 if(link_number != 0) {
123 sheet_command(link_number, "init");
124 llSetLinkTexture(link_number, blank_texture, ALL_SIDES);
125 free_sheet_links += [link_number];
126 integer tmp = llListFindList(in_use_sheet_links, [link_number]);
127 in_use_sheet_links = llDeleteSubList(in_use_sheet_links, tmp, tmp);
128 }
129 }
130 //"create" a sheet (actually show a hidden one)
131 //number is number of sheet
132 //open tells if sheet is on the left (when you browse the book backward) or the righ (normal reading)
133 //commands is various commands to send to the sheet
134 //
135 // returns: link number of sheet
136 integer new_sheet(integer number, integer open, string commands)
137 {
138 if(!sheet_exists(number)) {
139 return 0;
140 }
141 //Find a free sheet to use
142 //There are 3 sheets in the book, so one should always be free
143 integer sheet_link = findFreeSheet();
144 //reinitialise it
145 sheet_command(sheet_link, "init");
146 setup_sheet(number, sheet_link);
147 if(open) {
148 sheet_command(sheet_link, "goto_open_standby_position");
149 sheet_command(sheet_link, "show");
150 } else {
151 sheet_command(sheet_link, "goto_closed_standby_position");
152 sheet_command(sheet_link, "show");
153 }
154 return sheet_link;
155 }
156 //hide a sheet that is no longer visible.
157 hide_sheet(integer number)
158 {
159 sheet_command(number, "hide");
160 }
161 //setup sheet
162 setup_sheet(integer sheet_number, integer sheet_link_number)
163 {
164 //llOwnerSay("setup sheet " + (string)sheet_number + " in link " + (string)sheet_link_number);
165 //set texture
166 list textures = textures_for_sheet(sheet_number);
167 //front
168 llSetLinkTexture(sheet_link_number, llList2String(textures, 0), 0);
169 //back
170 llSetLinkTexture(sheet_link_number, llList2String(textures, 1), 4);
171 //send sheet number
172 sheet_command(sheet_link_number, llList2CSV(["number",sheet_number]));
173 }
174 sheet_command(integer link_number, string command)
175 {
176 if(link_number != 0) {
177 //llOwnerSay("sheet command to " + (string)link_number + " " + command);
178 llMessageLinked(link_number, 523, command, NULL_KEY);
179 }
180 }
181 //Return texture name by its number
182 string texture_number(integer number) {
183 if(pagenaming == 0) {
184 //numeric order, pages are named "page1" "page2" etc.
185 string tmp = "page"+(string)number;
187 return tmp;
188 } else {
189 return blank_texture;
190 }
191 } else {
192 return alphabetical_texture_name(number - 1);
193 }
194 }
195 //Read texture name for alphabetical mode
196 string alphabetical_texture_name(integer n) {
198 if(n < nb) {
200 } else {
201 return blank_texture;
202 }
203 }
204 //return texture names that are supposed to go into sheet
205 list textures_for_sheet(integer sheetnumber) {
206 return [texture_number(sheetnumber * 2 - 1), texture_number(sheetnumber * 2)];
207 }
208 //Check inventory to see if sheet exists
209 integer sheet_exists(integer sheetnumber) {
210 list textures = textures_for_sheet(sheetnumber);
212 //sheet exists
213 //llOwnerSay((string)textures + " -> exist");
214 return 1;
215 } else {
216 //sheet doesn't exist (no texture to display)
217 //llOwnerSay((string)textures + " -> doesnt exist");
218 return 0;
219 }
220 }
221 //Ask for sheet links
222 get_sheet_links() {
223 sheet_links = [];
224 llMessageLinked(LINK_ALL_OTHERS, 523, "pingsheets", NULL_KEY);
225 }
226 //////////////////////
227 // Manage sheets
228 //////////////////////
229 append_sheet(integer link_number) {
230 pos_sheet_links = llDeleteSubList(pos_sheet_links, 0, 0) + [link_number];
231 //llOwnerSay("new psl: " + (string)pos_sheet_links);
232 }
233 prepend_sheet(integer link_number) {
234 pos_sheet_links = [link_number] + llDeleteSubList(pos_sheet_links, 3, 3);
235 //llOwnerSay("new psl: " + (string)pos_sheet_links);
236 }
237 open_to_standby() {
238 integer tmp = open_sheet();
239 release_sheet(open_standby_sheet());
240 pos_sheet_links = [tmp, 0] + llList2List(pos_sheet_links, 2,3);
241 sheet_command(tmp, "goto_open_standby_position");
242 //llOwnerSay("new psl: " + (string)pos_sheet_links);
243 }
244 closed_to_standby() {
245 integer tmp = closed_sheet();
246 release_sheet(closed_standby_sheet());
247 pos_sheet_links = llList2List(pos_sheet_links, 0,1) + [0, tmp];
248 sheet_command(tmp, "goto_closed_standby_position");
249 //llOwnerSay("new psl: " + (string)pos_sheet_links);
250 }
251 sheet_opened(integer link_number) {
252 //a sheet opened, it can be either a closed or closed standby sheet
253 integer pos = llListFindList(pos_sheet_links, [link_number]);
254 //get rid of open standby in all case
255 release_sheet(open_standby_sheet());
256 if(pos == 2) {
257 //closed sheet openned, move it to standby
258 sheet_command(link_number, "goto_open_standby_position");
259 //Put the closed_standby sheet in closed position
260 sheet_command(closed_standby_sheet(), "goto_closed_position");
261 pos_sheet_links = [link_number, 0, closed_standby_sheet(), 0];
262 } else if(pos == 3) {
263 //closed standby sheet openned
264 //it pushes old open sheet out of the way too
265 release_sheet(open_sheet());
266 //move it to standby
267 sheet_command(link_number, "goto_open_standby_position");
268 pos_sheet_links = [link_number, 0, 0, 0];
269 }
270 }
271 sheet_closed(integer link_number) {
272 //a sheet closed, it can be either a open or open standby sheet
273 integer pos = llListFindList(pos_sheet_links, [link_number]);
274 //get rid of closed standby in all case
275 release_sheet(closed_standby_sheet());
276 if(pos == 1) {
277 //open sheet closed, move it to standby
278 sheet_command(link_number, "goto_closed_standby_position");
279 //Put the open_standby sheet in open position
280 sheet_command(open_standby_sheet(), "goto_open_position");
281 pos_sheet_links = [0, open_standby_sheet(), 0, link_number];
282 } else if(pos == 0) {
283 //open standby sheet closed
284 //it pushes old closed sheet out of the way too
285 release_sheet(closed_sheet());
286 //move it to standby
287 sheet_command(link_number, "goto_closed_standby_position");
288 pos_sheet_links = [0, 0, 0, link_number];
289 }
290 }
291 set_closed_standby_sheet(integer link_number) {
292 pos_sheet_links = llList2List(pos_sheet_links, 0, 2) + [link_number];
293 }
294 set_open_standby_sheet(integer link_number) {
295 pos_sheet_links = [link_number] + llList2List(pos_sheet_links, 1, 3);
296 }
297 set_closed_sheet(integer link_number) {
298 pos_sheet_links = llList2List(pos_sheet_links, 0, 1) + [link_number, closed_standby_sheet()];
299 }
300 set_open_sheet(integer link_number) {
301 pos_sheet_links = [open_standby_sheet(), link_number] + llList2List(pos_sheet_links, 2, 3);
302 }
303 integer open_standby_sheet() {
304 return llList2Integer(pos_sheet_links, 0);
305 }
306 integer open_sheet() {
307 return llList2Integer(pos_sheet_links, 1);
308 }
309 integer closed_sheet() {
310 return llList2Integer(pos_sheet_links, 2);
311 }
312 integer closed_standby_sheet() {
313 return llList2Integer(pos_sheet_links, 3);
314 }
315 //////////////////////
316 // States
317 //////////////////////
318 default
319 {
321 {
322 init();
323 get_sheet_links();
324 }
325 on_rez(integer start_param)
326 {
328 }
329
330 link_message(integer sender, integer number, string s, key id) {
331 if(s == "sheet") {
332 //found sheet
333 sheet_links += [sender];
334 }
335 if(llGetListLength(sheet_links) >= 3) {
336 free_sheet_links = sheet_links;
337 state readsettings;
338 }
339 }
340 }
341 state readsettings {
342 state_entry() {
344 //No settings
345 state closed;
346 } else {
347 line = 0;
348 queryid = llGetNotecardLine("Settings", line);
349 }
350 }
351
352 dataserver(key queryidarg, string data) {
353 if(queryidarg == queryid) {
354 if(data != EOF) {
355 list settingline = llParseString2List(data,[":"],[]);
356 if(llList2String(settingline, 0) == "PageNaming") {
357 //alternate page naming
358 string naming = llList2String(settingline, 1);
359 if(naming == "alphabetical") {
360 pagenaming = 1;
361 } else if(naming == "numerical") {
362 pagenaming = 0;
363 } else {
364 llOwnerSay("Unknown PageNaming: " + naming);
365 }
366 }
367 //read next
368 line++;
369 queryid = llGetNotecardLine("Settings", line);
370 } else {
371 //No more settings
372 state closed;
373 }
374 }
375 }
376
377 on_rez(integer i) {
379 }
380 }
381 state closed
382 {
383 touch_start(integer total_number)
384 {
385 open();
386 state opened;
387 }
388
389 link_message(integer sender_number, integer number, string message, key id)
390 {
391 if(message == "user clicked cover") {
392 //the cover tells us user clicked: open book
393 open();
394 state opened;
395 }
396 }
397
398 on_rez(integer i) {
400 }
401 }
402 state opened
403 {
405 {
406 //show new sheet
407 integer tmp = new_sheet(1, FALSE, "");
408 //put it in closed position
409 sheet_command(tmp, "goto_closed_position");
410 //prepare next sheet
411 integer tmp2 = new_sheet(2, FALSE, "");
412 append_sheet(tmp);
413 append_sheet(tmp2);
414 }
415
416 touch_start(integer total_number)
417 {
418 //user clicked book, close
419 close();
420 state closed;
421 }
422
423 link_message(integer sender_number, integer number, string message, key id)
424 {
425 if(message == "user clicked cover") {
426 //user clicked cover: close
427 close();
428 state closed;
429 }
430 integer tmpsheetnumber = (integer)llGetSubString(message, 10, -1);
431 //llOwnerSay("sheet number: '" + llGetSubString(message, 10, -1)+"'");
432 //one of our sheets tell us something
433 if(llGetSubString(message, 0, 9) == "pageopened") {
434 //The sheet has been flipped to the left
435 sheet_opened(sender_number);
436 integer tmpnextsheetnumber;
437 integer tmp_next_sheet_link_number;
438 if(closed_sheet() == 0) {
439 //the closed standby sheet has been flipped
440 //we need to fill the closed pos in addition
441 //to the closed standby below
442 tmpnextsheetnumber = tmpsheetnumber + 1;
443 tmp_next_sheet_link_number = new_sheet(tmpnextsheetnumber, FALSE, "");
444 //move it to closed pos
445 sheet_command(tmp_next_sheet_link_number, "goto_closed_position");
446 set_closed_sheet(tmp_next_sheet_link_number);
447 }
448 //put next next sheet in closed standby position
449 tmpnextsheetnumber = tmpsheetnumber + 2;
450 tmp_next_sheet_link_number = new_sheet(tmpnextsheetnumber, FALSE, "");
451 //Update positions
452 set_closed_standby_sheet(tmp_next_sheet_link_number);
453 } else if(llGetSubString(message, 0, 9) == "pageclosed") {
454 //The sheet has been flipped to the right
455 sheet_closed(sender_number);
456 integer tmpprevioussheetnumber;
457 integer tmp_previous_sheet_link_number;
458 if(open_sheet() == 0) {
459 //the open standby sheet has been flipped
460 //we need to fill the open pos in addition
461 //to the open standby below
462 tmpprevioussheetnumber = tmpsheetnumber - 1;
463 tmp_previous_sheet_link_number = new_sheet(tmpprevioussheetnumber, TRUE, "");
464 //move it to open pos
465 sheet_command(tmp_previous_sheet_link_number, "goto_open_position");
466 set_open_sheet(tmp_previous_sheet_link_number);
467 }
468 //put previous previous sheet in open standby position
469 tmpprevioussheetnumber = tmpsheetnumber - 2;
470 tmp_previous_sheet_link_number = new_sheet(tmpprevioussheetnumber, TRUE, "");
471 //Update positions
472 set_open_standby_sheet(tmp_previous_sheet_link_number);
473 }
474 }
475 }
476
477 // ---------------------------------
478 // sheet script
479 //
480 //!rotation initialRot = ZERO_ROTATION;
481 //!vector initialPos;
482 //!vector scale;
483 //!integer isopen = FALSE;
484 //!
485 //!integer sheet_number = 0;
486 //!
487 //!integer version = 1;
488 //!
489 //!init()
490 //!{
491 //! //hide
492 //! llSetAlpha(0.0, ALL_SIDES);
493 //! scale = llGetScale();
494 //! initialRot = <0,0,0,1>;
495 //! initialPos = llGetLocalPos();
496 //! //force correct position
497 //! initialPos.z = 0;
498 //! llSetPos(initialPos);
499 //! llSetLocalRot(initialRot);
500 //! //For script updates from root prim
502 //!}
503 //!
504 //!
505 //!open()
506 //!{
507 //! //flip the page to the left
508 //! llSetLocalRot(llEuler2Rot(<0, -PI_BY_TWO, 0>)*initialRot);
509 //! llSetLocalRot(llEuler2Rot(<0, -PI, 0>)*initialRot);
510 //! isopen = TRUE;
511 //! //tells the book about what happened so it can rez next page
512 //! llMessageLinked(LINK_ROOT, 102, "pageopened " + (string)sheet_number, NULL_KEY);
513 //!}
514 //!
515 //!close()
516 //!{
517 //! //flip page to the right
518 //! llSetLocalRot(llEuler2Rot(<0, -PI_BY_TWO, 0>)*initialRot);
519 //! llSetLocalRot(initialRot);
520 //! isopen = FALSE;
521 //! //tells the book about what happened so it can rez next page
522 //! llMessageLinked(LINK_ROOT, 102, "pageclosed " + (string)sheet_number, NULL_KEY);
523 //!}
524 //!
525 //!standby() {
526 //! //go just below shown pages
527 //! llSetPos(initialPos + <0,0,(scale.z / 2)>);
528 //!}
529 //!
530 //!unstandby() {
531 //! llSetPos(initialPos + <0, 0, (scale.z)>);
532 //!}
533 //!
534 //!goto_open() {
535 //! llSetLocalRot(llEuler2Rot(<0, -PI, 0>)*initialRot);
536 //! isopen = TRUE;
537 //!}
538 //!
539 //!goto_closed() {
540 //! llSetLocalRot(initialRot);
541 //! isopen = FALSE;
542 //!}
543 //!
544 //!goto_backcover() {
545 //! //hide in backcover
546 //! llSetLocalRot(initialRot);
547 //! llSetPos(initialPos);
548 //!}
549 //!
550 //!hide() {
551 //! llSetAlpha(0, ALL_SIDES);
552 //!}
553 //!
554 //!show() {
555 //! llSetAlpha(1, ALL_SIDES);
556 //!}
557 //!
558 //!default
559 //!{
560 //! state_entry()
561 //! {
562 //! init();
563 //! }
564 //!
565 //! link_message(integer sender, integer num, string s, key id) {
566 //! if(num != 523) {
567 //! return;
568 //! }
569 //! //receive commands
570 //! list commandline = llCSV2List(s);
571 //! string command = llList2String(commandline, 0);
572 //! if(command == "pingsheets") {
573 //! //books want to know which links are sheets, reply
574 //! llMessageLinked(LINK_ROOT, version, "sheet", NULL_KEY);
575 //! } else if(command == "init") {
576 //! //reinitialise
577 //! hide();
578 //! goto_backcover();
579 //! } else if(command == "goto_open_standby_position") {
580 //! standby();
581 //! goto_open();
582 //! } else if(command == "goto_closed_standby_position") {
583 //! standby();
584 //! goto_closed();
585 //! } else if(command == "goto_open_position") {
586 //! unstandby();
587 //! goto_open();
588 //! } else if(command == "goto_closed_position") {
589 //! unstandby();
590 //! goto_closed();
591 //! } else if(command == "show") {
592 //! show();
593 //! } else if(command == "number") {
594 //! sheet_number = llList2Integer(commandline, 1);
595 //! }
596 //! }
597 //!
598 //! changed(integer change) {
599 //! if((change & CHANGED_SCALE) == CHANGED_SCALE) {
600 //! scale = llGetScale();
601 //! }
602 //! }
603 //!
604 //! touch_start(integer total_number) {
605 //! if(isopen == FALSE) {
606 //! open();
607 //! } else {
608 //! close();
609 //! }
610 //! }
611 //!}
612 rotation initialRot = ZERO_ROTATION;
613 vector initialPos;
614 vector scale;
615 integer isopen = FALSE;
616 integer sheet_number = 0;
617 integer version = 1;
618 init(){
620 scale=llGetScale();
621 initialRot=<0, 0, 0, 1>;
622 initialPos=llGetLocalPos();
623 initialPos.z=0;
624 llSetPos(initialPos);
625 llSetLocalRot(initialRot);
627 }
628 open(){
629 llSetLocalRot(llEuler2Rot(<0, -PI_BY_TWO, 0>)*initialRot);
630 llSetLocalRot(llEuler2Rot(<0, -PI, 0>)*initialRot);
631 isopen=TRUE;
632 llMessageLinked(LINK_ROOT,102,"pageopened "+(string)sheet_number,NULL_KEY);
633 }
634 close(){
635 llSetLocalRot(llEuler2Rot(<0, -PI_BY_TWO, 0>)*initialRot);
636 llSetLocalRot(initialRot);
637 isopen=FALSE;
638 llMessageLinked(LINK_ROOT,102,"pageclosed "+(string)sheet_number,NULL_KEY);
639 }
640 standby(){
641 llSetPos(initialPos+<0, 0, (scale.z/2)>);
642 }
643 unstandby(){
644 llSetPos(initialPos+<0, 0, (scale.z)>);
645 }
646 goto_open(){
647 llSetLocalRot(llEuler2Rot(<0, -PI, 0>)*initialRot);
648 isopen=TRUE;
649 }
650 goto_closed(){
651 llSetLocalRot(initialRot);
652 isopen=FALSE;
653 }
654 goto_backcover(){
655 llSetLocalRot(initialRot);
656 llSetPos(initialPos);
657 }
658 hide(){
660 }
661 show(){
663 }
664 default {
666 init();
667 }
668 link_message(integer sender,integer num,string s,key id){
669 if(num!=523){
670 return;
671 }
672 list commandline = llCSV2List(s);
673 string command = llList2String(commandline,0);
674 if(command=="pingsheets"){
675 llMessageLinked(LINK_ROOT,version,"sheet",NULL_KEY);
676 } else if(command=="init"){
677 hide();
678 goto_backcover();
679 } else if(command=="goto_open_standby_position"){
680 standby();
681 goto_open();
682 } else if(command=="goto_closed_standby_position"){
683 standby();
684 goto_closed();
685 } else if(command=="goto_open_position"){
686 unstandby();
687 goto_open();
688 } else if(command=="goto_closed_position"){
689 unstandby();
690 goto_closed();
691 } else if(command=="show"){
692 show();
693 } else if(command=="number"){
694 sheet_number=llList2Integer(commandline,1);
695 }
696 }
697 changed(integer change){
699 scale=llGetScale();
700 }
701 }
702 touch_start(integer total_number){
703 if(isopen==FALSE){
704 open();
705 } else {
706 close();
707 }
708 }
709 }
710 //--------------------------------
711 // update_sheet script
712 //
713 list sheet_links;
714 get_sheet_links() {
715 sheet_links = [];
716 llMessageLinked(LINK_ALL_OTHERS, 523, "pingsheets", NULL_KEY);
717 }
718 default
719 {
721 {
722 llListen(1,"",llGetOwner(),"update");
723 }
724 listen(integer c, string n, key id, string m)
725 {
726 llOwnerSay("Updating...");
727 state getlinks;
728 }
729 }
730 state getlinks {
731 state_entry() {
732 get_sheet_links();
733 }
734
735 link_message(integer sender, integer number, string s, key id) {
736 if(s == "sheet") {
737 //found sheet
738 sheet_links += [sender];
739 }
740 if(llGetListLength(sheet_links) >= 3) {
741 state update;
742 }
743 }
744 }
745 state update {
746 state_entry() {
747 integer i = llGetListLength(sheet_links) - 1;
748 for (; i >= 0; i--) {
749 llRemoteLoadScriptPin(llGetLinkKey(llList2Integer(sheet_links, i)), "sheet", 1234, TRUE, 0);
750 llOwnerSay("Updated sheet " + (string)i);
751 }
752 llOwnerSay("done");
753 state default;
754 }
755 }
756 // -----------------------------------------------------
757 // Settings notecard
758 PageNaming:numerical
759 // ---------

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