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

Ways to automate dice rolls from a non-roll20 source?

I am running a rather custom system/game which currently utilizes Google Sheets for character sheets. One of the key sources of player UX friction is the need to calculate the die roll modifiers on one browser tab, then click into the active Roll20 instance on another, input a modifier, then click a macro button to roll the dice. I know that creating new character sheets within Roll20 would solve for a lot of this, but designing completely custom sheets within roll20 just isn't practical given my time and skillset. Q: Can roll20 accept an external source (another tab within the same browser), pushing a die roll information (via API, script, however) to an active roll20 browser tab? Alternatively, is there some other suggestion to automate further, within the use case I've mentioned above?
1670320566
GiGs
Pro
Sheet Author
API Scripter
Unfortunately roll20 cannot accept input from an external source (and other tabs in the same browser window are external sources). In fact, it is expressly designed to block that. The only way to do this would be to build a browser extension. The best way would be to move whatever automation you have to be internal to roll20 - use a roll20 character sheet, or roll20 macros without a character sheet. If your character sheet is very complex, that would be very hard unfortunately.
1670321244

Edited 1670321301
Gauss
Forum Champion
If you show the type of calculations you need I bet we can automate it without needing a character sheet.  We can use Attributes (via the Attributes & Abilities tab) to represent your statistics that are on a sheet.  How this would look:  You would continue to use your Google Sheets character sheets Characters in the game would have the Attributes from relevant things on the Google Sheets filled out (manually) Then we would build Ability Macros to use those Attributes to auto-calc the rolls rather than using Queries.  A Macro Mule would save a lot of the effort on the macros being duplicated for each character.
1670365163

Edited 1670365230
Oosh
Sheet Author
API Scripter
As GiGs said above, the only way to build a good solution is with access to the browser's background context (monkeyscript or extension). An excellent solution would be an extensible browser extension which can have a simple plugin written for any external source to send rolls to Roll20. Writing that piece of software is significantly more challenging than a character sheet (not as time-consuming as a complex and highly polished sheet, but I'll blame Roll20's restricted environment for that, not the complexity of the task itself). The only easy, hacky way I can think of is to put some buttons on your google sheet, attach some code to them that sends a value (or calculated value) straight to system clipboard. You can then ctrl-tab switch to your Roll20 tab and ctrl-v paste the clipboard contents. I've not tried to code anything in google sheets, but presumably you have access to navigator.clipboard.
1670368344

Edited 1670368418
GiGs
Pro
Sheet Author
API Scripter
Oosh said: The only easy, hacky way I can think of is to put some buttons on your google sheet, attach some code to them that sends a value (or calculated value) straight to system clipboard. You can then ctrl-tab switch to your Roll20 tab and ctrl-v paste the clipboard contents. I've not tried to code anything in google sheets, but presumably you have access to navigator.clipboard. Thats a pretty clever solution. I expect google sheets does have access to the clipboard, but even if not,v you could paste the output to a specific cell, then copy that cell and paste it into roll20. That much I know you can do.
GiGs said: Oosh said: The only easy, hacky way I can think of is to put some buttons on your google sheet, attach some code to them that sends a value (or calculated value) straight to system clipboard. You can then ctrl-tab switch to your Roll20 tab and ctrl-v paste the clipboard contents. I've not tried to code anything in google sheets, but presumably you have access to navigator.clipboard. Thats a pretty clever solution. I expect google sheets does have access to the clipboard, but even if not,v you could paste the output to a specific cell, then copy that cell and paste it into roll20. That much I know you can do. That is a solid idea. I will look into it. Thank you!