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

API Script Order

April 08 (7 years ago)
MyRoll20Stuffs
API Scripter
What determines the order API scripts are loaded? It's a pet peeve of mine that I want to order them a certain way but I'm not sure if you can...

Script Library scripts aren't prioritized.

It's not alphabetical.

So what determines what order the scripts load in?
April 08 (7 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
I believe the sandbox concatenates everything into one HUGE script, then presumably works from the top down... if you have a specific order desired you could try installing the priority ones first and then add everything else afterwards?
(untested and more information will likely follow from the 'experts'!)
April 08 (7 years ago)
MyRoll20Stuffs
API Scripter
I tried installing them in the order I wanted them to run and that didn't do it, it still seemingly randomly ordered the scripts:


I installed them in this order: Status FX, TokenMod, PageFX, SFX, Message of the Day, ShowAttr

And for whatever reason that image is the resulting order.

April 08 (7 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
hmm, thats odd... The Aaron will come along eventually to explain things better than I ever could. If load order is REALLY important to you then you could always get the code for each script and form your own mega-script with them in the correct order... would remove the one-click install auto updates though :(
April 08 (7 years ago)
MyRoll20Stuffs
API Scripter

Ziechael said:

hmm, thats odd... The Aaron will come along eventually to explain things better than I ever could. If load order is REALLY important to you then you could always get the code for each script and form your own mega-script with them in the correct order... would remove the one-click install auto updates though :(

Yeah I'd rather not do that.

It's not that big of a deal to me. I just want them to load in a specific order for aesthetic reasons and having the API Console output log messages in a certain order.
April 08 (7 years ago)
The Aaron
Pro
API Scripter
They are loaded in Tab order, as best I can tell. However, the asynchronous nature of JavaScript may styme your efforts at ordered output.