Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

[PF] Getting a macro to work

I'm trying to set up a drop down menu for Skills, but i keep getting TypeError: Cannot read property 'substring' of undefined. Any help on this would be incredible! Coding below: &{template:pf_generic} {{name=?{Skill Grouping | Athletics, @{selected|token_name} Athletics Check}} {{[[1d20 + @{ACROBATICS} ]] Jump=Acro [[1d20 + @{ACROBATICS} ]] }} {{[[1d20 + @{CLIMB} ]] Climb=Swim [[1d20 + @{SWIM} ]]}} {{[[ 1d20 + @{RIDE} ]] Ride=Fly [[1d20 + @{FLY}]] | Conversation/Interaction, @{selected|token_name} Conversations}} {{[[1d20cs0cf0 + @{INTIMIDATE} ]] Intim=Diplo [[1d20cs0cf0 + @{DIPLOMACY} ]]}} {{[[1d20cs0cf0 + @{SENSE-MOTIVE} ]] Sense=Bluff [[1d20cs0cf0 + @{BLUFF} ]]}} {{ [[ (1d20cs0cf0+@{handle-animal}) * ceil(@{handle-animal-ranks}/100)]] Handle Animal = Performance[[1d20cs0cf0 + @{perform}]] | Knowledge, @{selected|token_name} Knowledges}} {{[[(1d20 + @{Knowledge-Arcana}) * ceil(@{Knowledge-Arcana-ranks}/100) ]]Arcana=Nature[[(1d20 + @{Knowledge-Nature}) * ceil(@{Knowledge-Nature-ranks}/100) ]] }} {{[[(1d20 + @{Knowledge-Planes}) * ceil(@{Knowledge-Planes-ranks}/100) ]]Planes=Religion[[(1d20 + @{Knowledge-Religion}) * ceil(@{Knowledge-Religion-ranks}/100) ]]}} {{[[(1d20 + @{Knowledge-dungeoneering}) * ceil(@{Knowledge-dungeoneering-ranks}/100) ]]Dungeon=Geography[[(1d20 + @{Knowledge-Geography}) * ceil(@{Knowledge-Geography-ranks}/100) ]]}} {{[[1d20 + @{Appraise}]]Appraise=Engineer[[(1d20 + @{Knowledge-Engineering}) * ceil(@{Knowledge-engineering-ranks}/100) ]]}} {{[[(1d20 + @{Knowledge-History}) * ceil(@{Knowledge-History-ranks}/100) ]]History=Linguistics[[(1d20 + @{Linguistics}) * ceil(@{Linguistics-ranks}/100) ]]}} {{[[(1d20 + @{Knowledge-Local}) * ceil(@{Knowledge-local-ranks}/100) ]]Local=Nobility[[(1d20 + @{Knowledge-Nobility}) * ceil(@{Knowledge-Nobility-ranks}/100) ]]}} {{[[1d20cs0cf0+@{Heal}]] Heal = Craft[[1d20cf0cs0+@{craft}]] | Senses, @{selected|token_name} Senses}} {{ [[1d20cs0cf0 + @{PERCEPTION} ]]Perception = Survival[[1d20cs0cf0+@{Survival}]] }} {{ [[ (1d20cs0cf0+@{spellcraft}) * ceil(@{spellcraft-ranks}/100) ]]SpellCraft = | Skullduggery, @{selected|token_name} Skullduggery}} {{[[1d20cs0cf0 + @{Stealth} ]] Stealth= Disguise [[1d20cs0cf0 + @{Disguise} ]]}} {{ [[1d20cs0cf0 + @{Escape-Artist}]] Escape = Disable [[(1d20cs0cf0 + @{disable-device}) * ceil(@{disable-device-ranks}/100) ]]}} {{[[ (1d20cs0cf0 + @{sleight-of-hand}) * ceil(@{sleight-of-hand-ranks}/100) ]]Sleight= | UMD, @{selected|token_name} UMD Check: [[ (1d20 + @{Use-Magic-Device}) * ceil(@{Use-Magic-Device-Ranks}/100) ]] }} {{25 =Activate Blindly}}{{25 + Sp Lvl=Decipher Scroll}}{{20 + caster level=Use Scroll}}{{20=Use wand / Emulate class}}{{25=Emulate Race}}{{30=Emulate Align } }}
1474946448

