CasperLet/API: Difference between revisions
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
Our linked message is as follows: | Our linked message is as follows: | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'>llMessageLinked(LINK_SET, (integer)timeLeft, "RTIME", rentedBy);</syntaxhighlight> | ||
rentedBy is the key of the current renter, timeLeft is the amount of time left in seconds. | rentedBy is the key of the current renter, timeLeft is the amount of time left in seconds. | ||
Line 62: | Line 62: | ||
However, there should be '''no need to request an update on a timer''' - the rental units are designed to send information automatically when anything changes.}} | However, there should be '''no need to request an update on a timer''' - the rental units are designed to send information automatically when anything changes.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-UPDATE", NULL_KEY ); | llMessageLinked( LINK_THIS, 0, "CLAPI-UPDATE", NULL_KEY ); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 68: | Line 68: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-UPDATE|UPDATE|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-UPDATE|UPDATE|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 77: | Line 77: | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, AMOUNT_PAID, "CLAPI-PAY", PAYER_KEY ); | llMessageLinked( LINK_THIS, AMOUNT_PAID, "CLAPI-PAY", PAYER_KEY ); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 83: | Line 83: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-PAY|"+(string)PAYER_KEY+"|"+(string)AMOUNT_PAID); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-PAY|"+(string)PAYER_KEY+"|"+(string)AMOUNT_PAID); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 92: | Line 92: | ||
==== SAFEPAY ==== | ==== SAFEPAY ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, AMOUNT_PAID, "CLAPI-SAFEPAY"+(string)llGetKey(), PAYER_KEY ); | llMessageLinked( LINK_THIS, AMOUNT_PAID, "CLAPI-SAFEPAY"+(string)llGetKey(), PAYER_KEY ); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 98: | Line 98: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-SAFEPAY|"+(string)PAYER_KEY+"|"+(string)AMOUNT_PAID); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-SAFEPAY|"+(string)PAYER_KEY+"|"+(string)AMOUNT_PAID); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 105: | Line 105: | ||
==== TOUCH ==== | ==== TOUCH ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-TOUCH", TOUCHER_KEY ); | llMessageLinked( LINK_THIS, 0, "CLAPI-TOUCH", TOUCHER_KEY ); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 111: | Line 111: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-TOUCH|"+TOUCHER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-TOUCH|"+TOUCHER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 119: | Line 119: | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
{{Critical|If you're using this command to retrieve information from the rental unit, you're '''doing it wrong''' - use "UPDATE" instead, or contact us for help.}} | {{Critical|If you're using this command to retrieve information from the rental unit, you're '''doing it wrong''' - use "UPDATE" instead, or contact us for help.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-Info", USER_KEY); | llMessageLinked( LINK_THIS, 0, "CLAPI-Info", USER_KEY); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 125: | Line 125: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Info|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Info|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 135: | Line 135: | ||
==== TIMELEFT ==== | ==== TIMELEFT ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-TimeLeft", USER_KEY); | llMessageLinked( LINK_THIS, 0, "CLAPI-TimeLeft", USER_KEY); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 141: | Line 141: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-TimeLeft|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-TimeLeft|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 150: | Line 150: | ||
==== EVICT ==== | ==== EVICT ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-Evict", USER_KEY); | llMessageLinked( LINK_THIS, 0, "CLAPI-Evict", USER_KEY); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 156: | Line 156: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Evict|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Evict|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 165: | Line 165: | ||
==== REFUND ==== | ==== REFUND ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-Refund", USER_KEY); | llMessageLinked( LINK_THIS, 0, "CLAPI-Refund", USER_KEY); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 171: | Line 171: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Refund|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Refund|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 180: | Line 180: | ||
==== PRIM COUNT ==== | ==== PRIM COUNT ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-Prim Count", USER_KEY); | llMessageLinked( LINK_THIS, 0, "CLAPI-Prim Count", USER_KEY); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 186: | Line 186: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Prim Count|"+USER_KEY+"|"+ id +"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Prim Count|"+USER_KEY+"|"+ id +"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 195: | Line 195: | ||
==== WON'T RENEW ==== | ==== WON'T RENEW ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-Won't Renew", USER_KEY); | llMessageLinked( LINK_THIS, 0, "CLAPI-Won't Renew", USER_KEY); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 201: | Line 201: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Won't Renew|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Won't Renew|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 210: | Line 210: | ||
==== REMINDERS ==== | ==== REMINDERS ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-Reminders", USER_KEY); | llMessageLinked( LINK_THIS, 0, "CLAPI-Reminders", USER_KEY); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 216: | Line 216: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Reminders|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Reminders|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 225: | Line 225: | ||
==== LOCK / UNLOCK ==== | ==== LOCK / UNLOCK ==== | ||
{{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | {{Warning|This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-Lock/Unlock", USER_KEY); | llMessageLinked( LINK_THIS, 0, "CLAPI-Lock/Unlock", USER_KEY); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 231: | Line 231: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Lock/Unlock|"+USER_KEY+"|0"); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Lock/Unlock|"+USER_KEY+"|0"); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 241: | Line 241: | ||
==== RESET ==== | ==== RESET ==== | ||
{{Critical|DO NOT issue reset commands unless absolutely necessary. You should only need to do this ONCE, when your API script is inserted, and then never again. If you're using this feature to get information updates on a regular basis, you're '''doing it wrong''' - contact us for help.}} | {{Critical|DO NOT issue reset commands unless absolutely necessary. You should only need to do this ONCE, when your API script is inserted, and then never again. If you're using this feature to get information updates on a regular basis, you're '''doing it wrong''' - contact us for help.}} | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llMessageLinked( LINK_THIS, 0, "CLAPI-Reset", NULL_KEY ); | llMessageLinked( LINK_THIS, 0, "CLAPI-Reset", NULL_KEY ); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 247: | Line 247: | ||
.. or .. | .. or .. | ||
<syntaxhighlight lang="lsl" line=' | <syntaxhighlight lang="lsl" line='none'> | ||
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Reset|"+NULL_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Reset|"+NULL_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 12:35, 27 February 2017
API Documentation
Legal stuff
Please make sure that any usage of our brands or trademarks is in line with our brand usage policy.
API Works Only For System Owner
Please note: The API commands will only work from scripted objects owned by the same avatar that owns the copy of CasperLet they are being used on.
As most of you already know, it would be a security risk to allow the API commands to be used by anyone who's not the system owner.
Version 1 API
Here's the V1 API. This is supported by all CasperLET versions.
Our linked message is as follows:
llMessageLinked(LINK_SET, (integer)timeLeft, "RTIME", rentedBy);
rentedBy is the key of the current renter, timeLeft is the amount of time left in seconds.
If rentedBy == NULL_KEY then it means there is no renter, and the unit is available.
You can detect rental events by storing the last message. If the last message was NULL_KEY, and then the next one isn't, it means that someone rented the unit, and vice versa.
Version 1.5 API
The V1.5 API adds several new messages to provide extended information.
The first is REXTR:
REXTR|<time left>|<renter key or NULL_KEY if not rented>|<locked? 0 or 1>|<reserved key or NULL_KEY if not reserved>|<price per week>|<number of prims>|<is tenant over limit? 0 or 1>|<Unix timestamp on which the unit was rezzed>
We also provide some additional messages which provide useful information (both linked messages and broadcast on channel 77777.)
The "string" value of the linked message will identify the message type, as described below.
ADDTNTS@userkey1#username1#userkey2#username2#userkey3#username3#userke.. (etc)
MANAGERS@managerkey1#managerkey2#managerkey3#managerkey4.. (etc)
Note the use of different delimiters on these messages, this is due to technical limitations.
All of the above information is also broadcasted on channel 77777. The following messages are only provided in linked messages:
String: BUTTONS Key: pricebox|paybutton1|paybutton2|paybutton3|paybutton4
(to correspond with llSetPayPrice)
String: TEXT Key: the floating text that is shown on the unit
As before, THERE IS NO GUARANTEE WHEN THE INFORMATION WILL BE SENT - So check for changes, rather than just reacting to the message.
In addition to this, the unit also accepts certain linked messages, as well as chat messages on channel -77777.
You can use these as follows:
UPDATE
llMessageLinked( LINK_THIS, 0, "CLAPI-UPDATE", NULL_KEY );
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-UPDATE|UPDATE|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
This triggers the unit to spit out the linked messages and data on channel 77777. The integer can be any number.
PAY
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, AMOUNT_PAID, "CLAPI-PAY", PAYER_KEY );
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-PAY|"+(string)PAYER_KEY+"|"+(string)AMOUNT_PAID); // where KEY_OF_UNIT is the uuid of the rental box/meter
This provides a way to simulate payment to the unit.
BE WARNED: This WILL SIMULATE PAYMENT. Which means, if the payment is rejected, money will be REFUNDED.
SAFEPAY
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, AMOUNT_PAID, "CLAPI-SAFEPAY"+(string)llGetKey(), PAYER_KEY );
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-SAFEPAY|"+(string)PAYER_KEY+"|"+(string)AMOUNT_PAID); // where KEY_OF_UNIT is the uuid of the rental box/meter
This provides a way to simulate payment to the unit, but WITHOUT any refunds, profit shares, or messages to the user.
TOUCH
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, 0, "CLAPI-TOUCH", TOUCHER_KEY );
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-TOUCH|"+TOUCHER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
This triggers the unit to give the user indicated by TOUCHER_KEY the standard dialog menu.
INFO
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
If you're using this command to retrieve information from the rental unit, you're doing it wrong - use "UPDATE" instead, or contact us for help. |
llMessageLinked( LINK_THIS, 0, "CLAPI-Info", USER_KEY);
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Info|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
Please pay attention to the case of the command above.
This command is synonymous to the user indicated by USER_KEY pressing the Info button, except it won't deliver the notecard.
TIMELEFT
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, 0, "CLAPI-TimeLeft", USER_KEY);
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-TimeLeft|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
Please pay attention to the case of the command above.
This command is synonymous to the user indicated by USER_KEY pressing the TimeLeft button
EVICT
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, 0, "CLAPI-Evict", USER_KEY);
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Evict|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
Please pay attention to the case of the command above.
This command is synonymous to the user indicated by USER_KEY pressing the Evict button
REFUND
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, 0, "CLAPI-Refund", USER_KEY);
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Refund|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
Please pay attention to the case of the command above.
This command is synonymous to the user indicated by USER_KEY pressing the Refund button
PRIM COUNT
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, 0, "CLAPI-Prim Count", USER_KEY);
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Prim Count|"+USER_KEY+"|"+ id +"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
Please pay attention to the case of the command above.
This command is synonymous to the user indicated by USER_KEY pressing the Prim Count button
WON'T RENEW
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, 0, "CLAPI-Won't Renew", USER_KEY);
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Won't Renew|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
Please pay attention to the case of the command above.
This command is synonymous to the user indicated by USER_KEY pressing the Won't Renew button
REMINDERS
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, 0, "CLAPI-Reminders", USER_KEY);
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Reminders|"+USER_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
Please pay attention to the case of the command above.
This command is synonymous to the user indicated by USER_KEY pressing the Reminders button
LOCK / UNLOCK
This command is handled by the CasperTech servers. Do not make unreasonably frequent or repeated requests. |
llMessageLinked( LINK_THIS, 0, "CLAPI-Lock/Unlock", USER_KEY);
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Lock/Unlock|"+USER_KEY+"|0"); // where KEY_OF_UNIT is the uuid of the rental box/meter
Please pay attention to the case of the command above.
This command is synonymous to the user indicated by USER_KEY pressing the Lock/Unlock button
RESET
llMessageLinked( LINK_THIS, 0, "CLAPI-Reset", NULL_KEY );
.. or ..
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-Reset|"+NULL_KEY+"|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
This triggers the unit to reset. Please use this ONLY when absolutely necessary - if a unit restarts too often, it will be blocked from the network.
Script Samples
Script to Change Hovertext Color
default { link_message( integer sender_num, integer num, string str, key id ) { if (str=="TEXT") { list tmp = llParseStringKeepNulls((string)id, ["|"],[]); llSetText(llList2String(tmp,1),<0.0,0.0,0.0>,1.0); // This script changes text to black } } }
Finding Rental Unit Keys/UUID
In Firestorm viewer, right-click > edit > "Copy Keys"
FAQ / Troubleshooting
- Q. Is there a way to get the unit to spit out any data on additional subtenants?
- A. This information is sent when there are additional tenants added or removed, and when the unit is reset. You can request that the rental unit is reset by using CLAPI-Reset, as detailed above, however you must only do this ONCE. Any further updates will be transmitted when they happen.
- Q. The API documentation says:
llRegionSayTo( KEY_OF_UNIT, -77777, "CLAPI"+KEY_OF_UNIT+"-UPDATE|UPDATE|0" ); // where KEY_OF_UNIT is the uuid of the rental box/meter
- but when I stand next to the box and say this in local chat, nothing happens:
-77777 CLAPI-UPDATE|5194ac0b-4a9f-5c4b-d24e-e0a374533f1d|UPDATE|123
- A. Rental units do NOT respond to avatars. The command will need to be coming from a scripted object.
- Q. I'm trying to get help with a script using the API, but I'm worried that someone else will use the script to get free rent...
- A. The rental units will only respond to a scripted API command from an object that is owned by the same avatar that owns the rental units. So no, a third party cannot get free rent, or otherwise abuse the API for YOUR rental units.