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
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
The following script creates the API commands <code>!mark</code>, <code>!unmark</code>, and <code>!clearmark</code>
+
{{syntaxbox top|formal=true|nocat=true}}
 
+
{{API command|power}} [''--{{API parameter|name=tag}}|{{API parameter|name=content}} [--{{API parameter|name=tag}}|{{API parameter|name=content}} [...]]'']
==== Syntax ====
+
{{Formal API command|
<blockquote style="border:1px #0088ee solid;background:#eee;padding:0.5em">!mark ''tokenid'' [''status'' [''type'']]<br>
+
{{token|S}} {{rarr}} {{API command|power|nocat=true}} {{token|tag-list|-}}
!unmark ''tokenid'' [''status'' [''type'']]<br>
+
{{token|tag-list}} {{rarr}} {{epsilon}}
!clearmark ''tokenid''</blockquote>
+
{{token|tag-list}} {{rarr}} {{token|tag}} {{token|tag-list|-}}
 
+
{{token|tag}} {{rarr}} --{{token|tag-name}}{{token|tag-indent}}{{!}}{{token|tag-content|-}}
===== Regular Grammar Syntax =====
+
{{token|tag-name}} {{rarr}} emote {{token||-|-}}
<blockquote style="border:1px #0088ee solid;background:#eee;padding:0.5em"><code>S</code> &rarr; !mark <code>parameters</code><br>
+
{{token|tag-name}} {{rarr}} name {{token||-|-}}
<code>S</code> &rarr; !unmark <code>parameters</code><br>
+
{{token|tag-name}} {{rarr}} usage {{token||-|-}}
<code>S</code> &rarr; !clearmark <code>tokenid</code><br>
+
{{token|tag-name}} {{rarr}} action {{token||-|-}}
<code>parameters</code> &rarr; <code>tokenid</code><br>
+
{{token|tag-name}} {{rarr}} attack{{token|count|-}}
<code>parameters</code> &rarr; <code>tokenid</code> <code>status</code> <code>type</code><br>
+
{{token|tag-name}} {{rarr}} defense {{token||-|-}}
<code>tokenid</code> &rarr; ''string''<br>
+
{{token|tag-name}} {{rarr}} damage{{token|count|-}}
<code>status</code> &rarr; <code>condition</code><br>
+
{{token|tag-name}} {{rarr}} txcolor {{token||-|-}}
<code>status</code> &rarr; <code>marker</code><br>
+
{{token|tag-name}} {{rarr}} bgcolor {{token||-|-}}
<code>condition</code> &rarr; ''string''<br>
+
{{token|tag-name}} {{rarr}} leftsub {{token||-|-}}
<code>marker</code> &rarr; ''string''<br>
+
{{token|tag-name}} {{rarr}} rightsub {{token||-|-}}
<code>type</code> &rarr; ''string''<br>
+
{{token|tag-name}} {{rarr}} ddn {{token||-|-}}
<code>type</code> &rarr; &epsilon;</blockquote>
+
{{token|tag-name}} {{rarr}} desc {{token||-|-}}
 
+
{{token|tag-name}} {{rarr}} crit {{token||-|-}}
{| class="wikitable"
+
{{token|tag-name}} {{rarr}} lb {{token||-|-}}
|-
+
{{token|tag-name}} {{rarr}} format {{token||-|-}}
! Parameter
+
{{token|tag-name}} {{rarr}} title {{token||-|-}}
! Values
+
{{token|tag-name}} {{rarr}} multiroll{{token|count|-}}
|-
+
{{token|tag-name}} {{rarr}} whisper {{token||-|-}}
| ''tokenid''
+
{{token|tag-name}} {{rarr}} {{string|-}}
| 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.
+
{{token|tag-indent}} {{rarr}} {{epsilon}}
|-
+
{{token|tag-indent}} {{rarr}} ^{{token|count|-}}
| ''status''
+
{{token|tag-content}} {{rarr}} {{epsilon}}
| (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.
+
{{token|tag-content}} {{rarr}} {{string|-}}
 
+
{{token|count}} {{rarr}} {{epsilon}}
If ''status'' is not specified, the purple statusmarker will be used.
+
{{token|count}} {{rarr}} {{integer}}
|-
+
}}
| ''type''
+
{{syntaxbox end}}
| (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>
+

Latest revision as of 22:43, 8 January 2015

!power [--<tag>|<content> [--<tag>|<content> [...]]]
Formally:

S

→ !power tag-list


tag-list

→ ε

tag-list

tag
tag-list


tag

→ --tag-name

tag-indent

|tag-content


tag-name

→ emote 


tag-name

→ name 


tag-name

→ usage 


tag-name

→ action 


tag-name

→ attackcount


tag-name

→ defense 


tag-name

→ damagecount


tag-name

→ txcolor 


tag-name

→ bgcolor 


tag-name

→ leftsub 


tag-name

→ rightsub 


tag-name

→ ddn 


tag-name

→ desc 


tag-name

→ crit 


tag-name

→ lb 


tag-name

→ format 


tag-name

→ title 


tag-name

→ multirollcount


tag-name

→ whisper 


tag-name

string

tag-indent

→ ε

tag-indent

→ ^count


tag-content

→ ε

tag-content

string

count

→ ε

count

integer