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

How do you store a roll into a variable?

1522648763

Edited 1522650636
MyRoll20Stuffs
API Scripter
Is it possible to store a roll into a variable? I have this /emas @{selected|token_name} rolls for Initiative /roll 1d20+@{selected|init} &{tracker} And I want the roll saved in a variable and then set bar 3 as that variable EDIT: Is there a command to order turn order by highest initiative?
1522651681

Edited 1522651940
vÍnce
Pro
Sheet Author
Macros cannot write to attributes. ;-( I think you could use the  tokenmod  script (Pro perk) /emas @{selected|token_name} rolls for Initiative !token-mod --set bar3|[[1d20+@{selected|init} &{tracker}]] edit: Again, I think you will need to use a script to auto-sort turn order.  I believe  GroupInit  has the option.  yep... Update v0.8.4 - Added Auto Sorting (Ascending,Descending, or None), Setting the Die Size to roll, and Popping up the TurnOrder on Group Init roll.
1522652016

Edited 1522652436
MyRoll20Stuffs
API Scripter
This is my current macro: &{template:default} {{name=Initiative}} {{@{selected|character_name} rolls for Initiative}} {{ Base Initiative: @{selected|bar3}}} {{Final Initative: [[1d20+@{selected|init} &{tracker}]]}} How would I incorporate !token-mod into it I'm having trouble with that. Also where can I find a list of templates so I don't have to only use the default? EDIT: I'm using Pathfinder Community character sheets doesn't this come with some pre-made templates?
1522652888

Edited 1522653003
vÍnce
Pro
Sheet Author
Sorry, I thought you wanted the total rolled shown on bar3.. If you only want your init value seen on bar 3 just include the api command one line above your roll template line all within the same macro. !token-mod --set {{ bar3|@{selected|init} }} &{template:default} {{name=Initiative}} {{@{selected|character_name} rolls for Initiative}} {{ Base Initiative: @{selected|bar3}}} {{Final Initative: [[1d20+@{selected|init} &{tracker}]]}} Besides the default, you can only use the roll templates that come with the sheet.  Yes, the community sheet has multiple roll templates.  Check wiki.  link in footer of the sheet.
No you were right when you thought I wanted total rolled on bar3 that's what I want I just didn't know how to incorporate  !token-mod --set bar3|[[1d20+@{selected|init} &{tracker}]] into my macro its just showing the text "!token-mod --set bar3" instead of running the command.
1522653630

Edited 1522654066
vÍnce
Pro
Sheet Author
Tokenmod does that sometimes.  You can include the tokenmod commands wrapped in {{  }} to help with that. try this then; !token-mod {{ --set bar3|[[1d20+@{selected|init} &{tracker}]] }} &{template:default} {{name=Initiative}} {{@{selected|character_name} rolls for Initiative}} {{ Final Initiative:= @{selected|bar3} }} BTW; we've included nearly every roll you would ever need on the community sheet.  You can drag/drop sheet rolls/macros to the macro quickbar (enable from the sidebar|collection|view quickbar) then you can rename and colorize them.  We have also included chat menu buttons so you can make rolls directly from chat.  See the Buttons row just under Conditions and Buffs.  You can drag/drop those button as well.  ;-) BTW Part deux; Install the  Pathfinder Companion Script .  It can handle automatically adding the most needed chat menu buttons as token ability macros (top of the vtt), ammo/resource tracking, buff/status markers, text-based srd stat-block import, and more.