An API (or Application Programming Interface) defines how to control a piece of software.
This API is for the
AutoBlock - a handy building brick within Second Life which can be told where to go and what shape, colour etc. to assume when it gets there.
API for the autobuilder_block
Version 1.0
The channel and other constants are set in the block code.
The block listens for commands of the form
^{^}*
for example
142^go
*ZZZ put in a shape command example
Where
= the block number of this specific blockId
there is a special value, c_block_ALL, which will cause all blocks to listen
if the blockId value does not match this block's id (start_parameter on rez) then do nothing
unless the command has been sent to the special c_block_ALL or the command is 'deleteall'
= the command to perform, valid commands are :
delete - delete this block, even the endpoint
deleteall - delete all blocks, except endpoint
freeze - remove the script from this block
nomove - ignore all future commands except freeze, delete, deleteall
report - report the position of this block back to the master, used by the endpoint
shape - [ block reposition, shape and appearance parameters
shape2 - [ see below for detail of shape(?) commands
go - apply the shape and shape2 parameters which were previously noted
The blocks expect parameters for shape and shape2 to be sent as integer/vector/rotation strings constructed
from list members.
An example send routine :
master_say(list ls) { // need to shout
string msg = llDumpList2String(ls,"^");
if (c_block_master != 0) {
llShout(c_block_master,msg);
}
}
The shape and shape2 commands as master_say examples
// size, position, pathcut, topsize, topshear, transparency
master_say(,<1,1,0>,<0,0,0>,0">code,"shape",size,pos,<0,1,0>,<1,1,0>,<0,0,0>,0);
// texture, texturescale, colour, physical, repeat, rotation
master_say(">code,"shape2",texture,room_texture_scale,use_colour,0,FLAGrepeat,<0,0,0,0>);