Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

From Roll20 Wiki

Jump to: navigation, search
m
m (Replaced content with "{{#invoke:Navbar|error|Foo}}")
Line 1: Line 1:
The following script creates the API commands <code>!mark</code>, <code>!unmark</code>, and <code>!clearmark</code>
+
{{#invoke:Navbar|error|Foo}}
 
+
==== Syntax ====
+
<blockquote style="border:1px #0088ee solid;background:#eee;padding:0.5em">!mark ''tokenid'' [''status'' [''type'']]<br>
+
!unmark ''tokenid'' [''status'' [''type'']]<br>
+
!clearmark ''tokenid''</blockquote>
+
 
+
===== Regular Grammar Syntax =====
+
<blockquote style="border:1px #0088ee solid;background:#eee;padding:0.5em"><code>S</code> &rarr; !mark <code>parameters</code><br>
+
<code>S</code> &rarr; !unmark <code>parameters</code><br>
+
<code>S</code> &rarr; !clearmark <code>tokenid</code><br>
+
<code>parameters</code> &rarr; <code>tokenid</code><br>
+
<code>parameters</code> &rarr; <code>tokenid</code> <code>status</code> <code>type</code><br>
+
<code>tokenid</code> &rarr; ''string''<br>
+
<code>status</code> &rarr; <code>condition</code><br>
+
<code>status</code> &rarr; <code>marker</code><br>
+
<code>condition</code> &rarr; ''string''<br>
+
<code>marker</code> &rarr; ''string''<br>
+
<code>type</code> &rarr; ''string''<br>
+
<code>type</code> &rarr; &epsilon;</blockquote>
+
 
+
{| class="wikitable"
+
|-
+
! Parameter
+
! Values
+
|-
+
| ''tokenid''
+
| The ID of the token to mark. Use <code><nowiki>@{target|token_id}</nowiki></code> or <code><nowiki>@{selected|token_id}</nowiki></code> to get this value.
+
|-
+
| ''status''
+
| (Optional) A D&D 4e status (except for dying, helpless, unconscious, insubstantial, or surprised) or the name of a [[API:Objects#Graphic (Token/Map/Card/Etc.)|statusmarker icon]]. The script has several aliases for the statuses. For example, immobilized, immobile, and immob all correspond to the same marker.
+
 
+
If ''status'' is not specified, the purple statusmarker will be used.
+
|-
+
| ''type''
+
| (Optional) A D&D 4e damage type. Only used if ''status'' is ''ongoing'', ''damage'', or ''dam''. One of:
+
* acid
+
* cold
+
* fire
+
* force
+
* lightning
+
* necrotic
+
* poison
+
* psychic
+
* radiant
+
* thunder
+
If ''type'' is not specified, a statusmarker to represent untyped damage will be used.
+
|}
+
 
+
The <code>!mark</code> command will set a marker, while the <code>!unmark</code> command will clear it. <code>!clearmark</code> will clear all markers from the token.
+
 
+
==== Code ====
+
<pre data-language="javascript">
+
on('chat:message', function(msg) {
+
    // Code is here~!
+
});
+
</pre>
+
 
+
==== Examples ====
+
'''!mark @{target|token_id} brown'''
+
<blockquote>This will set the brown marker on the target token.</blockquote>
+
 
+
'''!mark @{target|token_id} immob'''
+
<blockquote>This will set the 'immobilize' icon to the target token.</blockquote>
+
 
+
'''!mark @{selected|token_id} ongoing fire'''
+
<blockquote>This will mark the selected token with ongoing fire damage.</blockquote>
+
 
+
'''!unmark @{selected|token_id}'''
+
<blockquote>This will remove the purple (default) statusmarker from the selected token.</blockquote>
+
 
+
'''!clearmark @{selected|token_id}'''
+
<blockquote>This will remove all markers from the selected token.</blockquote>
+

Revision as of 22:16, 24 July 2014

{{#invoke:Navbar|error|Foo}}