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

How do I use scriptArgs?

I want to use Flight and some other scripts. Some of them have a dependency on scriptArgs. How do I "install" that? Do I just add a new script with the contents of scriptArg in it? Or do I need to embed the contents of scriptArg into (the top or the bottom of) the Flight script? I enter in this command: !fly 50 And I'm getting this in the script debug. ReferenceError: list is not defined at handleInput (evalmachine.<anonymous>:54:14) at eval (
1427256345
Lithl
Pro
Sheet Author
API Scripter
Yes, you just need to add the splitArgs script to your campaign alongside the script which requires it. What scripts do you have running? Neither Flight nor splitArgs should throw the error you're reporting, so it may be coming from a third script. (If the error is caused by splitArgs not being installed, it would be something to the effect of "ReferenceError: splitArgs is not defined")
OK. I got Flight to work with splitArgs. The problem must be with the Marking Conditions script (or my use of it). Here is the script source: <a href="https://github.com/Roll20/roll20-api-scripts/tree/" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/</a>... I am trying to use this command with a selected token: !mark @{selected|token_id} ongoing poison I am getting this error: For reference, the error message generated was: ReferenceError: list is not defined at handleInput (evalmachine.&lt;anonymous&gt;:1174:14) at eval (
1427387219

Edited 1427460450
Fixed it by comparing some common code in Flight with Marking Conditions. Three things. Line 78: Removed this code. list is not defined in the script. (I'm a JavaScript n00b and this should have been more apparent to me given the error message above). if (!list[msg.playerid]) { list[msg.playerid] = { cmds: [], delay: 500 }; } Line 89: From: if (arg0) { To: if (arg0 && arg0.length &gt; 0) { Line 231: From : registerEventHandlers: registerEventHandlers, To: registerEventHandlers: registerEventHandlers Anywho, working like a champ now!
1427406737
The Aaron
Pro
API Scripter
Cool! :)
1427417531

Edited 1427418126
Lithl
Pro
Sheet Author
API Scripter
Thanks for finding those, Ron. Looks like the list thing snuck in from the Store Commands script. =) I've sent a pull request with these fixes to the repo.