This will toggle a mod set.aliasmask wrote:I wish there was an easily programmable way to call your code to activate/deactivate mod sets.
Code: Select all
[MACRO("subModToggle@Lib:libDnD35Pathfinder"): json.set( json.set( json.set( "{}", "tokenID", tToken ), "setID", tmID ), "setType", 0 ) ]
- tToken = Token ID of the token you want to toggle the mod-set on.
- setID = The "name" of the mod-set (for example: "Bulls Strength" ).
- setType = 0 for mod-set; 1 for item.
Code: Select all
[H: tModSet = "Bulls Strength" ]
[H: aTMS = json.get( PrivateJSON, "ActiveTempModSets" ) ]
[H, IF( json.type( aTMS ) == "UNKNOWN" ), CODE: {
[ PrivateJSON = json.set( PrivateJSON, "ActiveTempModSets", "[]" ) ]
[ aTMS = "[]" ]
}]
[H: msIsActive = if( json.contains( aTMS, tModSet ), 1, 0 ) ]