[h,if(hasMacro("Temp_Data")==1),CODE:
{[h,MACRO("Temp_Data@TOKEN"):""]
[h:default=macro.return]
};
{[h:default=json.set("{}","temp_AB",0,"temp_damage",0,"temp_skill",0,"temp_fort",0,"temp_refl",0,"temp_will",0)]
}]
[h:default_AC=AC]
[h:status=input("temp_AB|"+json.get(default,"temp_AB")+"|Attack Bonus|TEXT",
"temp_damage|"+json.get(default,"temp_damage")+"|Damage|TEXT",
"temp_AC|"+default_AC+"|Armour Class|TEXT",
"temp_skill|"+json.get(default,"temp_skill")+"|Bonus to skills|TEXT",
"temp_fort|"+json.get(default,"temp_fort")+"|Fortitude Saves|TEXT",
"temp_refl|"+json.get(default,"temp_refl")+"|Reflex Saves|TEXT",
"temp_will|"+json.get(default,"temp_will")+"|Will Saves|TEXT")]
[h:abort(status)]
[h:macro_text=decode("[h:macro.return=json.set(%22{}%22,%22temp_AB%22,"+temp_AB+",%22temp_damage%22,"+temp_damage+",%22temp_skill%22,"+temp_skill+",%22temp_fort%22,"+temp_fort+",%22temp_refl%22,"+temp_refl+",%22temp_will%22,"+temp_will+")]")]
[h,if(hasMacro("Temp_Data")==1),FOREACH(macro_index,getMacroIndexes("Temp_Data")):removeMacro(macro_index)]
[h:AC=temp_AC]
[h:createMacro("Temp_Data",macro_text,"group=Under")]
To function it requires: Edit macro -> options -> remove tick from 'Allow Players to Edit Macro'
Only a registered D.M. can perform the above step.
Text strings can be entered, this is bad.
[code][h,if(hasMacro("Temp_Data")==1),CODE:
{[h,MACRO("Temp_Data@TOKEN"):""]
[h:ABFromSpells=json.get(macro.return,"temp_AB")]
[h:DamageFromSmells=json.get(macro.return,"temp_damage")]
};
{[h:ABFromSpells=0]
[h:DamageFromSmells=0]
}]
Attacking [r:Victim], attack: [t:1d20+8+ABFromSpells]; Damage: [1d6+0+DamageFromSmells]