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

Is There Any Way to Make Mods Respond More Quickly?

If there's any kind of a pause, be it DM describing stuff, discussion, looking at other programs or what have you, mod scripts slow... down...... to........... a........................... C...R...A...W...L And it's 30 or more seconds waiting for the engine to respond. Is there anything that can help?
1781455945
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
depends on what mods you have installed. Although seeing it slow down when it's not being used is a strange symptom.
1781457088

Edited 1781457267
Scott C. said: depends on what mods you have installed. Although seeing it slow down when it's not being used is a strange symptom. Same thing when I save changes on a script. Timing this with a phone stopwatch gets the same sort of delay, between 30 to 40 seconds. Doesn't sound like much, but it's a PITA when you are trying to play or develop your script. This is from my console: Restarting sandbox by user request... detected currently running sandbox... restarting "Loading character sheet data..." "Starting webworker script..." "Loading 0 translation strings to worker..." "-=> TokenMod v0.8.88 <=- [Sun Mar 15 2026 15:39:11 GMT+0000 (Coordinated Universal Time)]" "-=> ChatSetAttr v1.10 <=-" "TradingPost1E v0.3.4 ready." "ScriptCards: 3 Templates loaded" "ScriptCards Triggers could not find character named \"ScriptCards_Triggers\"" "-=> ScriptCards - 3.0.20 by Kurt Jaegers Ready <=- Meta Offset : 38435" "═╣ StuffAmmo.js !stuff lists Ammo or All Eqpt by Tim, !stuff Version 1, 14 May 2026 ╠═" "═╣ AdminMenu.js !admin for Admin Menu by Tim, Version 1, 22 May 2026 ╠═" "═╣ Turn Undead by Tim, Version 1, 24 May 2026 ╠═" "═╣ Saving Throw by Tim, Version 1, 13 May 2026 ╠═" "═╣ Turn Undead Roll by Tim, Version 1, 27 May 2026 ╠═" "═╣ CF Roll by Tim, Version 1, 23 December 2020 ╠═" "═╣ StuffAmmoEq.js for All Eqpt by Tim Version 1, 14 May 2026 ╠═" "═╣ MyCoins.js !mycoins Tim, Version 1, 4 June 2026 ╠═" "##########> Sandbox [DEFAULT 2026-05-14] : Ready fired after 35.57s, 292 objects." Missing one script I neglected to place a title for after the On Ready. Is this a normal time? I don't really know.
This may or may not be relevant, but this morning my antimalware got an update, then when I opened my game to prep some things for later tonight everything was delayed: character sheet functions, macros that called scripts, even handouts that had embedded links. After I opened my antimalware app and whitelisted roll20.net the problems went away.
1781466089
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
ok, not quite understanding what you are seeing as the cause of the delay. When you save a script/restart the sandbox, it takes 30 to 40 seconds to reboot (this issue I understand). And then in play, it slows down under what conditions?
1781487389
Andrew R.
Pro
Sheet Author
I have never encountered this, and I’ve been a Pro subscriber using Mods since 2015.  My first suggestion is to launch your Roll20 games in a Chrome Incognito or Firefox Private Browsing window.  Then launch the game in a new tab, and use the existing tab to open the Mods console.  Once the game is launched, test your Mods for performance and check the Mods console for errors.
1781574206
timmaugh
Pro
API Scripter
Looks like quite a few of your own scripts in there, so if you are seeing *in game* slow downs, I would want to rule out how those are built. Do you have them auto-calling themselves to periodically poll some part of the game? IE: const doTheThing = (status) => {   if (testSomethingInTheGame()) {     updateStatus();   }   setTimeout(doTheThing, 5000, status); } Or do you store a bunch of information in objects within the script closure to keep the information available between calls of the script? Is it built asynchronously? What sheet(s) do you have in the game?
Scott C. said: depends on what mods you have installed. Although seeing it slow down when it's not being used is a strange symptom. Hi Scott, most of what I am seeing here is as I create various scripts to allow some of my players to avoid the character sheet as much as possible. I find the AD&D 1e sheet excellent, myself but these friends are a bit computer phobic. We've been taking a break from my campaigns so I want to make things as friendly as possible for those who have difficulty with even an alt-tab.
Rick A. said: This may or may not be relevant, but this morning my antimalware got an update, then when I opened my game to prep some things for later tonight everything was delayed: character sheet functions, macros that called scripts, even handouts that had embedded links. After I opened my antimalware app and whitelisted roll20.net the problems went away. Thanks Rick, good idea, but I'm OK in that area, thank you. Scott C. said: ok, not quite understanding what you are seeing as the cause of the delay. When you save a script/restart the sandbox, it takes 30 to 40 seconds to reboot (this issue I understand). And then in play, it slows down under what conditions? Any kind of delay, be it me being the DM and describing stuff, discussion of sports, D&D games we played together from the 70s, and so on. However, I should emphasizemy campaigns are on pause for now, so for the past month it's just been me doing development (if you can call it that) of scripts to make my computer-phobic friends less dependant on the AD&D 1e character sheet.
Andrew R. said: I have never encountered this, and I’ve been a Pro subscriber using Mods since 2015.  My first suggestion is to launch your Roll20 games in a Chrome Incognito or Firefox Private Browsing window.  Then launch the game in a new tab, and use the existing tab to open the Mods console.  Once the game is launched, test your Mods for performance and check the Mods console for errors. I started in 2020, myself and gave up in 2021 after continual updates to roll20 broke the things I was working on. Came back to it last Fall. I will give this a go, thanks.
timmaugh said: Looks like quite a few of your own scripts in there, so if you are seeing *in game* slow downs, I would want to rule out how those are built. Do you have them auto-calling themselves to periodically poll some part of the game? IE: const doTheThing = (status) =&gt; { &nbsp; if (testSomethingInTheGame()) { &nbsp; &nbsp; updateStatus(); &nbsp; } &nbsp; setTimeout(doTheThing, 5000, status); } Or do you store a bunch of information in objects within the script closure to keep the information available between calls of the script? Is it built asynchronously? What sheet(s) do you have in the game? Jeez, I always forget to mention the sheet when I post here. Advanced Dungeons &amp; Dragons 1e. It works well in my opinion, but my friends have diffculty scrollling through it. Thus my efforts while we take a break from my games. No execution of routines while others are running. No time outs. And I don't store information anywhere - I have a database development background (1988 to 2021 when I retired) in military, facility maintenance, and nuclear environments and am used to using tables, temp tables, or make table statements with access only to the user who is using my applications. I know there's a way to store information in roll20, but I honestly have not figured that out. I do have some scripts calling others, mainly from buttons like the following snippet for a main chat window: let illus = "&lt;p&gt;[x](<a href="https://files.d20.io/images/490142690/glrFQew8H9NPaJB6MRH43g/max.jpg)&lt;/p" rel="nofollow">https://files.d20.io/images/490142690/glrFQew8H9NPaJB6MRH43g/max.jpg)&lt;/p</a>&gt;"; TopBtns = '&lt;p&gt;&lt;b&gt;Administrative Functions&lt;/b&gt;&lt;br&gt;&lt;i&gt;Need to buy stuff? Ask DM.&lt;/i&gt;' + "&lt;div style='text-align:center;'&gt;" + btn("Missile Tracking", "!stuff --m", userhex) + btn("Equipment List", "!stuff --a", userhex) + btn("My Coins","!mycoins", userhex) + btn("Party Coins","!list-char-ids coin", userhex) + //"[Bad Coins](!&amp;#13;#Coin-Bad)" + btn("Bad Coins","!list-char-ids badcoins", userhex) + '&lt;a style="display:inline-block;text-align:center;margin:1px 2px 1px 0;padding:3px 6px;min-width:20px;color:#ffffff;background:' + userhex + ';border:1px solid #6a4323;border-radius:6px;text-decoration:none;font-normal:100;" href="!&amp;#13;#Token"&gt;Token Controls&lt;/a&gt;' + btn("Stats","!list-char-ids stats", userhex) + btn("Spells n' Stuff", "!spells", userhex) + "&lt;/div&gt;&lt;/p&gt;"; BottomBtns = '&lt;p&gt;&lt;b&gt;Fun with Combat!&lt;/b&gt;' + "&lt;div style='text-align:center;'&gt;" + Drive buttons here: But nothing like you've asked about, i.e. always one step after another.
1781630887
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Tim M said: Any kind of delay, be it me being the DM and describing stuff, discussion of sports, D&amp;D games we played together from the 70s, and so on. However, I should emphasizemy campaigns are on pause for now, so for the past month it's just been me doing development (if you can call it that) of scripts to make my computer-phobic friends less dependant on the AD&amp;D 1e character sheet. Right, I got that. But what do you mean it slows down when you take a break? Do you mean the next API command you issue takes a while to resolve? The VTT as a whole stutters? I'm trying to figure out what the symptom is that you see since if you are delaying there isn't anything being actively done that the API would be giving a response to? Also, are there any errors in the api page when this happens?
Scott C. said: Tim M said: Any kind of delay, be it me being the DM and describing stuff, discussion of sports, D&amp;D games we played together from the 70s, and so on. However, I should emphasizemy campaigns are on pause for now, so for the past month it's just been me doing development (if you can call it that) of scripts to make my computer-phobic friends less dependant on the AD&amp;D 1e character sheet. Right, I got that. But what do you mean it slows down when you take a break? Do you mean the next API command you issue takes a while to resolve? The VTT as a whole stutters? I'm trying to figure out what the symptom is that you see since if you are delaying there isn't anything being actively done that the API would be giving a response to? Also, are there any errors in the api page when this happens? Hi Scott, sorry to take so long to reply. By "slow down" I mean from the time one clicks a button on a chat menu or clicks a macro (that is just an mod*) that is a Token Action or in the macro bar, one has to wait what seems to&nbsp; be a very long time (probably just 30-40 seconds) before anything happen. No, no errors indicated in the Mod Output Console. ______________ * By macro that is just a mod, mean the macro is like this:
1781811634

