Difference between revisions of "User:Nexii Malthus/Script API"

From Second Life Wiki
Jump to navigation Jump to search
(New page: Based from LSL To Client Communication I decided to go ahead and attempt to fully implement a modified version of the protoc...)
 
Line 91: Line 91:
}
}
</lsl>
</lsl>
== Supported Clients ==
Currently the Vertical Life Client is the only client currently with a working version of "Script Collaboration" LSL-Client communication.
Official Vertical Life Client Forum
http://nexii.ordoimperialis.com/index.php
Updated executable with added Script Collaboration feature
http://nexii.ordoimperialis.com/client/VerticalLife%20v1.4.1.7z




[[Category:AW Groupies User Pages]]
[[Category:AW Groupies User Pages]]

Revision as of 11:07, 11 May 2009

Based from [To Client Communication] I decided to go ahead and attempt to fully implement a modified version of the protocol.

Please see Dale's implementation first, so not everything has to be repeated here and you might see the slight differences in my protocol.

Protocol

Before anything can be queried, a connection has to be made with the client by agreeing on a common channel for receiving responses. The protocol uses tokens like Dale's implementation. Any message addressed to the viewer has to begin with 'Vwr'.

The connection is made with the command Connect, followed by a channel number. Query: $Vwr$Connect$123456

The client will then verify this connection by an 'Ok.' on the channel. Repeating the query with a different channel will change the agreed upon channel to the new one.

Once a connection is made, the LSL Script can execute all the other queries

There are some general basic functions. $Vwr$Capabilities $Vwr$Client $Vwr$Creator $Vwr$OperatingSystem

Then there are 'Packages' or 'Extensions', much like in Dale's implementation, but not really requiring a full name of the creator.

The two current extensions are 'Nexii' and 'Permission'.

Permission is used to request permission from the user for client-side powers of various functions that may need special User permission granted first. $Vwr$Permission$NexiiPicker

'Nexii' is empty at the time of writing but im implementing a function for being able to receive 'touches' in the world or clicks aka Picker. $Vwr$Nexii$Picker$<Arguments> $Vwr$Nexii$Picker$World|Once $Vwr$Nexii$Picker$HUD|All $Vwr$Nexii$Picker$Once|HUD|World

Example

This is a working example LSL Script <lsl> list Data = []; integer Tick;

default{

   state_entry(){
       llSetColor( <1,0,0>, -1 );
       llListen( 30, "", "", "" );
   }
   
   touch_start( integer dn ){
       llSetColor( <1,0,0>, -1 );
       llSay( 0,"Creating connection to owner..." );
       llOwnerSay( "$Vwr$Connect$30" );
   }
   
   listen( integer ch, string nm, key k, string msg ){
       if( msg == "Ok." ) state Two;
   }

}

state Two{

   state_entry(){
       llSay( 0, "Connection successful." );
       llSetColor( <1,1,0>, -1 );
       llListen( 30, "", "", "" );
       Tick = 0; Data = [];
       llSay( 0, "Executing functions..." );
       llOwnerSay( "$Vwr$Capabilities" );
   }
   
   listen( integer ch, string nm, key k, string msg ){
       if( Tick == 0 ){
           Data += msg; ++Tick;
           llOwnerSay( "$Vwr$Creator" );
       } else if( Tick == 1 ){
           Data += msg; ++Tick;
           llOwnerSay( "$Vwr$OperatingSystem" );
       } else if( Tick == 2 ){
           Data += msg;
           state Three;
       }
   }

}

state Three{

   state_entry(){
       llSetColor( <0,1,0>, -1 );
       llSay( 0,"Complete. Debug:\n"+
           "Capabilities: "+llList2String(Data,0) +"\n"+
           "Creator: "+llList2String(Data,1) +"\n"+
           "OS: "+llList2String(Data,2) );
   }

} </lsl>

Supported Clients

Currently the Vertical Life Client is the only client currently with a working version of "Script Collaboration" LSL-Client communication.

Official Vertical Life Client Forum http://nexii.ordoimperialis.com/index.php

Updated executable with added Script Collaboration feature http://nexii.ordoimperialis.com/client/VerticalLife%20v1.4.1.7z