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.
Old posts that have not been replied to for several years.
H
HeLLFyRe
Post
by HeLLFyRe » Wed May 28, 2003 5:07 am
Is there any way to possibly bind on a server notice?
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Wed May 28, 2003 5:08 am
Use the RAW bind to capture any message that isn't covered by the current set of binds.
H
HeLLFyRe
Post
by HeLLFyRe » Wed May 28, 2003 7:28 am
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
)
Papillon
Owner
Posts: 724 Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no
Post
by Papillon » Wed May 28, 2003 7:42 am
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
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Wed May 28, 2003 8:49 am
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.
Papillon
Owner
Posts: 724 Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no
Post
by Papillon » Wed May 28, 2003 9:22 am
o_O ... /me really should start to read the whole lines
Elen sila lúmenn' omentielvo