Edited 1781811680
Gauss
Forum Champion
Tim M.,&nbsp; Have you tried disabling your Mods one at a time to see if there is an issue? Perhaps one of them is causing the problem.
Gauss said: Tim M.,&nbsp; Have you tried disabling your Mods one at a time to see if there is an issue? Perhaps one of them is causing the problem. Thanks, let me try that over the next while.&nbsp;
1781883312
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Thanks for the additional info Tim. That definitely sounds like it's an issue with the code in one or more scripts. I also just noticed that your sandbox startup time is also about 30 seconds, and that is WAY longer than it should be, especially for a game that only has ~300 game objects in it based on those logs. I'd recommend following Gauss's advice of disabling one at a time, but instead of using a macro to test for the delay (as you said the delay isn't always present), just use that startup time as an indicator of the issue. I can't guarantee that they are the same, but it's likely. Your sandbox's current startup time is ~7 - 8X what it should be; my game with almost 1000 game objects in it starts up in just over 4 seconds.
1781894459
The Aaron
Roll20 Production Team
API Scripter
I'll reiterate what Scott said, it's likely something in one of your scripts is doing more than it should be, particularly at startup. The sandbox works in phases: Start Load all scripts Execute all scripts Load all objects into in memory structures, firing add events for each one Fire ready event Fire events as they occur. In general, it's best practice to defer your script work until after ready has fired: on('ready',()=&gt;{ // create structures and functions // verify installation // setup initial state // register for events }); That allows the sandbox to be fully loaded before outside forces change it.&nbsp; &nbsp;If your script is immediately registering for add events, and making new objects, or setting properties on objects, it's going to slow down the startup process. Once ready has fired, if there is any slowdown, it will be the result of your event handlers (chat:message primarily for API commands, change:XXXXX &nbsp;for scripts responding to changes on the table top).&nbsp; There's a lot you can do right and wrong in there, and it's hard to know without looking at how you've structured things.&nbsp; &nbsp;I'd suggest picking one script that seems to be really slow, post it and get some feedback on it.
1781932638
Andrew R.
Pro
Sheet Author
Since you're already loading ScriptCards, I suggest prototyping in ScriptCards first, and then writing Mods later. The MetaScriptToolbox and ScriptCards can do a lot before you need to write a custom Mod!
Scott C. said: Thanks for the additional info Tim. That definitely sounds like it's an issue with the code in one or more scripts. I also just noticed that your sandbox startup time is also about 30 seconds, and that is WAY longer than it should be, especially for a game that only has ~300 game objects in it based on those logs. I'd recommend following Gauss's advice of disabling one at a time, but instead of using a macro to test for the delay (as you said the delay isn't always present), just use that startup time as an indicator of the issue. I can't guarantee that they are the same, but it's likely. Your sandbox's current startup time is ~7 - 8X what it should be; my game with almost 1000 game objects in it starts up in just over 4 seconds. The Aaron said: I'll reiterate what Scott said, it's likely something in one of your scripts is doing more than it should be, particularly at startup. The sandbox works in phases: Start Load all scripts Execute all scripts Load all objects into in memory structures, firing add events for each one Fire ready event Fire events as they occur. In general, it's best practice to defer your script work until after ready has fired: on('ready',()=&gt;{ // create structures and functions // verify installation // setup initial state // register for events }); That allows the sandbox to be fully loaded before outside forces change it.&nbsp; &nbsp;If your script is immediately registering for add events, and making new objects, or setting properties on objects, it's going to slow down the startup process. Once ready has fired, if there is any slowdown, it will be the result of your event handlers (chat:message primarily for API commands, change:XXXXX &nbsp;for scripts responding to changes on the table top).&nbsp; There's a lot you can do right and wrong in there, and it's hard to know without looking at how you've structured things.&nbsp; &nbsp;I'd suggest picking one script that seems to be really slow, post it and get some feedback on it. Normal 0 false false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0in; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-font-kerning:1.0pt; mso-ligatures:standardcontextual; mso-fareast-language:EN-US;} OK, I'm beginning this now. I'm honestly not sure about the best methodology. I have disabled one script, a 33,251 line script for buying items from the AD&amp;D1e “store”, someone on the AD&amp;D1e group wrote. I find it very impressive. To my surprise, things sped up considerably. I then shut off and restarted the browser and the game loaded quickly. Then I enabled the script again, and to my surprise, everything loaded at the new superfast speed. I closed and reopened the browser and everything is carrying on in a very zippy fashion. I opened a second copy of roll20 and went to the mods and restarted the sandbox. 2.55 seconds compared to 35 seconds above and the usual 35 to 55 seconds. It seems that whether or not the game remains idle or not has something to do with this, I’m going to leave things on and go for a walk and see what happens when I return. &nbsp; &nbsp;
1781996149
Andrew R.
Pro
Sheet Author
The usual best methodology is a binary search, where you disable one half of your scripts.
Andrew R. said: The usual best methodology is a binary search, where you disable one half of your scripts. Thanks Andrew, I'll give that a go.&nbsp;