Difference between revisions of "LlRemoteLoadScriptPin"

From Second Life Wiki
Jump to navigation Jump to search
m (Added to inventory catagory since it changes inventory.)
m
Line 3: Line 3:
|func_id=253|func_sleep=3.0|func_energy=10.0
|func_id=253|func_sleep=3.0|func_energy=10.0
|func=llRemoteLoadScriptPin
|func=llRemoteLoadScriptPin
|func_desc=Copy script '''name''' into '''target''' and set to '''running''' with a '''start_param''' only if '''target''''s [[llSetRemoteScriptAccessPin|pin]] matches '''pin'''
|func_desc=Copy script {{LSLP|name}} into {{LSLP|target}} and set to {{LSLP|running}} with a {{LSLP|start_param}} only if {{LSLP|target}}'s [[llSetRemoteScriptAccessPin|pin]] matches {{LSLP|pin}}
|p1_type=key|p1_name=target|p1_desc
|p1_type=key|p1_name=target|p1_desc
|p2_type=string|p2_name=name|p2_desc
|p2_type=string|p2_name=name|p2_desc
Line 9: Line 9:
|p4_type=integer|p4_name=running|p4_desc=boolean, if the script is to be set as running.
|p4_type=integer|p4_name=running|p4_desc=boolean, if the script is to be set as running.
|p5_type=integer|p5_name=start_param|p5_desc=value returned by [[llGetStartParameter]] in the target script.
|p5_type=integer|p5_name=start_param|p5_desc=value returned by [[llGetStartParameter]] in the target script.
|func_footnote=Only works if the [[LSL Glossary#script owner|script owner]] can modify '''target'''.
|func_footnote=Only works if the [[LSL Glossary#script owner|script owner]] can modify {{LSLP|target}}.
|return_text
|return_text
|spec
|spec
|caveats=
|caveats=
* If '''name''' is present in the '''target''' prim's inventory then it is silently replaced.
* If {{LSLP|name}} is present in the {{LSLP|target}} prim's inventory then it is silently replaced.
* '''start_param''' only lasts until the script is reset.
* {{LSLP|start_param}} only lasts until the script is reset.
* Only the owner of an {{LSLGC|Attachment|attachment}} can modify it while it is being worn.
* Only the owner of an {{LSLGC|Attachment|attachment}} can modify it while it is being worn.
** If '''target''' is an {{LSLGC|Attachment|attachment}} owned by a different user, regardless of object modify rights granted, this function will silently fail.
** If {{LSLP|target}} is an {{LSLGC|Attachment|attachment}} owned by a different user, regardless of object modify rights granted, this function will silently fail.
* If '''pin''' fails to match, the error "Task ~Prim~ trying to illegally load script onto task ~Other_Prim~!" is shouted on [[DEBUG_CHANNEL]]. "~Prim~" and "~Other_Prim~" are substituted with the applicable prim names.
* If {{LSLP|pin}} fails to match, the error "Task ~Prim~ trying to illegally load script onto task ~Other_Prim~!" is shouted on [[DEBUG_CHANNEL]]. "~Prim~" and "~Other_Prim~" are substituted with the applicable prim names.
* If '''target''' is the script's parent ('''target''' == [[llGetKey]]()) then "Unable to add item!" is shouted on [[DEBUG_CHANNEL]].
* If {{LSLP|target}} is the script's parent (<code>{{LSLPT|target}} == [[llGetKey]]()</code>) then "Unable to add item!" is shouted on [[DEBUG_CHANNEL]].
* If the object containing this script is deeded to a group, than script '''name''' needs transfer permissions; even if '''target''' is deeded to the same group.
* If the object containing this script is deeded to a group, than script {{LSLP|name}} needs transfer permissions; even if {{LSLP|target}} is deeded to the same group.
* When the script is set to run (with '''running''', the running checkbox or [[llSetScriptState]]) [[state_entry]] will be queued.
* When the script is set to run (with {{LSLP|running}}, the running checkbox or [[llSetScriptState]]) [[state_entry]] will be queued.
|constants
|constants
|examples=
|examples=

Revision as of 09:44, 13 June 2012

Summary

Function: llRemoteLoadScriptPin( key target, string name, integer pin, integer running, integer start_param );
3.0 Forced Delay
10.0 Energy

Copy script name into target and set to running with a start_param only if target's pin matches pin

• key target prim UUID that is in the same region
• string name a script in the inventory of the prim this script is in
• integer pin Must match pin set by llSetRemoteScriptAccessPin
• integer running boolean, if the script is to be set as running.
• integer start_param value returned by llGetStartParameter in the target script.

Only works if the script owner can modify target.

Caveats

  • This function causes the script to sleep for 3.0 seconds.
  • If target is not owned by the same person, and name does not have transfer permissions, an error is shouted on DEBUG_CHANNEL.
  • If name permissions do not allow copy, the transfer fails and an error is shouted on DEBUG_CHANNEL.
  • If target is not in the same region an error is shouted on DEBUG_CHANNEL.
  • When scripts are copied or moved between inventories, their state does not survive the transfer. Memory, event queue and execution position are all discarded.
  • If name is missing from the prim's inventory or it is not a script then an error is shouted on DEBUG_CHANNEL.
  • If name is present in the target prim's inventory then it is silently replaced.
  • start_param only lasts until the script is reset.
  • Only the owner of an attachment can modify it while it is being worn.
    • If target is an attachment owned by a different user, regardless of object modify rights granted, this function will silently fail.
  • If pin fails to match, the error "Task ~Prim~ trying to illegally load script onto task ~Other_Prim~!" is shouted on DEBUG_CHANNEL. "~Prim~" and "~Other_Prim~" are substituted with the applicable prim names.
  • If target is the script's parent (target == llGetKey()) then "Unable to add item!" is shouted on DEBUG_CHANNEL.
  • If the object containing this script is deeded to a group, than script name needs transfer permissions; even if target is deeded to the same group.
  • When the script is set to run (with running, the running checkbox or llSetScriptState) state_entry will be queued.

Examples

Script copier

<lsl>//Copy a script to the second prim integer PIN=1341134;

default {

   state_entry() {
       llRemoteLoadScriptPin( llGetLinkKey(2), "some script", PIN, TRUE, 0xBEEEEEEF );
   }

}</lsl>

Pin setter

Simple script used for setting the pin for a prim, so you can later send scripts to it with llRemoteLoadScriptPin. <lsl>//Child Prim PIN setter integer PIN=1341134;

default {

   state_entry() {
       llOwnerSay(llGetObjectName()+" : "+(string)llGetKey()+" is ready to accept a describer script using the agreed upon PIN.");
       llSetRemoteScriptAccessPin(PIN);
   }
}</lsl>

See Also

Functions

•  llSetRemoteScriptAccessPin Used to setup a prim for remote loading
•  llSetScriptState Set a scripts running state
•  llResetOtherScript Reset another script in the prim

Deep Notes

History

  • Added in 1.2.6
  • In SL 1.25.4 this function will not copy/move any script into an attachment unless the script is full perm. (SVC-3725)
  • SL 1.25.5 will allow this function to copy/move a script into an attachment so long as the target has matching (or more restrictive) copy and transfer permissions. (SVC-3738)

Signature

function void llRemoteLoadScriptPin( key target, string name, integer pin, integer running, integer start_param );