Difference between revisions of "Script Override Functions"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{LSL Header}} well you like to overide strings ,integer etc in chat channel for example you like to enable debug or change the channel i find this the best solution and can be prety use...)
 
(cleaning up the code and what the heck is said_name supposed to be used for?)
Line 1: Line 1:
{{LSL Header}}
{{LSL Header}}


well you like to overide strings ,integer etc in chat channel  
well you like to overide strings, integer etc in chat channel  
for example you like to enable debug or change the channel i find this the best solution and can be prety usefull API framework for many listens.
for example you like to enable debug or change the channel i find this the best solution and can be prety usefull API framework for many listens.


USAGE: /CHANNEL Object_Name,message,value eg: /1000 Object,channel,1001
USAGE: /CHANNEL Object_Name,message,value eg: /1000 Object,channel,1001
<pre>
<pre>
list csv_commands ;
list csv_commands;


integer P_channel = 1000; // channel
integer P_channel = 1000; // channel
Line 19: Line 19:
     listen(integer channel, string name, key id, string message)  
     listen(integer channel, string name, key id, string message)  
     {
     {
    csv_commands = llCSV2List( llToLower ( (string)message ));
        csv_commands = llCSV2List( llToLower( message ));
    string said_name = llList2String( (list)csv_commands, 0);         
//        string said_name = llList2String( csv_commands, 0);         
    string command = llList2String( (list)csv_commands,1 );
        string command = llList2String( csv_commands, 1);
    if ( command == "channel")  
        if ( command == "channel")  
         {
         {
             P_channel = llList2Integer ( (list)csv_commands,2 );
             P_channel = (integer)llList2String( csv_commands, 2);
             llListenRemove( (integer)key_listen );
             llListenRemove( key_listen );
             key_listen = llListen((integer)P_channel, "","","");
             key_listen = llListen(P_channel, "","","");
             llOwnerSay ( "Listen Channel set to " + (string)P_channel );
             llOwnerSay( "Listen Channel set to " + (string)P_channel);
             return;
        }
        else if(command == "avatar" || message == "AVATAR")
        {
             llSay(0, "hello avatar");
         }
         }
    if(command == llToLower("AVATAR") || message == llToUpper("AVATAR"))
    {
    llSay(0, "hello avatar");
    }
   
     }
     }
}
}
Line 40: Line 38:


For technical support, requests, etc., use the Search under the Groups Tab and search for .::Prototype::.
For technical support, requests, etc., use the Search under the Groups Tab and search for .::Prototype::.
</pre>
 
if you have any problems getting this script to work either contect me inworld [https://wiki.secondlife.com/wiki/User:Revolution_Perenti Revolution Perenti]
if you have any problems getting this script to work either contect me inworld [https://wiki.secondlife.com/wiki/User:Revolution_Perenti Revolution Perenti]
or visit out Open Source Section at skidz partz we have many different versions of this system.
or visit out Open Source Section at skidz partz we have many different versions of this system.

Revision as of 14:07, 23 August 2007

well you like to overide strings, integer etc in chat channel for example you like to enable debug or change the channel i find this the best solution and can be prety usefull API framework for many listens.

USAGE: /CHANNEL Object_Name,message,value eg: /1000 Object,channel,1001

list csv_commands;

integer P_channel = 1000; // channel
integer key_listen;  // listen key
default
{
    state_entry()
    {
        key_listen = llListen(P_channel, "", NULL_KEY, "");
    }

    listen(integer channel, string name, key id, string message) 
    {
        csv_commands = llCSV2List( llToLower( message ));
//        string said_name = llList2String( csv_commands, 0);        
        string command = llList2String( csv_commands, 1);
        if ( command == "channel") 
        {
            P_channel = (integer)llList2String( csv_commands, 2);
            llListenRemove( key_listen );
            key_listen = llListen(P_channel, "","","");
            llOwnerSay( "Listen Channel set to " + (string)P_channel);
        }
        else if(command == "avatar" || message == "AVATAR")
        {
            llSay(0, "hello avatar");
        }
    }
}

For technical support, requests, etc., use the Search under the Groups Tab and search for .::Prototype::.

if you have any problems getting this script to work either contect me inworld Revolution Perenti or visit out Open Source Section at skidz partz we have many different versions of this system. Snow Crash