mIRC Home    About    Download    Register    News    Help

Print Thread
#260518 04/05/17 10:01 AM
Joined: May 2017
Posts: 4
O
Ondrej Offline OP
Self-satisified door
OP Offline
Self-satisified door
O
Joined: May 2017
Posts: 4
I need to hide/ignore only lines wich contain specific word, just lines not the user. How to do that? Thanks

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
on ^*:TEXT:*word*:*:{
echo -s halted line content from $nick : $strip($1-)
haltdef
}

Note that this would halt a lot of things it shouldn't, such as 'sword'. But if you added spaces to trap only on :* word *: it won't block the first or last words, or if it's touching quotes or punctuation. Also, neither would block the word if it contained color codes in the middle. Perhaps the word you're trying to block won't be part of other words.

To block color codes inside the word, you can monitor all text, then have code inside the ON event to check for it:

on ^*:TEXT:*word*:*:{
if ( *word* !iswm $strip($1-) ) return
echo -s $event halted line content from $nick : $strip($1-)
haltdef
}

To trap someone who does: /me word
you can repeat the above routine, using :ACTION: in place of :TEXT:

Joined: May 2017
Posts: 4
O
Ondrej Offline OP
Self-satisified door
OP Offline
Self-satisified door
O
Joined: May 2017
Posts: 4
thanks , still confused

Example: I want to ignore (in the channel) all the lines wich contain the word "example"

what is the sintaxe and where to put that sintaxe?

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
simplest is assuming it's not a word that won't have false matches, like the way "word" is inside "sword" is within other words:

Code:
on ^*:TEXT:*example*:#*:{
  echo -s halted line in $chan from $nick $+ : $1-
  haltdef
}

it's the same things i showed above. The code gets pasted into a script within the remotes window (press Alt-R key)

Joined: May 2017
Posts: 4
O
Ondrej Offline OP
Self-satisified door
OP Offline
Self-satisified door
O
Joined: May 2017
Posts: 4
Thank you, I`ll try.
Let`s supose I want to ignore lines wich contain a second word. I must to add another sintaxe, right?

Last edited by Ondrej; 04/05/17 07:43 PM.
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
For that, capture all TEXT events, then check for them individually. If you want to do this on just 1 of several channels, change the # to #TheActualChannelName

Code:
on ^*:TEXT:*:#*:{
if ( *word1* iswm $1- ) goto ignored
if ( *word2* iswm $1- ) goto ignored
return

:ignored
  echo -s halted line in $chan from $nick $+ : $strip($1-)
  haltdef
}

Joined: May 2017
Posts: 4
O
Ondrej Offline OP
Self-satisified door
OP Offline
Self-satisified door
O
Joined: May 2017
Posts: 4
Got it. Already working!
Now i will try sintaxe for multiple words. May be useful for others
/Work it sintaxe for multiple words!
You helped me and many users, a lot. Thank you very much!

Last edited by Ondrej; 04/05/17 09:03 PM.

Link Copied to Clipboard