mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2011
Posts: 23
Q
Quinch Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Nov 2011
Posts: 23
A possibly tricky question - is there a way to set up a script to not show a private message from users if it contains a certain string?

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
on ^*:text:*text*:?:{ haltdef }

Joined: Nov 2011
Posts: 23
Q
Quinch Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Nov 2011
Posts: 23
Well, that was much simpler than expected. As a followup question - if you're an op in a channel, is it possible to filter it out for everyone?

{this might be veering away from scripting itself, but beats making a separate topic}

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Code:
on @^*:text:*:?:{ haltdef }

Joined: Nov 2011
Posts: 23
Q
Quinch Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Nov 2011
Posts: 23
Hmm, that doesn't seem to work, but it's actually a moot point now. Another question, though - is it possible to haltdef while still executing other triggers? For example -

on ^*:text:!*:?:{ haltdef }
on ^*:text:*:?:/respond

- hides the message when I PM myself with "!test", but also doesn't return the echo. Is there a way to ignore the message, but also have other events based on that message fire as well?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Oh yeah, it wouldn't work would it? Private messages don't have ops :p

Anyway, I think you need to define more narrowly what you're trying to accomplish. The code you've provided is functional assuming that /respond exists - but maybe it isn't behaving how you expect it to. What do you mean by "doesn't return the echo"?

With the code you've provided !test will trigger the first event, not the second (because it has already triggered on the first and both share ^). Anything not beginning with ! will trigger the second.

Code:
on ^*:text:!*:?:haltdef
on *:text:!test:?:echo -ag $nick said !test
on *:text:!com:?:echo -ag $nick said !com
on *:text:!*:?:echo -ag $nick said any other command


Here all !commands are hidden but can still be processed when the other events fire.

Joined: Nov 2011
Posts: 23
Q
Quinch Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Nov 2011
Posts: 23
Ahh, okay. What's the ^ signify, then?

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
^ is used specifically to be able to halt text. You can look up its description under /haltdef

^ and non-^ are treated separately so events of both types can be fired by the same trigger.

Only the first event (of a given type) which matches the text is fired if multiple events are defined in the script.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
^ triggers before mIRC listens to the standard, default text, which allows you to halt it and apply your own custom settings.


Link Copied to Clipboard