User:Verisimilar/Sandbox

From RPTools Wiki
Revision as of 17:00, 13 March 2023 by Taustin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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]