#!/usr/bin/perl # Script "sounds.pl" copyright (c) 2001 Internet Technologies Solution Centre # (http://www.itechsc.com). Distribution and use is is freely permitted # provided the copyright notice and conditions remains intact. You use # this script entirely at your own risk. # This script has been written for and tested with Mortal Realms MUD # (http://www.mortalrealms.com) with mudtelnet running on a RedHat Linux # system. Alterations may be required to make it work on other muds or # systems. if ($ARGV[0] eq "") { exit 0; } use IO::Handle; STDOUT->autoflush(1); while () { if ($_ =~ /^.*You receive \d+ experience points.*$/) { playsound("evillaugh.au"); } elsif ($_ =~ /^.*grazes you\..*$/) { playsound("doh1.au"); } elsif ($_ =~ /^.*scratches you\..*$/) { playsound("doh1.au"); } elsif ($_ =~ /^.*hits you\..*$/) { playsound("doh2.au"); } } exit 0; sub playsound { system("cat $ARGV[0]/scripts/sounds/$_[0] > /dev/audio"); }