User:Verisimilar/Sandbox: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) (New page: =How To Use This Template= When creating a new page that displays information about a macro function, this template should be used for uniformity. What follows are instructions on how to ...) |
No edit summary |
||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
= | ==Highlight Test== | ||
<syntaxhighlight lang="mtmacro" highlight="5" line> | |||
Function outside of the brackets: | |||
defineFunction() | |||
< | |||
Function within square brackets: | |||
[assert()] | |||
= | Function within curly brackets: | ||
< | {abort(0)} | ||
Roll options: | |||
[h: abort(0)] | |||
</ | [t: abort(0)] | ||
= | [e,if(0): ] | ||
[macro(): ] | |||
[token(): ] | |||
Numbers: | |||
[h: 1 2 34 567 ] | |||
Symbols: | |||
[h: > = ! & / : ; ] | |||
Strings: | |||
[h: "This is a double quoted string" ] | |||
[h; "This is a single quoted string" ] | |||
</syntaxhighlight> | |||
==prop macros== | |||
<syntaxhighlight lang="mtmacro" line> | |||
@onCampaignLoad | |||
[defineFunction("get", "get@this")] | |||
@get | |||
[h: checkProp = json.contains(getPropertyNames('json'), arg(0))] | |||
[h,assert(checkProp, '<b>ERROR:</b> get("'+arg(0)+'") '+ | |||
'- That property does not exist.', 0)] | |||
[h, macro.return = getProperty(arg(0))] | |||
@onCampaignLoad | |||
[defineFunction("set", "set@this")] | |||
@set | |||
[h: checkProp = json.contains(getPropertyNames('json'), arg(0))] | |||
[h,assert(checkProp, '<b>ERROR:</b> set('+arg(0)+', '+arg(1)+') '+ | |||
'- That property does not exist.', 0)] | |||
[h: setProperty(arg(0), arg(1))] | |||
[h, macro.return = 1] | |||
</syntaxhighlight> |
Latest revision as of 17:00, 13 March 2023
Highlight Test
Function outside of the brackets:
defineFunction()
Function within square brackets:
[assert()]
Function within curly brackets:
{abort(0)}
Roll options:
[h: abort(0)]
[t: abort(0)]
[e,if(0): ]
[macro(): ]
[token(): ]
Numbers:
[h: 1 2 34 567 ]
Symbols:
[h: > = ! & / : ; ]
Strings:
[h: "This is a double quoted string" ]
[h; "This is a single quoted string" ]
prop macros
@onCampaignLoad
[defineFunction("get", "get@this")]
@get
[h: checkProp = json.contains(getPropertyNames('json'), arg(0))]
[h,assert(checkProp, '<b>ERROR:</b> get("'+arg(0)+'") '+
'- That property does not exist.', 0)]
[h, macro.return = getProperty(arg(0))]
@onCampaignLoad
[defineFunction("set", "set@this")]
@set
[h: checkProp = json.contains(getPropertyNames('json'), arg(0))]
[h,assert(checkProp, '<b>ERROR:</b> set('+arg(0)+', '+arg(1)+') '+
'- That property does not exist.', 0)]
[h: setProperty(arg(0), arg(1))]
[h, macro.return = 1]