mIRC Home    About    Download    Register    News    Help

Print Thread
#132678 13/10/05 06:40 AM
Joined: Jan 2004
Posts: 133
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jan 2004
Posts: 133
Can you Limit how many lines the play command does ?

say you use : filter -ffce < to find something in a txt file
and it finds 30 lines that match ..

and use the play command to play what you find ..

but want to limit it to play 5 lines ..

Help ?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Make a custom alias and use that with /play -a.

/play -a shortplay chan myhugefile.txt 1500

Code:
alias shortplay {
  inc %shortplay
  set -u10 %shortplay %shortplay
  if (%shortplay &lt; 5) { msg chan $1- }
  else {
    unset %shortplay
    play stop
  }
}


That's just a quick example and could probably be improved. It's just to give you an idea.

Note that the set -u10 line is there just to prevent the variable from staying set if you play a file with under 5 lines.


Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2004
Posts: 133
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jan 2004
Posts: 133
as always Riamus2 ...

You Rock .. Thanks smile

However i need to notice $nick not the channel ..
i tried to fix it .. but i get a error ..

Works still .. even with the error .. lol anyway .. any thoughts ?

/play -a shortplay $nick longtxtfile 1000

alias shortplay {
inc %shortplay
set -u10 %shortplay %shortplay
if (%shortplay < 5) { notice $nick $1- }
else {
unset %shortplay
play stop
}
}

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
I see no direct problem with the code. It works fine for me. Can you paste the error please?

Note: If you dont want to see all the messages prefix the play and notice commands with a period. fex .play stop .play -a .notice $nick


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby

Link Copied to Clipboard