Code:
alias mp3 {
  set %mp3dir $$sdir=" Set Mp3 Directory: "
  write -c mp3.txt
  noop $findfile(%mp3dir,*.mp3,0,write mp3.txt $1-)
}

on $*:text:/!(play|stop|pause|resume|random)/Si:*:{
  if ($isfile(mp3.txt)) {
    var %target = $iif($target ischan,$chan,$nick)
    if ($1 == !random) { splay $read(mp3.txt) | msg %target I'm now randomly playing $nopath($insong.fname) }
    if ($1 == !play) { splay $read(mp3.txt,$2) | msg %target I'm now playing $nopath($read(mp3.txt,$2)) }
    if ($1 == !stop) { 
      if ($insong) { splay stop | msg %target Song stopped }
      else { msg %target Song not started }
    }
    if ($1 == !pause) { 
      if ($insong) && (!$insong.pause) { splay pause | msg %target Song stopped. }
    }
    if ($1 == !resume) { 
      if ($insong) && ($insong.pause) { splay resume | msg %target Song resumed. }
    }
  }
}