mIRC Home    About    Download    Register    News    Help

Print Thread
Hard time understanding /filter command #264144 04/11/18 05:07 AM
Joined: Nov 2018
Posts: 8
S
StanSmith Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2018
Posts: 8
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.

Re: Hard time understanding /filter command [Re: StanSmith] #264145 04/11/18 06:46 AM
Joined: Feb 2003
Posts: 2,688
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,688
Code:
/window -e @window
/filter -ww #channel @window *text*

(in fact, the -ww are generally optional)


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Hard time understanding /filter command [Re: Raccoon] #264146 04/11/18 07:22 AM
Joined: Nov 2018
Posts: 8
S
StanSmith Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2018
Posts: 8
Already tried that.

Tried it again by copying what you typed.

Still receiving: * /filter: invalid window

I'm on mIRC 7.52

Re: Hard time understanding /filter command [Re: StanSmith] #264147 04/11/18 07:43 AM
Joined: Feb 2003
Posts: 2,688
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,688
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Hard time understanding /filter command [Re: StanSmith] #264148 04/11/18 09:52 AM
Joined: Jan 2004
Posts: 1,300
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,300
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.

Re: Hard time understanding /filter command [Re: Raccoon] #264149 04/11/18 10:28 AM
Joined: Nov 2018
Posts: 8
S
StanSmith Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2018
Posts: 8
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.

Re: Hard time understanding /filter command [Re: maroon] #264150 04/11/18 10:32 AM
Joined: Nov 2018
Posts: 8
S
StanSmith Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2018
Posts: 8
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?

Last edited by StanSmith; 04/11/18 10:33 AM.
Re: Hard time understanding /filter command [Re: StanSmith] #264151 04/11/18 10:37 AM
Joined: Jan 2004
Posts: 1,300
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,300
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


Re: Hard time understanding /filter command [Re: maroon] #264152 04/11/18 11:00 AM
Joined: Nov 2018
Posts: 8
S
StanSmith Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2018
Posts: 8
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

Last edited by StanSmith; 04/11/18 11:33 AM.