Assert function triggered off of getToken().

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
zylosan
Giant
Posts: 102
Joined: Sun Jun 28, 2009 11:08 pm

Assert function triggered off of getToken().

Post by zylosan »

I am attempting to setup an assert() flag that will end the macro if the getToken() function does not return any valid targets. Problem is I am not sure what exactly getToken returns when it fails to retrieve any token ids. The output displays [] if I do a direct print of the variable and does not regester to json.isEmpty()as being a valid comparison.

Code: Select all

[h: loc.RangeSet = json.set("{}", "from", 2, "upto", 2, "distancePerCell", 0)]

[h: loc.conditions = json.set("{}", "unsetStates", "['Dead']", "visible", 1, "range", loc.RangeSet, "npc", 1)]

[h: startList = getTokens("json", loc.conditions)]

[r, if(startList == "[]"): "No valid targets in range."]

zylosan
Giant
Posts: 102
Joined: Sun Jun 28, 2009 11:08 pm

Re: Assert function triggered off of getToken().

Post by zylosan »

I have figured out what was wrong. No need for an answer.

User avatar
mfrizzell
Dragon
Posts: 762
Joined: Sat Feb 13, 2010 2:35 am
Location: California

Re: Assert function triggered off of getToken().

Post by mfrizzell »

So what was wrong?
DCI/RPGA# 7208328396 Skype ID mfrizzell77
Characters:
Strabor - Dwarf Avenger 5th Level
Tikkanan - Human Warlock 2nd Level
----------------------------------------------------
"People are more violently opposed to fur than leather because it's safer to harass rich women than motorcycle gangs."

Post Reply

Return to “Macros”