If you plan on editing the scripts HUD.utility.rlv.1.lsl or HUD.utility.plugin.lsl (they are inside the Utility HUD), you can access the sub’s stats and settings via built-in global variables.
If you are writing your own scripts, you can use those two scripts as templates to use the global variables. These variables are updated live via the link_message() event, by the controller scripts and the main HUD.
If you make toys of your own, your toy can also access many of these global stats from the sub’s uHUD.
Sub’s Owner
string ownerNameCSV
a CSV-string of the legacy names of the sub’s owners. e.g. ownerNameCSV=”Johnny Carpenter, Jane Carpenter, Hollie Wood”
ownerKeyCSV is useful for checking whether a name is among the sub’s owners.
integer isOwner; if (~llSubStringIndex(ownerNameCSV,name)) { isOwner = TRUE; //do something; }
If you want to use this in your own script, you can define your own global variable as such:</>
integer ownerNameCSV; default { } link_message(integer sender_num, integer num, string msg, key id) { if (id == "ownerNameCSV") ownerNameCSV = msg; //from controller script } }
string ownerKeyCSV
a CSV string of the sub’s owners’ keys. e.g. ownerKeyCSV=”55edea86-3792-45a8-8ae4-7e5d9dc8f8d0,7a8b523c-ab78-47e8-b988-69182f8ca333″
ownerKeyCSV is useful for checking whether a key is among the sub’s owners.
integer isOwner; if (~llSubStringIndex(ownerKeyCSV,id)) { isOwner = TRUE; //do something; }
integer ownerPressed
ownerPressed = TRUE when the last listen() event (e.g. menu button, or chat command) was triggered by the sub’s owner.
listen(integer channel,string name,key id, string msg) { ... string your = "your"; if (ownerPressed) your += "sub's"; // llRegionSayTo(id,0,"You admire " + your + " little shiny bell."); }
See also:ownerPressedElseMsg() function
Sub’s Settings
integer isMale
isMale = TRUE if sub is male, FALSE if not.
string hisHer = "her"; if (isMale) hisHer = "his"; llWhisper(0,llKey2Name(llGetOwner()) + " is happy with " + hisHer + " new collar.");
integer cmdChannel
the chat channel for LULU commands. e.g. /1c, /1g, /1. The default is 1.
listen(integer channel, string name, key id, string msg) { //create your own commands on the same cmdChannel. if (msg == "kneel") { //play kneel animation. } } link_message(integer sender_num, integer num, string msg, key id) { if (id == "cmdChannel") llListen((integer) msg,"","",""); }
string subType2
The sub type according to the LULU Collar settings: pet, sub, slave, sex-slave, doll, ponygirl or ponyboy.
llWhisper(0,llKey2Name(llGetOwner()) + " is a good " + subType2);
integer spacial
3 = all text emotes to be at 20m (use llSay())
2 = all text emotes to be at 10m (use llWhisper())
1 = all text emotes to be private (use llInstantMessage() or llRegionSayTo() for all owners in sim plus sub)
0 = all text emotes to be ignored
string msg = llKey2Name(llGeOwner()) + " wishes everyone a Merry Christmas."; if (spacial == 3) llSay(msg); else if (spacial == 2) llWhisper(msg);
See also the whisper() function which automatically implements this.
Sub’s Current State
integer sittingOnObj
sittingOnObj is TRUE when sub is sitting on an object; FALSE otherwise.
link_message(integer sender_num, integer num, string msg, key id) { if (id == "sittingOnObj") { sittingOnObj = (integer) msg; //automatically disables unsit whenever sub sits on anything, trapping her if (sittingOnObj && isRLV) llOwnerSay("@unsit=n"); }
integer gearLocked
a bitwise integer where:
– if bit 4 is on, means collar is locked.
– if bit 2 is on, means cuffs are locked.
– if bit 1 is on, means gag is locked.
... //reminder to lock the collar. if (!(gearLocked & 4)) llRegionSayTo(id,0,"For security, please ensure collar is locked."); ...
integer isRLV
isRLV is TRUE if RLV is active, FALSE otherwise.
listen(integer channel, string name, key id, string msg) { if (isRLV) //dosomething; else llRegionSayTo(id,0,"Sorry, RLV is not active!"); }
integer rlvVer
RLV Version, where v1.21.1 is represented by the format 1210100
if (rlvVer > 1210000) //do something that is supported by v1.21.0 and above. else //do something else;
integer HUDOn
HudOn is TRUE if the LULU Signature HUD (aka Main HUD) is worn; FALSE if not.
listen(integer channel, string name, key id, string msg) { ... if (!HUDOn) { llOwnerSay("Sorry, you need to wear your LULU Signature HUD for me to work properly."); return; } }
Back to uHUD API
Or, go to Built-in Functions