User:Verisimilar/Sandbox: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
mNo edit summary
(CategoryTree examples)
Line 1: Line 1:
__NOTOC__
==#CategoryTree:MapTool|mode=pages==
{{#categorytree:MapTool|mode=pages}}
==#CategoryTree:MapTool|mode=categories==
{{#categorytree:MapTool|mode=categories}}
==prop macros==
<source lang="mtmacro" line>
<source lang="mtmacro" line>
@onCampaignLoad
@onCampaignLoad

Revision as of 19:13, 29 March 2009

#CategoryTree:MapTool|mode=pages

#CategoryTree:MapTool|mode=categories






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]