Edited 1474946493
Try this out: &{template:pf_generic} {{name=@{selected|token_name} ?{Skill Grouping| Athletics, Athletics Check}} {{ [[ 1d20 + @{ACROBATICS} ]] Jump = Acro [[ 1d20 + @{ACROBATICS} ]] }} {{ [[ 1d20 + @{CLIMB} ]] Climb = Swim [[ 1d20 + @{SWIM} ]] }} {{ [[ 1d20 + @{RIDE} ]] Ride = Fly [[ 1d20 + @{FLY} ]] | Conversation/Interaction, Conversations}} {{ [[ 1d20cs0cf0 + @{INTIMIDATE} ]] Intim = Diplo [[ 1d20cs0cf0 + @{DIPLOMACY} ]] }} {{ [[ 1d20cs0cf0 + @{SENSE-MOTIVE} ]] Sense = Bluff [[ 1d20cs0cf0 + @{BLUFF} ]] }} {{ [[ (1d20cs0cf0+@{handle-animal}) * ceil(@{handle-animal-ranks}/100) ]] Handle Animal = Performance [[ 1d20cs0cf0 + @{perform} ]] | Knowledge, Knowledges}} {{ [[ (1d20 + @{Knowledge-Arcana}) * ceil(@{Knowledge-Arcana-ranks}/100) ]] Arcana = Nature [[ (1d20 + @{Knowledge-Nature}) * ceil(@{Knowledge-Nature-ranks}/100) ]] }} {{ [[ (1d20 + @{Knowledge-Planes}) * ceil(@{Knowledge-Planes-ranks}/100) ]] Planes = Religion [[ (1d20 + @{Knowledge-Religion}) * ceil(@{Knowledge-Religion-ranks}/100) ]] }} {{ [[ (1d20 + @{Knowledge-dungeoneering}) * ceil(@{Knowledge-dungeoneering-ranks}/100) ]] Dungeon = Geography [[ (1d20 + @{Knowledge-Geography}) * ceil(@{Knowledge-Geography-ranks}/100) ]] }} {{ [[ 1d20 + @{Appraise} ]] Appraise = Engineer [[ (1d20 + @{Knowledge-Engineering}) * ceil(@{Knowledge-engineering-ranks}/100) ]] }} {{ [[ (1d20 + @{Knowledge-History}) * ceil(@{Knowledge-History-ranks}/100) ]] History = Linguistics [[ (1d20 + @{Linguistics}) * ceil(@{Linguistics-ranks}/100) ]] }} {{ [[ (1d20 + @{Knowledge-Local}) * ceil(@{Knowledge-local-ranks}/100) ]] Local = Nobility [[ (1d20 + @{Knowledge-Nobility}) * ceil(@{Knowledge-Nobility-ranks}/100) ]] }} {{ [[ 1d20cs0cf0+@{Heal} ]] Heal = Craft [[ 1d20cf0cs0+@{craft} ]] | Senses, Senses}} {{ [[ 1d20cs0cf0 + @{PERCEPTION} ]] Perception = Survival [[ 1d20cs0cf0+@{Survival} ]] }} {{ [[ (1d20cs0cf0+@{spellcraft}) * ceil(@{spellcraft-ranks}/100) ]] SpellCraft = | Skullduggery, Skullduggery}} {{ [[ 1d20cs0cf0 + @{Stealth} ]] Stealth = Disguise [[ 1d20cs0cf0 + @{Disguise} ]] }} {{ [[ 1d20cs0cf0 + @{Escape-Artist} ]] Escape = Disable [[ (1d20cs0cf0 + @{disable-device}) * ceil(@{disable-device-ranks}/100) ]] }} {{ [[ (1d20cs0cf0 + @{sleight-of-hand}) * ceil(@{sleight-of-hand-ranks}/100) ]] Sleight = | UMD, UMD Check: [[ (1d20 + @{Use-Magic-Device}) * ceil(@{Use-Magic-Device-Ranks}/100) ]] }} {{25 = Activate Blindly}} {{25 + Sp Lvl = Decipher Scroll}} {{20 + caster level = Use Scroll}} {{20 = Use wand / Emulate class}} {{25 = Emulate Race}} {{30 = Emulate Align } }} The HTML entities replacing the } characters are required for reasons outlined in Advanced Usage for Roll Queries .
Sadly, no. I still get "TypeError: Cannot read property 'substring' of undefined"
1474946923

