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 Change Request: TrackerJacker] -10 from all initiatives in the tracker but one

1447857116

Edited 1447857244
I have found the TrackerJacker script and would like to use it and change it. The script can be found here:&nbsp; <a href="https://github.com/FGKenL/Roll20_API_Scripts/blob/" rel="nofollow">https://github.com/FGKenL/Roll20_API_Scripts/blob/</a>... In line 1300 I would like to add the functionality to subtract 10 from all initiatives but the one with initiative -100 (which the script uses as Round Marker). Could someone help me write it? The initial autor has left roll20 so I can't ask him.
1447857998
The Aaron
Pro
API Scripter
So,a re you saying you want to subtract 10 from the initiative order of anyone that has a turn? &nbsp;For example, my turn comes up at 20 and is immediately reduced to 10. &nbsp;The next time my turn comes up at 10 and is immediately reduced to 0?
1447858313

Edited 1447858400
Yes. But I did manage it on my own. Sorry I did ask in the first place. I did not expect to get a result so quickly (having never worked with Javascript or JSON before). Could likely lead to other problems or bugs as I have no clue how the turnorder really works. So what I did was the following. Is this a good/bad idea? The id != -1 checks the id of the special "Round X" marker trackerjacker uses. for (var key in turnorder) { if (turnorder.hasOwnProperty(key)) { if(turnorder[key].id != -1){ turnorder[key].pr = turnorder[key].pr - 10; } //sendChat('',key + " -&gt; " + JSON.stringify(turnorder[key]),null,(flags.archive ? {noarchive:true}:null)); } }
1447862263
The Aaron
Pro
API Scripter
That should be fine. &nbsp;All custom turn order entries have an id of -1, so if you start adding entries for other things (say, conditions like poisoned, or events like a delayed explosion or some such), then they won't get adjusted either. &nbsp;That's not likely to be a problem though. Glad you found a solution! =D