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

[Script] Roll Repeater

1376747701

Edited 1376752912
Lithl
Pro
Sheet Author
API Scripter
For games where a macro containing a variable number of separate rolls are useful, I give you the roll repeater! Simply post a !rr message to the API containing an inline roll followed immediately by a number in brackets (eg: [[d20+8]]{3}). You may use queries (ex: [[d20+8]]{?{Targets}}). The script will post your message verbatim to the chat, save that your single inline roll has been repeated the desired number of times. If you have a macro, it is recommended that you post every line to the API, as the results can become unordered if only some are. (Although I have had multi-line macros become unordered even with every line as an API call, it's less common.) Example: !rr /me does a thingy! To lots of dudes! !rr [[d20+8]]{?{Targets}} vs AC !rr !rr Hit: [[d8+4]] fire damage. Output: Brian does a thingy! To lots of dudes! [14], [20], [9] vs AC Hit: [8] fire damage Edit: Changed !text to !rr text to help avoid collisions with other scripts. Edit: Fixed strange bug with the for-loop interacting with the msg.inlinerolls and multi-line macros. Problems: When posting as a character rather than as a player, the character's avatar does not show up. The background of any normal text is grey to the player posting it, rather than the normal blue. The background shows as grey to other players (as it should be), and other commands such as /me show up with their correct background. <a href="https://gist.github.com/Lithl/6256929" rel="nofollow">https://gist.github.com/Lithl/6256929</a>
&lt;3