Edited 1474947135
vÍnce
Pro
Sheet Author
Is this Mark's&nbsp; Skill Checks(Alternate) macro from the wiki? ( <a href="https://wiki.roll20.net/Macros/Pathfinder_Examples#PATHFINDER_SHEET_TEMPLATES_USING_SHEET_VALUES" rel="nofollow">https://wiki.roll20.net/Macros/Pathfinder_Examples#PATHFINDER_SHEET_TEMPLATES_USING_SHEET_VALUES</a> ) Make sure you copy and paste the macro as-is into your macro and do not edit it. &nbsp;The wiki includes the code subsitution for special characters. &nbsp;Once you re-open the macro to edit, the special characters become "resolved" and the query will fail after that. &nbsp;I'm not sure if that's your particular issue, but it's my guess. EDIT: oops, should have refreshed...
Oh, hah, so it is. It's a nice macro!
1474947104

Edited 1474947116
vÍnce
Pro
Sheet Author
Just tested copy/paste from wiki, works great. &nbsp;Just don't edit it. &nbsp;;-)
1474947119

Edited 1474947243
It is, and I did copy/paste, but I still get that same error message. I'm not quite sure why, and to my knowledge, I am supposed to have a token selected, but I do not understand why it's not running the macro. EDIT: Just tried again, and still does not function. Do you just paste it into the chat area, or can we make a macro button to run it?
1474947420
vÍnce
Pro
Sheet Author
I pasted it into an ability macro. The you can choose to add to the macro quick bar and/or a token action
1474947542
vÍnce
Pro
Sheet Author
Maybe i'm not doing something right then. An ability macro? I just go to the options for macros, click Add, paste in the info, name the macro, save it, and when i click on my token, and click the macro, the above error is what i get.&nbsp;
Does there have to be permissions to run particular macro's allowed by the GM, or is there a specific character sheet that should be used for this macro? To my knowledge, we're using the regular pathfinder sheets.
1474947656
vÍnce
Pro
Sheet Author
What is the character's name by chance?
1474947731
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
are you copying this into a global macro (under the collections tab) and then reopening it? The global macros parse the html entities when they are reopened which would cause your error. Try putting it into a character's ability and try it from there.
Stryk3r said: An ability macro? I just go to the options for macros Attribute calls (e.g. @{AC}) that are not placed within one of tabs of a Character Window (e.g. within a field on the Character Sheet Tab or within an Ability on the Attributes & Abilities Tab ) must use a keyword to let the parser know which Character you intend to call that Attribute from (e.g. @{selected|AC}). Using a Selected Token with a Macro Using a Targeted Token with a Macro That said, since you're not placing this macro within one of tabs of a Character Window (and thus must use a keyword ), I recommend using the &lt;character name&gt; keyword. i.e. &amp;{template:pf_generic} {{name=@{selected|token_name} ?{Skill Grouping| Athletics, Athletics Check&amp;#125;&amp;#125; {{ [[ 1d20 + @{ Stryk3r |ACROBATICS} ]] Jump = Acro [[ 1d20 + @{Stryk3r|ACROBATICS} ]] &amp;#125;&amp;#125; {{ [[ 1d20 + @{Stryk3r|CLIMB} ]] Climb = Swim [[ 1d20 + @{Stryk3r|SWIM} ]] &amp;#125;&amp;#125; {{ [[ 1d20 + @{Stryk3r|RIDE} ]] Ride = Fly [[ 1d20 + @{Stryk3r|FLY} ]] | Conversation/Interaction, Conversations&amp;#125;&amp;#125; {{ [[ 1d20cs0cf0 + @{Stryk3r|INTIMIDATE} ]] Intim = Diplo [[ 1d20cs0cf0 + @{Stryk3r|DIPLOMACY} ]] &amp;#125;&amp;#125; {{ [[ 1d20cs0cf0 + @{Stryk3r|SENSE-MOTIVE} ]] Sense = Bluff [[ 1d20cs0cf0 + @{Stryk3r|BLUFF} ]] &amp;#125;&amp;#125; {{ [[ (1d20cs0cf0+@{Stryk3r|handle-animal}) * ceil(@{Stryk3r|handle-animal-ranks}/100) ]] Handle Animal = Performance [[ 1d20cs0cf0 + @{Stryk3r|perform} ]] | Knowledge, Knowledges&amp;#125;&amp;#125; {{ [[ (1d20 + @{Stryk3r|Knowledge-Arcana}) * ceil(@{Stryk3r|Knowledge-Arcana-ranks}/100) ]] Arcana = Nature [[ (1d20 + @{Stryk3r|Knowledge-Nature}) * ceil(@{Stryk3r|Knowledge-Nature-ranks}/100) ]] &amp;#125;&amp;#125; {{ [[ (1d20 + @{Stryk3r|Knowledge-Planes}) * ceil(@{Stryk3r|Knowledge-Planes-ranks}/100) ]] Planes = Religion [[ (1d20 + @{Stryk3r|Knowledge-Religion}) * ceil(@{Stryk3r|Knowledge-Religion-ranks}/100) ]] &amp;#125;&amp;#125; {{ [[ (1d20 + @{Stryk3r|Knowledge-dungeoneering}) * ceil(@{Stryk3r|Knowledge-dungeoneering-ranks}/100) ]] Dungeon = Geography [[ (1d20 + @{Stryk3r|Knowledge-Geography}) * ceil(@{Stryk3r|Knowledge-Geography-ranks}/100) ]] &amp;#125;&amp;#125; {{ [[ 1d20 + @{Stryk3r|Appraise} ]] Appraise = Engineer [[ (1d20 + @{Stryk3r|Knowledge-Engineering}) * ceil(@{Stryk3r|Knowledge-engineering-ranks}/100) ]] &amp;#125;&amp;#125; {{ [[ (1d20 + @{Stryk3r|Knowledge-History}) * ceil(@{Stryk3r|Knowledge-History-ranks}/100) ]] History = Linguistics [[ (1d20 + @{Stryk3r|Linguistics}) * ceil(@{Stryk3r|Linguistics-ranks}/100) ]] &amp;#125;&amp;#125; {{ [[ (1d20 + @{Stryk3r|Knowledge-Local}) * ceil(@{Stryk3r|Knowledge-local-ranks}/100) ]] Local = Nobility [[ (1d20 + @{Stryk3r|Knowledge-Nobility}) * ceil(@{Stryk3r|Knowledge-Nobility-ranks}/100) ]] &amp;#125;&amp;#125; {{ [[ 1d20cs0cf0+@{Stryk3r|Heal} ]] Heal = Craft [[ 1d20cf0cs0+@{Stryk3r|craft} ]] | Senses, Senses&amp;#125;&amp;#125; {{ [[ 1d20cs0cf0 + @{Stryk3r|PERCEPTION} ]] Perception = Survival [[ 1d20cs0cf0+@{Stryk3r|Survival} ]] &amp;#125;&amp;#125; {{ [[ (1d20cs0cf0+@{Stryk3r|spellcraft}) * ceil(@{Stryk3r|spellcraft-ranks}/100) ]] SpellCraft = | Skullduggery, Skullduggery&amp;#125;&amp;#125; {{ [[ 1d20cs0cf0 + @{Stryk3r|Stealth} ]] Stealth = Disguise [[ 1d20cs0cf0 + @{Stryk3r|Disguise} ]] &amp;#125;&amp;#125; {{ [[ 1d20cs0cf0 + @{Stryk3r|Escape-Artist} ]] Escape = Disable [[ (1d20cs0cf0 + @{Stryk3r|disable-device}) * ceil(@{Stryk3r|disable-device-ranks}/100) ]] &amp;#125;&amp;#125; {{ [[ (1d20cs0cf0 + @{Stryk3r|sleight-of-hand}) * ceil(@{Stryk3r|sleight-of-hand-ranks}/100) ]] Sleight = | UMD, UMD Check: [[ (1d20 + @{Stryk3r|Use-Magic-Device}) * ceil(@{Stryk3r|Use-Magic-Device-Ranks}/100) ]] &amp;#125;&amp;#125; {{25 = Activate Blindly&amp;#125;&amp;#125; {{25 + Sp Lvl = Decipher Scroll&amp;#125;&amp;#125; {{20 + caster level = Use Scroll&amp;#125;&amp;#125; {{20 = Use wand / Emulate class&amp;#125;&amp;#125; {{25 = Emulate Race&amp;#125;&amp;#125; {{30 = Emulate Align } }} Scott also makes a good point about re-opening Settings Macros with HTML entities inside, which is also mentioned within Advanced Usage for Roll Queries .
OHHHHHHHHHHHHHHHHHHHHH...i figured it out. My apologies everyone. Now I feel incredibly stupid as hell. -sighs- Trying that when looking for "Abilities Macro" pretty much helped me figure that one out. Thank you for your help guys!
1474948019
vÍnce
Pro
Sheet Author
No worries ;-)
Still fairly new to using most of the stuff here, so when going through the macros and trying to use them to make it easier to use stuff, trying to set this up was giving me a headache, and I couldn't figure it out.