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

[Bug] Roll20 Audio Master

Hi All, In the last couple of days, I have been having the following error with the Aura/Tint HealthColor: TypeError: Cannot read property 'indexOf' of null TypeError: Cannot read property 'indexOf' of null at Object.d20.textchat.doChatInput (eval at <anonymous> (/home/node/d20-api-server/api.js:155:1), <anonymous>:331:17) at sendChat (/home/node/d20-api-server/api.js:1788:16) at outputConfig (apiscript.js:8691:13) at changeHandler (apiscript.js:9068:21) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1028:14) at updateLocalCache (/home/node/d20-api-server/api.js:1318:18) at /home/node/d20-api-server/api.js:1530:7 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 I can only find two instances of the IndexOf in the script, but can't see how they would affect it?
1535047994
The Aaron
Pro
API Scripter
So, from the callstack, this is inside Roll20's sendChat() function.  Whatever the issue is, it has to do with what's being passed to sendChat() in the outputConfig() function.
1535048107
The Aaron
Pro
API Scripter
In fact, that's not in HealthColors.  It's either in: Page Navigator Roll20 Audio Master
Thanks Aaron,  I do have the Script library version of Roll20 Audio Master installed, I guess there is a recent update on this then? Disabling it makes everything lovely again. I will do some more digging as to why it is not playing nicely, as I have not made any changes.
1535052131
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Do you have aura health set to play a sound at a given health?
1535054723

Edited 1535054782
Aura plays a scream at 0hp.  and changing the track gives: Error: Firebase.update failed: First argument contains NaN in property 'current' Error: Firebase.update failed: First argument contains NaN in property 'current' at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) at Ea (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:403) at J.update (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:318) at TrackedObj._doSave (/home/node/d20-api-server/api.js:850:27) at later (/home/node/d20-api-server/node_modules/underscore/underscore.js:892:31) at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:829:19) at ontimeout (timers.js:386:14) at tryOnTimeout (timers.js:250:5) thanks whoever changed the title of the thread
1535056491
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, gonna ping Victor as he's taken the lead on further development of Roll20AM. I think this is an error that we thought was fixed.
is healthcolor dependent on roll20AM?  it plays fine, it is only when I click on there to change the track on !aura that it throws up the new error above.
1535062205
Victor B.
Pro
Sheet Author
API Scripter
Ok I'm here (thanks Scott),.  Please post your roll20AM command to verify.  Also what version of are you running?
There is no roll20am command, it seems to be conflicting with HealthColor.
1535114259
Victor B.
Pro
Sheet Author
API Scripter
Can you show me the command of the Scream track within HealthColor?  
of course:         PlayDeath = function (trackname) {               var RandTrackName;             if(trackname.indexOf(",") > 0) {                 var tracklist = trackname.split(",");                RandTrackName = tracklist[Math.floor(Math.random() * tracklist.length)];             }             else RandTrackName = trackname;             var track = findObjs({type: 'jukeboxtrack',title: RandTrackName})[0];             if(track) {                 track.set('playing', false);                 track.set('softstop', false);                 track.set('volume', 50);                 track.set('playing', true);             }             else {                 log(ScriptName + ": No track found named " + RandTrackName);             }         }
1535119856
Victor B.
Pro
Sheet Author
API Scripter
You aren't using Roll20AM.  You are going directly against Jukebox.  
I know I am not, I disabled Roll20am and that stopped the error.  I started this bug as an aura helathcolor error and then it was narrowed down to Roll20am.
1535121392
Victor B.
Pro
Sheet Author
API Scripter
I see now. I'm starting to wonder if these two scripts as is are compatible.  Roll20AM has a trigger on tracks that's invoked when a track stops in order to figure out what to do next.  Then it checks if anything is actually playing (playlist or track) to determine what to do next.  Finally it displays a menu based on what's going on.  It's failing on the menu display.  It won't display a menu if nothing is playing within Roll20AM.  That's to prevent exactly these sorts of issues, where a track launched from one API causes Roll20AM to get into the act.  So somehow, Roll20AM thinks something is playing and is displaying the appropriate menu and in reality nothing is playing so it's bombing out.   More questions 1) Are you playing something in Roll20AM at the time of this script?  Is another track finishing up?   2) You have these sound effect scripts loaded into Roll20AM?  
Glad it makes sense :) 1) Nothing playing in Roll20AM, I stopped using it as I have not got round to updating all the macros I used to the new format.  2) I have it the Wilhelm Scream in the track list, but I do not believe it is attached to any of the macros.
1535137137
Victor B.
Pro
Sheet Author
API Scripter
Easiest way to figure this out is for you to invite me to game and promote me to GM once I'm in.  Then I'll need you online so you can do whatever you do that causes this and I can view the logs.  
I think I have found what it is, as you say, it is trying to invoke the menu.  Since I have imported the Jukebox the error has stopped.  I had not bother previously as I was not going to use Roll20AM. If the Jukebox is empty then the error is triggered, this is if it is played from any trigger, including the roll20 jukebox. TypeError: Cannot set property 'playing' of undefined TypeError: Cannot set property 'playing' of undefined at changeHandler (apiscript.js:9059:38) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1028:14) at updateLocalCache (/home/node/d20-api-server/api.js:1318:18) at /home/node/d20-api-server/api.js:1530:7 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Rd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) However, whenever any sound effect is triggered not via Roll20AM, including directly from the jukebox it will attempt to draw the menu, whether you want it or not.
1535139671
Victor B.
Pro
Sheet Author
API Scripter
If you have Roll20AM installed, then yes it will.  When a track stops, the trigger kicks in.  At that point, Roll20AM doesn't know how the track was kicked off or not.  So in order for it to work correctly it has to be aware of the track so it can figure out if it kicked off the track or not.  If I'm reading your post correctly, you no longer have the error or is the above a new error?   Long and short, if you are going to use Roll20AM, you have to import everything into it.  
if everything is imported all is well. never occurred to me that it would need this, sorry. I was just checking that the whole playlist had to load everytime a track was played, and all tracks must be imported?
1535148185

Edited 1535148543
Victor B.
Pro
Sheet Author
API Scripter
No, once imported into Roll20AM, you don't need to do it again unless you add more tracks and need them in Roll20AM.  The import does an incremental update to Roll20AM, so only the new stuff is brought in.  When you do an import for the first time, it brings in playlists, tracks assigned to playlists and all tracks individually.  You can view your playlists, the tracks assigned to the playlists (by clicking on playlist name) or all individual tracks (by clicking on tracks).  The playlist doesn't load.  It's already in Roll20AM.  So you can kick the track off by viewing the tracks assigned to the playlist or by going to tracks and launching it there.  Doesn't matter how you launch it.  
sorry, what i meant was, if i introduce a new track, say ambient music, do I need to add this to Roll20am to avoid the error? Also is there a flag that can be set when a track is fired from a non-roll20am  trigger so that the menu is not triggered.
1535328601
Victor B.
Pro
Sheet Author
API Scripter
Yes, you click import jukebox and it will bring new stuff in and yes, Roll20AM has to be aware of the track.  Roll20AM does know if it has fired the track off or not.  No, there's no way to control the trigger.  It's placed on Jukebox and fired when the track ends.  That's why Roll20AM needs to be aware of the track because there's no "selective" ability to manage that trigger.  
Thank you, Victor, that all makes sense.