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 .
×

The new D&D 2024 sheet is now available!

Create a free account

[Script] Random Turn Order

1383424090

Edited 1383427050
Spyke
KS Backer
Here's a script that sorts all entries on the Turn Tracker into a random order on the command !neworder. It can be used for any game that chooses initiative or turn order randomly. You can embed it into a macro, say for Hillfolk, as follows: /em sets a new precedence order !neworder This is my first script and foray into javascript, so any advice would be very welcome. <a href="https://gist.github.com/GrahamBrand/7283046/cc8b41883317d2778ea53e2bbaa273247205f539" rel="nofollow">https://gist.github.com/GrahamBrand/7283046/cc8b41883317d2778ea53e2bbaa273247205f539</a>
Cool Spyke!
Thanks. I hasten to add that I lifted the code for the shuffle routine from a javascript tutorial, and the turnorder part from Riley's wiki entry, so my input here was largely sticking them together and getting the brackets right... but it's a start!