https://wiki.secondlife.com/w/api.php?action=feedcontributions&user=Lucius+Obviate&feedformat=atomSecond Life Wiki - User contributions [en]2024-03-29T07:37:15ZUser contributionsMediaWiki 1.36.1https://wiki.secondlife.com/w/index.php?title=Attach&diff=23486Attach2007-06-15T21:56:44Z<p>Lucius Obviate: Added example of usage for attach event</p>
<hr />
<div>{{LSL_Event<br />
|event_id=23<br />
|event_delay<br />
|event=attach<br />
|p1_type=key<br />
|p1_name=id<br />
|p1_desc=the avatar if attached, if not attached {{LSLG|NULL_KEY}}.<br />
|event_desc=Triggered when an object attaches or detaches from agent.<br />
|constants<br />
|spec<br />
|caveats<br />
|examples=<br />
The following is a simplified example of the attach event. As explained above the varible id will be the key of the avatar the scripted object is attached to otherwise it will take on the value of [[NULL_KEY]]. The conditional [[if]] statement is used to determine if the value of the varible id.<br />
<br />
default<br />
{ <br />
attach(key id)<br />
{<br />
[[if]](id != NULL_KEY)<br />
{<br />
[[llSay]](0,"I have been attached!")<br />
}<br />
else if(id == NULL_KEY)<br />
{<br />
[[llSay]](0,"I have been detached!")<br />
}<br />
}<br />
}<br />
<br />
|helpers<br />
|also_header<br />
|also_events<br />
|also_functions=*{{LSLG|llAttachToAvatar}}<br />
*{{LSLG|llDetachFromAvatar}}<br />
*{{LSLG|llGetAttached}}<br />
|also_articles=*{{LSLGC|Attachment}}<br />
|also_footer<br />
|notes<br />
|mode<br />
|deprecated<br />
|cat1=Attachment<br />
|cat2<br />
|cat3<br />
|cat4}}</div>Lucius Obviatehttps://wiki.secondlife.com/w/index.php?title=Talk:Follower_script&diff=20957Talk:Follower script2007-05-20T23:52:40Z<p>Lucius Obviate: Comment related to following with attachments.</p>
<hr />
<div>I will add, because I just recently learned this, if you put such a script in an attachment it is not needed to set it to physcial. Anything attached to an av will act as a physical object.<br />
<br />
--[[User:Lucius Obviate|Lucius Obviate]] 16:52, 20 May 2007 (PDT)</div>Lucius Obviatehttps://wiki.secondlife.com/w/index.php?title=Talk:LlEmail&diff=20927Talk:LlEmail2007-05-20T12:44:55Z<p>Lucius Obviate: Credited orginal resident.</p>
<hr />
<div>It's note-worthy to add that the following line of code can be used in the email event to remove headers from the message.<br />
<br />
message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1);<br />
<br />
Example:<br />
<br />
<br />
default<br />
{<br />
state_entry()<br />
{<br />
email(string time, string address, string subj, string message, integer num_left)<br />
{<br />
message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1);<br />
llSay(0,message);<br />
}<br />
}<br />
}<br />
<br />
<br />
Originally added by [http://www.lslwiki.org/index.php?title=PrioSerpentine&action=edit Prio] @ http://www.lslwiki.org/index.php/LlEmail<br />
<br />
--[[User:Lucius Obviate|Lucius Obviate]] 05:35, 20 May 2007 (PDT)</div>Lucius Obviatehttps://wiki.secondlife.com/w/index.php?title=Talk:LlEmail&diff=20926Talk:LlEmail2007-05-20T12:35:04Z<p>Lucius Obviate: Header Removal in Messages sent Via llEmail</p>
<hr />
<div>It's note-worthy to add that the following line of code can be used in the email event to remove headers from the message.<br />
<br />
message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1);<br />
<br />
Example:<br />
<br />
<br />
default<br />
{<br />
state_entry()<br />
{<br />
email(string time, string address, string subj, string message, integer num_left)<br />
{<br />
message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1);<br />
llSay(0,message);<br />
}<br />
}<br />
}<br />
<br />
--[[User:Lucius Obviate|Lucius Obviate]] 05:35, 20 May 2007 (PDT)</div>Lucius Obviate