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

Experimental API Sandbox keeps resetting back to Default API Sandbox

As per title, my API sandbox keeps resetting back to the default version from the experimental version. How do I prevent this? (I need experimental version for GroupInitiative).
1747885168

Edited 1748011716
timmaugh
Forum Champion
API Scripter
Unfortunately, at this point there is no preventing this. Here's a script you can load in your game that should alert you if the sandbox ever reverts to "default" mode: /* */ var API_Meta = API_Meta || {}; API_Meta.SandboxWatchdog = { offset: Number.MAX_SAFE_INTEGER, lineCount: -1 }; { try { throw new Error(''); } catch (e) { API_Meta.SandboxWatchdog.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (4)); } } const TestScript4 = (() =&gt; { &nbsp; &nbsp; &nbsp; &nbsp; let camp; &nbsp; &nbsp; &nbsp; &nbsp; const alertDefault = () =&gt; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let contents = `The sandbox has reverted to default mode.`; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let msg = `&lt;div style="width: 100%;border: none;border-radius: 0px;min-height: 60px;display: block;text-align: left;` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `white-space: pre-wrap;overflow: hidden"&gt;&lt;div style="font-size: 14px;font-family: &amp;quot;Segoe UI&amp;quot;, Roboto, Ubuntu, sans-serif"&gt;` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `&lt;div style="background-color: #000000;border-radius: 6px 6px 0px 0px;position: relative;border-width: 2px 2px 0px 2px;` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `border-style: solid;border-color: black;"&gt;&lt;div style="border-radius: 18px;width: 35px;height: 35px;position: absolute;` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `left: 3px;top: 2px;"&gt;&lt;img style="background-color: transparent ; float: left ; border: none ; max-height: 40px;"` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `src=" <a href="https://i.imgur.com/kiUf3UC.png&quot;&gt;&lt;/div&gt;&lt;div" rel="nofollow">https://i.imgur.com/kiUf3UC.png"&gt;&lt;/div&gt;&lt;div</a> style="background-color: #c94d4d;font-weight: bold;font-size: 18px;` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `line-height: 36px;border-radius: 6px 6px 0px 0px;padding: 4px 4px 0px 43px;color: #ffffff;min-height: 38px;"&gt;` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `ALERT: Default Sandbox&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: white;padding: 4px 8px;border: 2px solid #000000;` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `border-bottom-style: none;color: #404040;"&gt;${contents}&lt;/div&gt;&lt;div style="background-color: white;text-align: right;` + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `padding: 4px 8px;border: 2px solid #000000;border-top-style: none;border-radius: 0px 0px 6px 6px"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;`; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat('SandboxWatchdog', `/w gm ${msg}`); &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; const check = () =&gt; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (camp.sandboxVersion.toLowerCase() === 'default') { alertDefault(); } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else { setTimeout(check,1500);} &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; on('ready', function() { &nbsp; &nbsp; &nbsp; &nbsp; camp = Campaign(); &nbsp; &nbsp; &nbsp; &nbsp; setTimeout(check,0); &nbsp; &nbsp; }); })(); { try { throw new Error(''); } catch (e) { API_Meta.SandboxWatchdog.lineCount = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - API_Meta.SandboxWatchdog.offset); } } /* */ I can't *fully* test this at the moment because I can't get my sandbox to boot into Experimental mode... but this should work. EDIT: found one small bug; corrected in the code, above.