Advertisement
mruno

text play

Mar 29th, 2014
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. alias text.file.play {
  2.   ;Setup with Type /.timertext.file.play
  3.   ;Reset with /text.file.play reset
  4.   ;Stop with /text.file.play stop
  5.  
  6.   if ($1 == reset) { unset %text.file.play.* | timertext.file.play off }
  7.   elseif ($1 == stop) { timertext.file.play off | halt }
  8.  
  9.   if (!$timer(text.file.play)) {
  10.     if (!%text.file.play.file) set %text.file.play.file $sfile($scriptdir,Select a text file to "play")
  11.     :again
  12.     if (!%text.file.play.chan) {
  13.       set %text.file.play.chan $input(What channel do you want to "play" the file to? $crlf $+ Format: #channel,qe,Enter channel name)
  14.       if (%text.file.play.chan) && ($left(%text.file.play.chan,1) != $chr(35)) { unset %text.file.play.chan | goto again }
  15.     }
  16.     :again2
  17.     if (!%text.file.play.timer) {
  18.       set %text.file.play.timer $input(Enter how many minutes you want to wait between each line:,qe,Enter time)
  19.       if (%text.file.play.timer isnum) noop
  20.       elseif (%text.file.play.timer) { unset %text.file.play.timer | goto again2 }
  21.     }
  22.     if (%text.file.play.file) && (%text.file.play.chan) {
  23.       .timertext.file.play -o 0 $calc(%text.file.play.timer * 60) text.file.play
  24.       echo -tase  [!]  text.file.play activated. To stop, type /text.file.play stop
  25.     }
  26.     else .timertext.file.play off
  27.   }
  28.   else {
  29.     :redo
  30.     inc %text.file.play.line
  31.     if (%text.file.play.line > $lines(%text.file.play.file)) set %text.file.play.file1
  32.     var %msg $read(%text.file.play.file,n,%text.file.play.line)
  33.     if (!%msg) && (%text.file.play.file) goto redo
  34.     msg %text.file.play.chan %msg
  35.   }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement