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 .
×
Create a free account

help with api command button

The problem code is [button](! #ini +6) I want to call the #ini macro from my collection, but when I add the +6 modifier, it just show +6 after the result, instead of adding it. My #ini macro is [[1d20 &{tracker]] Is it at all possible to send a modifier to the d20 roll, to be added before the token is added to the turn tracker? I want to avoid using roll query, and avoid having the (+6) ini-modifier as an attribute. Basicly I want to send a pre-determined value to be used in my macro.
1510603764
The Aaron
Pro
API Scripter
try [button](!
#ini +6)
1510604307
Silvyre
Forum Champion
Anders said: My #ini macro is [[1d20 &{tracker]] Rewrite #ini as /r 1d20 &{tracker} Then, [button](! 
#ini +6) will work Alternatively, rewrite #ini as [[ 1d20 + (?{Modifier|0}) &{tracker} ]] and then use [button](! 
#ini)
1510604830

Edited 1510604862
The Aaron said: try [button](! #ini +6) yes, i did that in the first place, just forgot to add the substitute characters to my post. Should have taken more time to write it up. sorry. Silvyre said: Anders said: My #ini macro is [[1d20 &{tracker]] Rewrite #ini as /r 1d20 &{tracker} Then, [button](! #ini +6) will work Alternatively, rewrite #ini as [[ 1d20 + (?{Modifier|0}) &{tracker} ]] and then use [button](! #ini) This helped a lot. I now use the first option in order to avoid the query. So it seems that the /r and the [[]] does not work the same. Is that because the [[]] is resolved first, activating the tracker before the modifier can be added?
1510606280
Silvyre
Forum Champion
Anders said: So it seems that the /r and the [[]] does not work the same. Is that because the [[]] is resolved first, activating the tracker before the modifier can be added? Yes.
1510607359

Edited 1510607440
With your help I got it to work. Here is my "completed" work, making statblock transformation somewhat fast, without using pre-made sheets. cant seem to get the replacement code to remain when i complete my posts however. {{ **Goblin** XP 135 Male goblin warrior 1 (Pathfinder RPG Bestiary 156) NE Small humanoid (goblinoid) [Init +6](! #ini); Senses darkvision 60 ft.; Perception [[1d20-1]] -------------------- Defense -------------------- AC 15, touch 13, flat-footed 13 (+2 armor, +2 Dex, +1 size) hp 6 (1d10+1) Fort [[1d20+3]], Ref [[1d20+2]], Will [[1d20-1]] -------------------- Offense -------------------- Speed 30 ft. Melee short sword [[1d20cs19+2]] ([[1d4]]/x2) or spear [[1d20+2]] ([[1d6]]/×3) Ranged shortbow [[1d20+4]] ([[1d4]]/×3) -------------------- Statistics -------------------- Str 11, Dex 15, Con 12, Int 10, Wis 9, Cha 6 Base Atk +1; CMB +0; CMD 12 Feats Improved Initiative Skills Ride [[1d20+10]], Stealth [[1d20+14]], Swim [[1d20+4]]; Racial Modifiers +4 Ride, +4 Stealth Languages Goblin Other Gear leather armor, light wooden shield, arrows (20), short sword, shortbow, spear -------------------- Ecology -------------------- Environment temperate forest and plains (usually coastal regions) Organization gang (4-9), warband (10-16 with goblin dog mounts), or tribe (17+ plus 100% noncombatants; 1 sergeant of 3rd level per 20 adults; 1 or 2 lieutenants of 4th or 5th level; 1 leader of 6th-8th level; and 10-40 goblin dogs, wolves, or worgs) Treasure npc gear (leather armor, light wooden shield, short sword, short bow with 20 arrows, other treasure) -------------------- Special Abilities -------------------- Darkvision (60 feet) You can see in the dark (black and white only). }}