User:Fred Gandt/Scripts/Continued 3

From Second Life Wiki
< User:Fred Gandt‎ | Scripts
Revision as of 21:54, 5 March 2010 by Fred Gandt (talk | contribs) (Started new page. (needs finishing but I needed to save in case of an expected crash))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
FG jpg.jpg

My Contributions

More Pages

Free Scripts

More Free Scripts

Legal Stuff

The legal stuff about contributing to this wiki (worth reading).

Tuition

Tuition scripts, notes, videos and screenshots etc. (hardly any content yet)

Free Scripts

Script'n'Chat

Notes

<lsl>default {

   state_entry()
   {
       llSetPrimitiveParams([7,<0.01,0.58,0.04>,
                             8,<0.0,0.0,1.0,0.0>,
                             9,2,0,<0.174980,0.825,0.0>,0.0,<0.0,0.0,0.0>,<1.0,1.0,0.0>,<0.0,0.0,0.0>,
                             17,0,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                             17,1,"51519f67-926a-3301-ee64-db65c0cf1b39",<1.0,0.15,0.0>,<0.74,0.0,0.0>,0.0,
                             17,2,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                             17,3,"0a24d0af-47a5-c7a1-e18d-2b19c5ada706",<1.0,0.15,0.0>,<0.251,0.43,0.0>,0.0,
                             17,4,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                             17,5,"0a24d0af-47a5-c7a1-e18d-2b19c5ada706",<0.5,0.15,0.0>,<0.0,-0.415,0.0>,0.0,
                             17,6,"0a24d0af-47a5-c7a1-e18d-2b19c5ada706",<0.5,0.15,0.0>,<0.0,0.0,0.0>,0.0,
                             18,0,<1.0,1.0,1.0>,1.0,
                             18,1,<1.0,0.0,0.0>,1.0,
                             18,2,<1.0,1.0,1.0>,1.0,
                             18,3,<1.0,0.0,0.0>,1.0,
                             18,4,<1.0,1.0,1.0>,1.0,
                             18,5,<1.0,0.0,0.0>,1.0,
                             18,6,<0.0,1.0,0.0>,1.0,
                             19,0,0,0,
                             19,1,0,1,
                             19,2,0,0,
                             19,3,0,1,
                             19,4,0,0,
                             19,5,0,1,
                             19,6,0,1]);
       llSetLinkPrimitiveParams(2, [7,<0.5,0.01,0.04>,
                                    6,<0.0,0.0,0.04>,
                                    8,<-0.000137,0.000137,-0.707107,0.707107>,
                                    9,0,0,<0.375,0.875,0.0>,0.9,<0.0,0.0,0.0>,<1.0,1.0,0.0>,<0.0,0.0,0.0>,
                                    17,0,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                                    17,1,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                                    17,2,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                                    17,3,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                                    17,4,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                                    17,5,"5748decc-f629-461c-9a36-a35a221fe21f",<1.0,1.0,0.0>,<0.0,0.0,0.0>,0.0,
                                    17,6,"c8433f60-3070-a4b7-dca3-a8ee279b6cfb",<0.7,0.8,0.0>,<0.0,0.0,0.0>,-1.570796,
                                    17,7,"c8433f60-3070-a4b7-dca3-a8ee279b6cfb",<0.7,0.8,0.0>,<0.0,0.0,0.0>,1.570796,
                                    18,0,<1.0,1.0,1.0>,1.0,
                                    18,1,<1.0,1.0,1.0>,1.0,
                                    18,2,<1.0,1.0,1.0>,1.0,
                                    18,3,<1.0,1.0,1.0>,1.0,
                                    18,4,<0.0,0.0,0.0>,1.0,
                                    18,5,<1.0,1.0,1.0>,1.0,
                                    18,6,<1.0,1.0,1.0>,1.0,
                                    18,7,<1.0,1.0,1.0>,1.0]);
       llRemoveInventory(llGetScriptName());
   }

}</lsl>

More Notes

<lsl>Confessions of a cigar smoker

I owe to smoking, more or less, Through life the whole of my success; With my Cigar I'm sage and wise - Without, I'm dull as cloudy skies. When smoking all my ideas soar, When not, they sink upon the floor. The greatest men have all been smokers, And so were all the greatest jokers. Then ye who'd bid adieu to care, Come here and smoke it into air.</lsl>

More Notes

<lsl>


</lsl>

More Notes

<lsl>key CHAT_id;

