Creating a tip menu

audiohook

#1

I’m creating a tip menu for the stream.

We need it to trigger when someone cheers a certain amount. So, cheer121 would trigger a certain sound and GIF.

I can use keywords for that, but I’m unable to get it to trigger a GIF and an audiohook. When I add an audiobook, the alert stops working. When I add an alert, the audiohook stops working! Help please?


#2

My first response, although perhaps overly complicated, is to write a custom script that detects the cheers (we do cheer detection in PhantomBot through events) and then call the Java Core method to trigger an audiohook (which is what the !audiohook command does).

So, for example, in handlers/bitsHandler.js you could add:

if (bits => 1000 && bits < 2000) {
       $.panelsocketserver.triggerAudioPanel('HookName');
} else if (bits => 2000 && bits < 3000) {
       $.panelsocketserver.triggerAudioPanel('AnotherHookName');
}

You could also create a new script that looks like the event that catches bits in bitsHandler.js and keep that as a custom script between releases more easily.

Now, if you want it to trip an alert, with a gif and audio file (remember, you can have a gif and a related MP3 file together for an alert, instead of calling $.panelsocketserver.triggerAudioPanel you call $.panelsocketserver.alertImage(filename); or (filename,duration_in_seconds); Where filename is the name of the GIF file (‘banana.gif’). If you want the GIF/audio to play for a specific duration, then the filename needs to include the duration (‘banana.gif,10’) for 10 seconds.


#3

Thanks! I’ll have to give this a try! I’m going to start with trying to get the gif and audio working together first. Then, I’ll come back to the script and mess with that. =)


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.