#!/usr/bin/perl -w # # Zamfir version 0.1 (a script for generating a tone when someone /msgs you. # Written by Craig Maloney # Based off of away.pl and sample_script.pl # # # I called this script zamfir because: # a) I wanted this script to load last, after the ignore scripts. # b) zamfir was the only musical name I could come up with that began with # a Z. Sure, there's Zildjian, but who wants to type that? # c) This script can get pretty annoying after a while, and while I haven't # heard the original Zamfir's work, I've been told he can get pretty # annoying after a while as well. # # This script has received the bare minimum of testing (read: it works for me) # so if you have any problems with it, please feel free to send me mail. # IRC::print ":: Loading Zamfir ::\n"; IRC::add_message_handler("PRIVMSG", "privmsg_handler"); IRC::add_command_handler("zamfir", "zamfir_command_handler"); $my_nick = IRC::get_info(1); $msg_cmd='nmaker'; $msg_file='/home/craig/audio/wav/bell.wav'; $zamfir_sound = 1; sub privmsg_handler { if ($zamfir_sound == 0) { return 0; } else { my $line = shift(@_); $line =~ /:(.*)!(.*@.*) .*:(.*)/; if ($2=~/$my_nick/i) { system (`$msg_cmd $msg_file`); } return 0; } } sub zamfir_command_handler { my $param=shift; if (uc $param eq 'ON' ) { IRC::print "\0034:: ZAMFIR is ON ::\003 \n"; $zamfir_sound=1; return 1; } else { if (uc $param eq 'OFF' ) { IRC::print "\0034:: ZAMFIR is OFF ::\003 \n"; $zamfir_sound=0; return 1; } } IRC::print "USAGE: ZAMFIR [ON/OFF]\n Turns message notification on or off\n"; return 1; }