And after a long idle period on active scripting, I decided to come back with a useful script, to update a page about a similar issue, which anyway didn’t show anything such advanced.
This script does all the dirty job of managing events that inside mIRC are programmed to be able to generate sounds. It intercepts them, and, if you enabled sounds, it will play the WAVs appropriate for each event (I added to this script the WAVs I use on my own copy of mIRC)
If you wish to download the ZIP, here you go. All the instructions to load it are in the TXT, while in here you can see how you can customize the script itself, and learn how it works. The WAVs have been made mostly using MS Talkit, which you can find in the Download/AudioVideo section, in case you want to make your own WAVs; there’s also a guide to it in the HowTo’s section.
Follows the script listing:
alias sounds { //if ($1 == on) { /set %Soundon 1 | echo -a $+ $color(info text).dd $+ *** Sounds have been activated } //if ($1 == off) { /set %soundon 0 | echo -a $+ $color(info text).dd $+ *** Sounds have been disabled } } alias checkquery //if (($query($1).addr != $null) && (%Soundon == 1)) /splay query.wav CTCP *:DCC:*:{ if (($2 == send) && (%soundon == 1)) /splay dcc send.wav } on *:GETFAIL:*.*:{ //if (%Soundon == 1) /splay dcc failed.wav } on *:FILERCVD:*.*:{ //if (%Soundon == 1) /splay dcc finished.wav } on 1:OPEN:?:*:{ //if (($pos($strip($1-),Matches for,1) == 1) && (%Soundon == 1)) /splay locator.wav else /timer 1 1 checkquery $nick } on *:NOTICE:*:*:{ //if ((($pos($strip($1-),Requested File's on its way! Low CPS Limit:,1) != $null) || ($pos($strip($1-),is on its way.,1) != $null) || ($pos($strip($1-),Now Sending!,1) != $null)) && (%Soundon == 1)) { /splay File Arriving.wav | goto bother } //if ((($pos($strip($1-),is on its way.,1) != $null) || ($pos($strip($1-),Now Sending!,1) != $null)) && (%Soundon == 1)) { /splay File Arriving.wav | goto bother } //if ((($pos($strip($1-),You are in que now with number,1) != $null) || (($pos($strip($1-),I have added,1) != $null) && ($pos($strip($1-),in my que,1) != $null)) && (%Soundon == 1))) { /splay Queued.wav | goto bother } //if ((($pos($strip($1-),You are already in my que list with,1) != $null) || ($pos($strip($1-),Sorry I am totally maxed out even in que list,1) != $null)) && (%Soundon == 1)) { /splay Queue Finished.wav | goto bother } //if ((($pos($strip($1-),Password accepted for,1) != $null) && ($nick == NickServ)) && (%Soundon == 1)) { /splay Identified.wav | goto bother } //if ($pos($1-,server flood protection activated,1) != $null) goto bother //if ($pos($1-,has opped,1) != $null) goto bother //if ($pos($1-,has deopped,1) != $null) goto bother //if ($poscs($1-,DCC Send,1) != $null) goto bother //if (%Soundon == 1) /splay notice.wav :bother } on *:TEXT:*:#:{ //if ($pos($1-,$me,1) != $null) {//if (%Soundon == 1) /splay chimes.wav//if ($window(@calls,1) == $null) /window -n @calls//aline -hp @calls 11 $chan 9 [ $time ] 7 < $nick > 8 $1- } } on *:CONNECT://if (%Soundon == 1) /splay Connected.wav on *:DISCONNECT://if (%Soundon == 1) splay Disconnected.wav
And follows the explanation (usage instructions at te bottom of the page).
The first three events (CTCP, on FILERCVD, on GETFAIL) trigger repectively when an incoming DCC send arrives, or a completion or fail of a DCC get occur, and, after checking if the sound output is enabled, play their files.
The on OPEN triggers when a query opens. It checks first if it’s a response of an MP3 sharing script, if not it waits 1 second before playing the Query sound. This is because you may have installed an antispam script (get a look at mine also in the IRC section) which closes instantly the query if it’s detected as spam: in this case you hear the sound only if the query is still open after a second.
The on NOTICE event checks for a lot of things. If NickServ identified you, if your MP3 request has been queued, is arriving, or hasn’t been accepted (works with SpR and SDFind responses only), ignores some frequent useless notices like the oppings, deoppings, flood protections, and after that plays a generic notice sound if no specific event is detected.
The last one, on TEXT, does what I like most: checks wether someone types your nick in a channel, and sounds chimes.wav, logging at the same time the line into a window. 2 things: first, you may want to disable it for specific occurencies (example: you are op, you voice someone, and his lame script -there’s no other way to call it- thanks you automatically; listening to the sounds may be… and is… annoying) so either you disable the sound at all (deleting the line containing "chimes.wav") or add some filters for those occurrencies (you must be a little fluent in mIRC scripting); second, the window logging looks really nice to me, but in the case you find it useless, delete the two lines containing "@calls". You may easily notice how you could completely delete the last statement if you don’t like it for both reasons. Also, it is somewhat"inefficient". That is, checks whatever is written in whichever channel, which means CPU usage. I have a single big on TEXT in my own script which checks a lot of things togheter, but if you have other scripts installed, they may have their own on TEXT routines. In that case the CPU utilization raises, so, if you are a lucky owner of a 1GHz+ CPU, no big deal, only keep in mind that on slower machines, having a mIRC instance which sucks 5% of the CPU is very annoying .
Now, how to use it? Simple, after having loaded the script (follow the instructions in the TXT file), do /sounds on and you will be all setted. The script wll begin to play the WAVs when it’s come the moment. Want to watch a movie or play a game? Type /sounds off and mIRC won’t bug you. That’s all.
How to cutomize it? Basically, you can change the name ot location of the WAVs, delete some parts you’re not interested in, but mostly, add other handlers, if you can, and care. Only thing: mIRC will continue to beep if someone writes other lines in a query after the first one, even if sounds are off. I could change that, but I was too lazy in that moment; I don’t even plan to do it in the future… take it as a good excercise on scripting.