This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Bind on snotices?

Old posts that have not been replied to for several years.
Locked
H
HeLLFyRe

Bind on snotices?

Post by HeLLFyRe »

Is there any way to possibly bind on a server notice?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Use the RAW bind to capture any message that isn't covered by the current set of binds.
H
HeLLFyRe

Err.. Tried, but.. :/

Post by HeLLFyRe »

So, say I'd want to bind on all snotices which contain the phrase "the virtual hostname", I'd use bind raw *|* - "*the virtual hostname*" my_proc ? (I haven't used masks before :o)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

yes the bind is correct, masks are really easy..
* = anything (even blank space)
? = single character
[char] = any charcter in the given range
\c = "escapes" a single charcter (usefull if macthing against close-brackets
Elen sila lúmenn' omentielvo
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The mask for RAW is a single command.

This could be NOTICE, PRIVMSG, PING or any other of the countless RAW commands.

You have to parse the incoming message inside the procedure, and work out if it is the message you want, not in the BIND.

Note, make sure you allways force a "return 0" with the RAW bind, as it can catch you off guard and make your bot unusable.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

o_O ... /me really should start to read the whole lines :oops:
Elen sila lúmenn' omentielvo
Locked