mIRC Home    About    Download    Register    News    Help

Print Thread
#136983 06/12/05 04:53 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I think it would be convenient, if we were able to stop the filter command from sending filtered lines to the specified alias when using the -k flag. Let me try to illustrate what I mean:

//filter -fk versions.txt myalias *var*

alias myalias {
; incoming line $1
inc %total
if (%total == 10) {
; we are satisfied with our filtered matches, and don't need the remaining lines to be sent to the alias
; /stopfilter
}
else {
; processing
}
}

Currently, the only thing we can do is make the alias return immediately if we have already met our global condition, something like:

alias myalias {
if (%total == 10) return
inc %total
; processing
}

or

alias myalias {
if (%total < 10) {
inc %total
; processing
}
}

However, there is overhead in this, in that filter keeps calling the alias for each filtered line, until all lines are processed. I wish it were possible to stop filtering in the middle of a filter.


Gone.
#136984 07/12/05 05:20 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Good idea, maybe a command just like you have /stopfilter, then apon return some flags been set that shuts down the filter.

I had the exact same problem, and the file was getting overly large, i tried echo $$99 hoping the $$ would cause the filter to abort (it didnt just that instance of the called alias), i then tried just $$99 on its own same effect although a bit faster, I finally put the alias in a group and disabled the group so there was no alias to call, bit faster again. I finally just abandoned filter and fopened the file looped my way down untill eof or my filter stop flag was triggered.

Still way way slower than just being able to stop the filter!

#136985 07/12/05 12:36 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Signed. Either adding /stopfilter or making /halt do the job would be nice.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#136986 07/12/05 02:25 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
liking the sugestion, all the small bits that can help mircscript run faster are more then welcome by me smile


$maybe

Link Copied to Clipboard