mIRC Homepage
Posted By: Hrung /play range - 20/07/04 11:07 PM
I think that /play should allow some sort of range of line numbers, such as /play -l5-10 etc. to play lines 5 through 10 of the file. If necessary, a new -switch could be added, but I think that just extending -l would work well enough... unless there's some other way to do this that I just cannot find.
Posted By: Coolkill Re: /play range - 20/07/04 11:57 PM
Might be an idea, keep, -f and add another parameter to indicate a stopping line.. something very basic like:

alias playme {
if (!$4) { echo -a Syntax: /playme start stop where file }
else {
set %playme.start $1 | set %playme.stop $2
play $+(-f,$1,a) /playmecatch $3 $+(",$4-,")
}
}

alias playmecatch {
inc %playme.start 1
if (%playme.start > %playme.stop) { play stop }
else { msg $1 $2- }
}


Syntax: /playme 5 10 Coolkill moo.txt

Plays lines 5 - 10, Might be some sortta work around.

Eamonn.
Posted By: argv0 Re: /play range - 21/07/04 01:24 AM
Hmm, that code made me realize some other "lackings" of /play

For one, /play stop is documented in the help to stop and clear ALL items in the /play queue list. Using your code, CoolKill, would stop any other /play proecedures if they were queued after or before.

Whatever the case, it would be nice to see /play stop be able to stop only certain items, possibly also having a range (n-n2).

Finally, a note to your script CoolKill. If someone were to queue two items for range play using your script, it would simply break, because it will only save one range at a time; if a workaround were to be made (and of course there are MANY workarounds to a /play range feature, i dont think a lack of functionality was the reason for the request, rather for simplicity) it would have to support multiple queues just like /play can

Posted By: Coolkill Re: /play range - 21/07/04 09:24 AM
Firstly the code was merely an example of how one would go about it and was given as a gesture, theres no need to be rude.

Secondly, there is also no need for someone to play simultanous files, or at the very least i've never seen the need.

Thirdly, if "someone" wants to queue two items at the same time, they can very well edit the code to suit.

Eamonn.
Posted By: Iori Re: /play range - 22/07/04 10:17 AM
Yeah a range for /play would be nice. I made this when I needed it for some reason. Takes advantage of the -r(ange) switch in /filter smile
Code:
alias playrange {
  var %x = $iif(-* iswm $1,$1),%y = $iif($gettok($1-,-1,32) isnum,$v1)
  if b isin %x { echo -aic i * /playrange: Can't use the -b switch | return  }
  if a isin %x { var %x = $1-2 | tokenize 32 $3- }
  elseif %x { tokenize 32 $2- }
  if !$4 || $2 < $1 || $1 == 0 || $2 == 0 {
    echo -aic i * Syntax: /playrange [switches] [alias] <start> <stop> <target> <file name> [delay]
    return
  }
  if %y { tokenize 32 $($+($,1-,$calc($0 -1)),2) }
  var %i = $lines($4-)
  if %i < $1 { echo -aic i * /playrange: Range out of bounds | return }
  if %i < $2 { tokenize 32 $1 %i $3- }
  var %a = $ticks
  filter -ffr $+($1,-,$2) $+(",$remove($4-,"),") %a
  play %x $3 %a %y
  .remove %a
}


/playrange [switches] [alias] <start> <stop> <target> <file name> [delay]
© mIRC Discussion Forums