So, I have this command that works with testing. Every time I hit test, it seems to work. But when I use the command in chat it works only SOME of the time. It used to not work at all in chat, but the wizebot AI suggested I use the Window.playsong instead of Audio.play(), which worked for other command and is in the example. So, I at least have this working in test, and it SEEMS to work some of the time live. The other portion is just some text that says %user% slaps %target% etc etc, and that works EVERY time. Hopefully someone can figure this one out for me.
// Play initial audio using WizeBot's playSong function
window.playSong('https://datas-01.wizebot.tv/files_upload/global/803117/cmd_3539087/66e99f321c1ea.mp3', 1, false);
// Display image on screen
$(".screen_div").html("<img width='52%' src='https://i.kym-cdn.com/photos/images/original/002/056/165/acc.gif' style='position: fixed; top:50%; left:50%; transform:translate(-50%, -50%);' />");
// Replay the audio after 1.5 seconds
setTimeout(function() {
window.playSong('https://datas-01.wizebot.tv/files_upload/global/803117/cmd_3539087/66e99f321c1ea.mp3', 1, false);
}, 1500);
// End the script after 2.1 seconds, remove elements, and call setRefresh
setTimeout(function() {
$('.screen_div').remove();
setRefresh(); // Required to tell the overlay that the animation/command is finished.
}, 2200);