mIRC Homepage

/play to a @window ?

Posted By: elroyK

/play to a @window ? - 04/08/03 03:51 PM

Is it possible to play a text file to a custom window instead of a channel or nick ? or with another command ?
Posted By: pheonix

Re: /play to a @window ? - 04/08/03 03:51 PM

/play @window?
Posted By: elroyK

Re: /play to a @window ? - 04/08/03 03:55 PM

/play only works on nicknames or channels. not custom windows
Posted By: Watchdog

Re: /play to a @window ? - 04/08/03 03:58 PM

The help file says that /play can only be used on # or ? windows, or Status with the -s switch.

Use this /play -e @Test blah.txt 500
Posted By: pheonix

Re: /play to a @window ? - 04/08/03 04:14 PM

Code:
alias aplay {
  var %i 1
  if (!$window($eval(@ $+ $gettok($1-,2,64),2)).x) { /window -a $eval(@ $+ $gettok($1-,2,64),2) }
  while (%i <= $lines($gettok($+(",$1-,"),1,64))) {
    $iif($read($gettok($+(",$1-,"),1,64),%i) == $null,goto next,echo $eval(@ $+ $gettok($1-,2,64),2) $read($gettok($+(",$1-,"),1,64),%i))
    :next
    inc %i
  }
}


i tested it on:
/aplay readme.txt @test
/aplay <filepath> <window>
Posted By: feud

Re: /play to a @window ? - 04/08/03 04:25 PM

depending on what you are attempting to use /play for, /loadbuf may work.
Posted By: Clubfoot

Re: /play to a @window ? - 04/08/03 04:43 PM

there is a command made intended for this called /filter
Posted By: elroyK

Re: /play to a @window ? - 04/08/03 06:21 PM

thanks, i'll use loadbuf.
Posted By: root

Re: /play to a @window ? - 04/08/03 08:41 PM

alias playwindow {
if ($window(@playwin)) {
window @playwin
}
%i = 1
while (%i <= $read(file.txt,0) {
aline @playwin $read(file.txt,%i)
inc %i
}
}
Posted By: feud

Re: /play to a @window ? - 04/08/03 08:50 PM

using $read(file.txt,0) is almost always a bad idea. this only returns the total number of lines if the first line of the file is a number. $lines(file.txt) is a more reliable alternative.
© 2021 mIRC Discussion Forums