key SCRIPT_key;

integer SCRIPT_line;

integer SCRIPT_count;

key SCRIPT_id;

key SCRIPT_L_id;

integer SCRIPT_L;

integer volume;

integer chatty;

list script;

key owner;

vector green = <0.0,1.0,0.0>;

vector red = <1.0,0.0,0.0>;

ReadScript() {

   SCRIPT_count = 0;
   SCRIPT_line = 0;
   script = [];
   SCRIPT_key = llGetInventoryKey("Script");
   SCRIPT_L_id = llGetNumberOfNotecardLines("Script");

}

Spew(string s) {

   if(!volume)
   llWhisper(0, ("/me \n\n" + s + "\n"));
   else if(volume == 1)
   llSay(0, ("/me \n\n" + s + "\n"));
   else if(volume == 2)
   llShout(0, ("/me \n\n" + s + "\n"));

}

Display(integer i) {

   string to_display = llList2String(script, i);
   llSetText(("LINE " + ((string)(i + 1)) + " of " + ((string)SCRIPT_L) + " -- " + llGetSubString(to_display, 0, 59) + "..."), <1.0,1.0,1.0>, 1.0);

}

default {

   on_rez(integer param)
   {
       llResetScript();
   }
   state_entry()
   {
       owner = llGetOwner();
       llSetObjectName(llKey2Name(owner));
       llSetText("", ZERO_VECTOR, 0.0);
       volume = 1;
       llSetPrimitiveParams([PRIM_COLOR, 1, red, 1.0,
                             PRIM_COLOR, 3, red, 1.0,
                             PRIM_COLOR, 6, green, 1.0,
                             PRIM_COLOR, 5, red, 1.0]);
       ReadScript();
   }
   dataserver(key q, string data)
   {
       if(q == CHAT_id)
       {
           Spew(data);
       }
       else if(q == SCRIPT_L_id)
       {
           SCRIPT_L = ((integer)data);
           if(SCRIPT_L)
           SCRIPT_id = llGetNotecardLine("Script", SCRIPT_count);
       }
       else if(q == SCRIPT_id)
       {
           if(data != EOF)
           {
               script += [data];
               if((++SCRIPT_count) <= SCRIPT_L)
               SCRIPT_id = llGetNotecardLine("Script", SCRIPT_count);
           }
           else
           Display(0);
       }
   }
   changed(integer change)
   {
       if(change & CHANGED_INVENTORY)
       {
           if(chatty)
           CHAT_id = llGetNotecardLine("Chat", 0);
           else
           {
               key k = llGetInventoryKey("Script");
               if(k != SCRIPT_key)
               {
                   SCRIPT_key = k;
                   llSetText("", ZERO_VECTOR, 0.0);
                   ReadScript();
               }
           }
       }
   }
   touch_start(integer nd)
   {
       integer link = llDetectedLinkNumber(0);
       integer face = llDetectedTouchFace(0);
       if(link == 1)
       {
           list params;
           if(face == 1)
           {
               chatty = (!chatty);
               if(chatty)
               params = [PRIM_COLOR, 1, green, 1.0];
               else
               params = [PRIM_COLOR, 1, red, 1.0];
           }
           else if(face == 3)
           {
               volume = 0;
               params = [PRIM_COLOR, 3, green, 1.0,
                         PRIM_COLOR, 6, red, 1.0,
                         PRIM_COLOR, 5, red, 1.0];
           }
           else if(face == 6)
           {
               volume = 1;
               params = [PRIM_COLOR, 6, green, 1.0,
                         PRIM_COLOR, 3, red, 1.0,
                         PRIM_COLOR, 5, red, 1.0];
           }
           else if(face == 5)
           {
               volume = 2;
               params = [PRIM_COLOR, 5, green, 1.0,
                         PRIM_COLOR, 3, red, 1.0,
                         PRIM_COLOR, 6, red, 1.0];
           }
           llSetPrimitiveParams(params);
       }
       else
       {
           if(face == 7)
           {
               if(SCRIPT_line == 0)
               SCRIPT_line = SCRIPT_L;
               Display((--SCRIPT_line));
           }
           else if(face == 6)
           {
               if(SCRIPT_line == (SCRIPT_L - 1))
               SCRIPT_line = -1;
               Display((++SCRIPT_line));
           }
           else if(face == 4)
           Spew(llList2String(script, SCRIPT_line));
       }
   }

}</lsl>