aptmac / roll20-to-talespire

TaleSpire companion applicaton (Chrome Extension), to send rolls from a Roll20 character sheet into your TaleSpire dice tray.
https://chromewebstore.google.com/detail/roll20-to-talespire/ablkndimkaicojanolhcmdknlpmdnkee
MIT License
0 stars 0 forks source link

Roll fails to send if there are more than 1 type of dice used #2

Closed aptmac closed 4 weeks ago

aptmac commented 4 weeks ago

The content script works by scraping the Roll20 character sheet and preparing a string to send over to TaleSpire via the url relay. TaleSpire takes care of the actual dice, the only thing it needs is a string that can be decoded by the app.

At the moment, the content script is failing with rolls that use more than 1 type of dice, because the roll 20 interface adds spaces inbetween the dice which causes the dice roll string to contain encoded string values %20 that correspond to the space.

For example, if my Attacks & Spellcasting section contains a 1d12+3+1d4, the roll20 interface formats this as 1d12+3 + 1d4, which gets passed into TaleSpire as 1d12+3%20%20+%201d4, which is unparse-able by the game.

The quickest solution here is to just trim all extra white space when sending over the roll.

aptmac commented 4 weeks ago

Closed with: https://github.com/aptmac/roll20-to-talespire/pull/3