mIRC Home    About    Download    Register    News    Help

Topic Options
#264144 - 04/11/18 05:07 AM Hard time understanding /filter command
StanSmith Offline
Nutrimatic drinks dispenser

Registered: 04/11/18
Posts: 5
All I'm trying to do is:

1. Look for all lines containing *text* in a #channel.
2. List those lines either in either same #channel window, status window or any other window.

All I can get working is /filter -ss *text*, which works in status window perfectly.

Anything else I try using switches in #channel windows, I either get "invalid window" or "invalid parameters." I can't find real-world examples either. All I need is to list matched text lines without any sorting or ranges.

Can anyone provide real-life examples? For example: Scan all lines in #mirc for text which contains *abc* and output those matching lines to either same window, status window or custom window.

Thanks.

Top
#264145 - 04/11/18 06:46 AM Re: Hard time understanding /filter command [Re: StanSmith]
Raccoon Offline
Hoopy frood

Registered: 18/02/03
Posts: 2504
Code:
/window -e @window
/filter -ww #channel @window *text*

(in fact, the -ww are generally optional)
_________________________
doin� things a particle can

Top
#264146 - 04/11/18 07:22 AM Re: Hard time understanding /filter command [Re: Raccoon]
StanSmith Offline
Nutrimatic drinks dispenser

Registered: 04/11/18
Posts: 5
Already tried that.

Tried it again by copying what you typed.

Still receiving: * /filter: invalid window

I'm on mIRC 7.52

Top
#264147 - 04/11/18 07:43 AM Re: Hard time understanding /filter command [Re: StanSmith]
Raccoon Offline
Hoopy frood

Registered: 18/02/03
Posts: 2504
It works on my copy of mIRC 7.52
Don't really know what to tell you.

Try this.
Code:
; /findall sometext
findall {
  var %src = $active, %win = @findall, %pattern = $(*,$1-,*)
  window -e %win
  filter -ww %src %win %pattern
  echo -tic notice %win --- Found $filtered matches in %src for %pattern $+ .
} ; by Raccoon 2018
_________________________
doin� things a particle can

Top
#264148 - 04/11/18 09:52 AM Re: Hard time understanding /filter command [Re: StanSmith]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 970
The only reasons you should have failed would be either

1. You used #channel instead of the actual Channel Name.
2. If you did the 2nd command in the status window of a different network than the one where the #channel is open.

Top
#264149 - 04/11/18 10:28 AM Re: Hard time understanding /filter command [Re: Raccoon]
StanSmith Offline
Nutrimatic drinks dispenser

Registered: 04/11/18
Posts: 5
Originally Posted By: Raccoon
It works on my copy of mIRC 7.52
Don't really know what to tell you.

Try this.
Code:
; /findall sometext
findall {
  var %src = $active, %win = @findall, %pattern = $(*,$1-,*)
  window -e %win
  filter -ww %src %win %pattern
  echo -tic notice %win --- Found $filtered matches in %src for %pattern $+ .
} ; by Raccoon 2018


A script solution isn't going to work for my needs.

Top
#264150 - 04/11/18 10:32 AM Re: Hard time understanding /filter command [Re: maroon]
StanSmith Offline
Nutrimatic drinks dispenser

Registered: 04/11/18
Posts: 5
Originally Posted By: maroon
The only reasons you should have failed would be either

1. You used #channel instead of the actual Channel Name.
2. If you did the 2nd command in the status window of a different network than the one where the #channel is open.


Same network. Proper names were used for existing channels and creation of new output windows. I even tried switching stuff around, trying different channels (I'm in all channels, NetAdmin) and different windows names, just in case there's a naming conflict.

Maybe someone can come up with 20 different lines I can try?


Edited by StanSmith (04/11/18 10:33 AM)

Top
#264151 - 04/11/18 10:37 AM Re: Hard time understanding /filter command [Re: StanSmith]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 970
If you paste this into the editbox in of the channel, this should work:

Code:
//window -c @window | window -en @window | filter -ww $active @window * | window -a @window


Top
#264152 - 04/11/18 11:00 AM Re: Hard time understanding /filter command [Re: maroon]
StanSmith Offline
Nutrimatic drinks dispenser

Registered: 04/11/18
Posts: 5
Originally Posted By: maroon
If you paste this into the editbox in of the channel, this should work:

Code:
//window -c @window | window -en @window | filter -ww $active @window * | window -a @window



Thanks, it works and I've added it to popups as this:

Code:
//window -c @window | window -en @window | filter -ww $active @window * $+ $$1 $+ * | window -a @window


(Basically looking for a history of everything a specific user has typed)

/filter switches room window *text* would still work better in my specific case. Does anyone have an idea why it's not working as, what seems like, was intended?

If there aren't any other ideas, that's fine. I can live with the alternative. Thanks for the input.

Edit:

This works too:

Code:
//window -c @ $+ $$1 | window -en @ $+ $$1 | filter -ww $active @ $+ $$1 * $+ $$1 $+ * | window -a @ $+ $$1


Edited by StanSmith (04/11/18 11:33 AM)

Top