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] Random Turn Order

November 02 (11 years ago)

Edited November 02 (11 years ago)
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.

https://gist.github.com/GrahamBrand/7283046/cc8b41883317d2778ea53e2bbaa273247205f539

November 03 (11 years ago)
Cool Spyke!
November 03 (11 years ago)
Spyke
KS Backer
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!