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
Hovertext SetText_Rotating_Banner  

SetText_Rotating_Banner

SetText Rotating Banner.lsl

Category: Hovertext
By : Kex Godel
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for SetText_Rotating_Banner
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. SetText_Rotating_Banner_1.lsl
1
2 // SetText Rotating Banner
3 // Original Author: Kex Godel, an avatar in the virtual world Second Life (Linden Labs)
4 //
5 // This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 1.0 License
6 // * You are free:
7 // - to copy, distribute, display, and perform the work
8 // - to make derivative works
9 // * Under the following conditions:
10 // - Attribution. You must give the original author credit.
11 // - Noncommercial. You may not use this work for commercial purposes.
12 // - Share Alike. If you alter, transform, or build upon this work, you may
13 // distribute the resulting work only under a license identical to this one.
14 // * For any reuse or distribution, you must make clear to others the license
15 // terms of this work.
16 // * Any of these conditions can be waived if you get permission from the author.
17 // * Your fair use and other rights are in no way affected by the above.
18 // * Details at: http://creativecommons.org/licenses/by-nc-sa/1.0/
19
20 string gBanner = "Banner";
21 integer gNumChars = 20;
22 integer gPosition = 0;
23 vector gColor = <1,1,1>;
24 float gRefreshRate = 1.0;
25 float gAlpha = 1.0;
26 integer gImPublic = FALSE;
27
28 sendIM(string s){
29 if(gImPublic){
30 llWhisper(0,s);
31 }else{
33 }
34 }
35
36 default
37 {
39 {
40 gBanner = llKey2Name(llGetOwner()) + ", type /banner help to learn how to use this banner.";
41 llListen(0, "", "", "");
42 llSetTimerEvent(gRefreshRate);
43 gPosition = 0;
44 }
45
46 timer(){
47 integer len = llStringLength(gBanner);
48 integer diff = (gPosition + gNumChars) - len;
49 string template = llGetSubString(gBanner,gPosition,gNumChars + gPosition);
50 while(llStringLength(template) < gNumChars){
51 template += " " + gBanner;
52 }
53 string sub = llGetSubString(template,0,gNumChars);
54 llSetText(sub + "\n.\n.\n.",gColor,gAlpha);
55 gPosition++;
56 if(gPosition > len){
57 gPosition = 0;
58 }
59 }
60
61 listen(integer number, string name, key id, string msg){
62 if(id != llGetOwner()){
63 return;
64 }
65 list argv = llParseString2List(msg, [" "], []);
66 integer argc = llGetListLength(argv);
67 string cmd = llToLower(llList2String(argv, 0));
68 if(cmd == "/banner"){
69 string arg = llToLower(llList2String(argv, 1));
70 if(arg == "length"){
71 gNumChars = llList2Integer(argv, 2);
72 if(gNumChars < 1){
73 gNumChars = 20;
74 }
75 }else if(arg == "speed"){
76 gRefreshRate = llList2Float(argv, 2);
77 if(gRefreshRate < 0.2){
78 gRefreshRate = 0.2;
79 }
80 }else if(arg == "rotate"){
81 llSetTimerEvent(gRefreshRate);
82 }else if(arg == "static"){
84 llSetText(gBanner + "\n.\n.\n.",<1,1,1>,1);
85 }else if(arg == "on"){
86 llSetTimerEvent(gRefreshRate);
87 }else if(arg == "off"){
89 llSetText("",<0,0,0>,0);
90 }else if(arg=="getrot"){
91 llSay(0,(string)llGetRot());
92 }else if(arg=="im"){
93 gImPublic = !gImPublic;
94 sendIM("gImPublic now set to " + (string)gImPublic);
95 }else if(arg == "help"){
96 sendIM("/banner on / off - enable / disable banner display");
97 sendIM("/banner <text> - set banner text to '<text>'");
98 sendIM("/banner length - set banner length in characters (for rotation)");
99 sendIM("/banner rotate - enable rotation");
100 sendIM("/banner static - disable rotation");
101 }else{
102 gBanner = llGetSubString(msg,8,128);
103 llSetText(gBanner + "\n.\n.\n.",<1,1,1>,1);
104 gPosition = 0;
105 }
106 }
107 }
108 }
109 // END //

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