!random already exists, so that will just cause a command conflict. If you still have a custom command called
!random, then I’d delete it to prevent future errors.
To set the random gif, this should be possible since the last update, as the readfile variable will now parse variables within.
Having got all that out of the way, this is what you’ll need to do.
Get your gifs and sounds in MP3 format, each pair will need to have an identical name, case sensitive. Keep them to one word names, all lowercase.
Upload all these alerts to the
./config/alerts folder in your bot.
Create a text file, and add
(alert alertname.gif), with each different alert on it’s own line. Save this text file to the addons folder in the bot.
You can now create your command, which will need to look like this:
!addcom boo (readfilerand ./textfilename.txt). This will select a random line from the text file you created. As these are all simply gif commands, nothing will be printed in chat, but whichever line gets randomly selected will fire that gif alert.
EDIT (Because I forgot when originally writing this): To get these alerts to show up on your screen, you will need to point a browser source to localhost(or your server’s IP):baseport/alerts. For example:
If you do want it to print something in chat, then you would need to add that line in the txt file, not the command itself. If you always want it to be the same, you’ll need to add it multiple times. Obviously for this sort of command you probably don’t want any advanced warning. If you do add text, put it before the (alert) text.