Difference between revisions of "Template:AdminBot Event Variables Table"
From SmartBots Developers Docs
(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<syntaxhighlight lang="lsl">// Event usage:</syntaxhighlight> | <syntaxhighlight lang="lsl">// Event usage:</syntaxhighlight> | ||
− | <div class="mw-highlight"><span class="nb">link_message</span><span class="p">(</span><span class="kt">integer</span><span class="w"> </span><span class="nv">sender</span><span class="p">, </span><span class="kt">integer</span><span class="w"> </span><span class="nv">cmd</span><span class="p">, </span><span class="w"> </span><span class="kt">string</span><span class="w"> </span><span class="nv">data</span><span class="p">, </span><span class="w"> </span><span class="kt">key</span><span class="w"> </span><span class="nv">id</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span> | + | <div class="mw-highlight"><div class="mw-code"><span class="nb">link_message</span><span class="p">(</span><span class="kt">integer</span><span class="w"> </span><span class="nv">sender</span><span class="p">, </span><span class="kt">integer</span><span class="w"> </span><span class="nv">cmd</span><span class="p">, </span><span class="w"> </span><span class="kt">string</span><span class="w"> </span><span class="nv">data</span><span class="p">, </span><span class="w"> </span><span class="kt">key</span><span class="w"> </span><span class="nv">id</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span> |
− | <span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="nv">cmd</span><span class="o"> == </span><span class="nv">{{{event}}}</span><span class="p">)</span><span class="w"> </span><span class="p">{</span | + | <span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="nv">cmd</span><span class="o"> == </span><span class="nv">{{{event}}}</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span><br><span class="w"> </span><span class="nf">llOwnerSay</span><span class="p">(</span><span class="s2">"Event "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">cmd</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">" arrived! Data:</span><span class="se">\n</span><span class="s2">"</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">data</span><span class="p">);</span> |
− | <span class="w"> </span><span class="nf">llOwnerSay</span><span class="p">(</span><span class="s2">"Event "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">cmd</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">" arrived! Data:</span><span class="se">\n</span><span class="s2">"</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">data</span><span class="p">); | + | <span class="w"> </span><span class="p">}</span><br><span class="w"></span><span class="p">}</span> |
− | <span class="w"> </span> | + | <span class="w"></span></div></div> |
− | <span class="p">}</span><span class="w"></span> | + | |
− | </div> | + | |
− | + | ||
<!-- a kind of mess above, it is a <syntaxhighlight> tag imitation --> | <!-- a kind of mess above, it is a <syntaxhighlight> tag imitation --> | ||
− | + | == Event parameters == | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | '' | + | ''link_message'' event receives ''cmd'', ''str'' and ''id'' parameters. Their meaning for {{{event}}} event is explained below: |
{| class="niceTable" | {| class="niceTable" | ||
! colspan="2" width="120" | Variable | ! colspan="2" width="120" | Variable | ||
− | ! width="50" | | + | ! width="50" | Type |
− | ! Description | + | ! Description |
+ | {{API Variable|cmd|integer}} the {{{event}}}'s numeric ID<!-- |
Latest revision as of 11:36, 3 November 2017
// Event usage:
link_message(integer sender, integer cmd, string data, key id) {
if(cmd == {{{event}}}) {
llOwnerSay("Event " + cmd + " arrived! Data:\n" + data);
}
}
Event parameters
link_message event receives cmd, str and id parameters. Their meaning for {{{event}}} event is explained below:
Variable | Type | Description | |
---|---|---|---|
cmd | integer | the {{{event}}}'s numeric ID |