!Text triggered bot mp3 player

By Retarded on Jun 16, 2007

Basically this mp3 player is best suited for a script bot, c&p into remotes (alt+r)and type /mp3 and enter your playlist directory .. once you have set this.. type !play to play and spam your song, !stop to stop the song etc

Where it says 'if ($nick == ) {' Enter the nick which you want to allow access to these commands, most probably your own nickname.

The script still needs some minor improvements, so feel free to suggest on how to do so, in the mean time i'll keep working on it.

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 ($nick == <NICKNAME>) {
    if ($isfile(mp3.txt)) {
      var %target = $iif($target ischan,$chan,$nick)
      if ($1 == !random) { splay $read(mp3.txt) | describe %target np random:4 $nopath($insong.fname) }
      if ($1 == !play) { splay $read(mp3.txt,$2) | describe %target np:4 $nopath($read(mp3.txt,$2)) }
      if ($1 == !stop) { 
        if ($insong) { splay stop | msg %target 6...4 Song Stopped 6... }
        else { msg %target Song not started }
      }
      if ($1 == !pause) { 
        if ($insong) && (!$insong.pause) { splay pause | msg %target 6... 4Pausing song6... }
      }
      if ($1 == !resume) { 
        if ($insong) && ($insong.pause) { splay resume | msg %target 6... 4Resuming song6... }
      }
    }
  }

Comments

Sign in to comment.
kerstt   -  Jun 17, 2007

it\'s a regex trigger

on $:text:/!(play|stop|pause|resume|random)/Si::{

the $ makes it regex
/ makes it anywhere in the line /Si makes it incasesencitive and strips color, the rest is just standard regex with groups

 Respond  
Noutrious   -  Jun 17, 2007

It is useless, cause later he checks if it !stop or !play with \"if\", so You can use just on text event and don\'t bother.

 Respond  
Excellion   -  Jun 16, 2007

on $:text:/!(play|stop|pause|resume|random)/Si::{

someone explain this to me....i\'ve never seen the /!(play|stop|pause|resume|random)/Si part and i cannot find any documentation

thanks in advance

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.