|
|
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> → !mark <code>parameters</code><br>
| + | |
− | <code>S</code> → !unmark <code>parameters</code><br>
| + | |
− | <code>S</code> → !clearmark <code>tokenid</code><br>
| + | |
− | <code>parameters</code> → <code>tokenid</code><br>
| + | |
− | <code>parameters</code> → <code>tokenid</code> <code>status</code> <code>type</code><br>
| + | |
− | <code>tokenid</code> → ''string''<br>
| + | |
− | <code>status</code> → <code>condition</code><br>
| + | |
− | <code>status</code> → <code>marker</code><br>
| + | |
− | <code>condition</code> → ''string''<br>
| + | |
− | <code>marker</code> → ''string''<br>
| + | |
− | <code>type</code> → ''string''<br>
| + | |
− | <code>type</code> → ε</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>
| + | |