<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.herc.ws/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Attachrid</id>
		<title>Attachrid - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Attachrid"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Attachrid&amp;action=history"/>
		<updated>2026-05-01T14:23:58Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Attachrid&amp;diff=478&amp;oldid=prev</id>
		<title>Via: Created page with &quot;==Syntax== *'''attachrid'''(&lt;rid&gt;); *'''detachrid''';  ==Description== These commands allow the manipulation of the script's currently attached player. While '''...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Attachrid&amp;diff=478&amp;oldid=prev"/>
				<updated>2013-06-10T22:23:47Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Syntax== *&amp;#039;&amp;#039;&amp;#039;attachrid&amp;#039;&amp;#039;&amp;#039;(&amp;lt;rid&amp;gt;); *&amp;#039;&amp;#039;&amp;#039;detachrid&amp;#039;&amp;#039;&amp;#039;;  ==Description== These commands allow the manipulation of the script&amp;#039;s &lt;a href=&quot;/wiki/RID#Usage&quot; title=&quot;RID&quot;&gt;currently attached&lt;/a&gt; player. While &amp;#039;&amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Syntax==&lt;br /&gt;
*'''attachrid'''(&amp;lt;rid&amp;gt;);&lt;br /&gt;
*'''detachrid''';&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
These commands allow the manipulation of the script's [[RID#Usage|currently attached]] player. While '''attachrid''' allows attaching of a different player by using it's [[AID|account id]] for the parameter ''rid'', '''detachrid''' makes the following commands run, as if the script was never invoked by a player.&lt;br /&gt;
&lt;br /&gt;
In case, that the player cannot be attached, such as, when the player went offline in the mean time, attachrid returns 0, otherwise 1.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
 [[mes]] &amp;quot;Enter a name of a player.&amp;quot;;&lt;br /&gt;
 [[next]];&lt;br /&gt;
 [[input]] .@playername$;&lt;br /&gt;
 [[set]] .@playerid,[[getcharid]](3,.@playername$);  // retrieve rid of another player&lt;br /&gt;
 set .@invokeid,getcharid(3);                // retrieve rid of the current player&lt;br /&gt;
 &lt;br /&gt;
 detachrid;                                  // detaches the current player,&lt;br /&gt;
                                             // although not necessary before attachrid&lt;br /&gt;
 &lt;br /&gt;
 [[if]](.@playerid &amp;amp;&amp;amp; attachrid(.@playerid))     // playerid is 0, if player is offline&lt;br /&gt;
 {&lt;br /&gt;
     [[dispbottom]] &amp;quot;Hello! *^__^*&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
     set .@playerid,0;                       // indicate attachrid failure&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 if(attachrid(.@invokeid))                   // attach back to the first player&lt;br /&gt;
 {&lt;br /&gt;
     if(.@playerid)&lt;br /&gt;
     {&lt;br /&gt;
         mes &amp;quot;I have said hello to &amp;quot;+.@playername$+&amp;quot;.&amp;quot;;&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
         mes &amp;quot;I was not able to reach &amp;quot;+.@playername$+&amp;quot;.&amp;quot;;&lt;br /&gt;
     }&lt;br /&gt;
     [[close]];&lt;br /&gt;
 }&lt;br /&gt;
 [[end]];&lt;br /&gt;
This will allow one player to specify the name of an another, which is then greeted by the script. Afterwards the invoking player is informed, whether or not the player was told &amp;quot;hello&amp;quot;. The return value of attachrid should be always checked for success, otherwise the script terminates on the next command, which requires an attached player, on failure.&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Command]]&lt;/div&gt;</summary>
		<author><name>Via</name></author>	</entry>

	</feed>