Computer:jaycoonlanguage

From Second Life Wiki
Revision as of 05:56, 11 December 2007 by Huney Jewell (talk | contribs) (Brush up and add to category index)
Jump to navigation Jump to search

This is a language that is written in LSL. It reads a notecard specified by the user (meant for use with my computer that you can buy here: http://slurl.com/secondlife/Coda/249/46/73) <lsl> integer open = FALSE; //initialised: Starts un initialised string notecard; key datanotecardlin; key datanotecardtext; integer lines; string process; string line; string notcard; list ints; list strings; default {

   state_entry()
   {
       llListen(0,"","","");
       llListen(4,"","","");        
   }
   listen(integer chan, string name, key id, string message)
   {
       if(message == "os:load progs") //Init start here
       {
           llSay(4,"prog:jaycoonlanguage");
       }
       if(message == "bios:startjaycoonlanguage")
       {
           open = TRUE;
       }
       if(message == "close" && open)
       {
           open = FALSE;
       } //init done
       if(~llSubStringIndex(message, "notecard:") && open == TRUE)
       {
           notecard = llDeleteSubString(message,0,9); //set notecard
            
       }
       if(message == "compile" && notecard != "" && open)
       {
           //start compiling
          datanotecardlin = llGetNumberOfNotecardLines(notecard);
           process = "lines";
           integer contvar = 0;
           while (contvar <= lines)
           {
             datanotecardtext = llGetNotecardLine(notecard,contvar);
              if(~llSubStringIndex(line,"print:"))
               {
                    line = llDeleteSubString(line,0,6);        
                   if(~llListFindList(ints,[line]))
                   {
                       llSay(0,llList2String( ints,llListFindList(ints,[line])));
                   }
                   if(~llListFindList(strings,[line]))
                   {
                       llSay(0,llList2String( ints,llListFindList(strings,[line])));
                   }
                   llSay(0,line);
               }
               if(~llSubStringIndex(line,"int:"))
               {
                   line = llDeleteSubString(line,0,4);
                   ints += (integer)line;
                   
                   
               }
               if(~llSubStringIndex(line,"string:"))
               {
                   line = llDeleteSubString(line,0,4);
                   strings += (string)line;
                   
               }
               
               contvar++;
           }
       }
   }
   dataserver(key data, string function)
   {
       if(data == datanotecardlin)
       {
           lines = (integer)function;
       }    
       if(data == datanotecardtext)
       {
           line = function;
           
           
       }
       
   }

} </lsl>