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 Server Notices

Help for those learning Tcl or writing their own scripts.
Post Reply
F
Fill
Halfop
Posts: 80
Joined: Sun Jan 18, 2009 6:08 pm

Bind Server Notices

Post by Fill »

Hi scripters,

I wonder how can I bind snotices? I read tcl-commands.doc and it seems like bind NOTC will not be triggered by servernotices. I have to make a script that is activaterd by a server notice. How can I bind it?

Thanks in advance,
Fill
g
garfwen
Halfop
Posts: 61
Joined: Wed Mar 12, 2008 5:16 pm

Post by garfwen »

Code: Select all

bind notc - * myproc

proc myproc {nick host handle text} {
   putlog "$nick noticed me! (Text: $text)
}

F
Fill
Halfop
Posts: 80
Joined: Sun Jan 18, 2009 6:08 pm

Post by Fill »

Hi,

Sorry to tell you, but that's wrong. According to tcl-commands.doc, bind NOTC command will not be triggered by server notices:

Code: Select all

    (7)  NOTC (stackable)
         bind notc <flags> <mask> <proc>
         procname <nick> <user@host> <handle> <text> <dest>

         Description: dest will be a nickname (the bot's nickname,
           obviously) or a channel name. mask is matched against the entire
           notice and can contain wildcards. It is considered a breach of
           protocol to respond to a /notice on IRC, so this is intended for
           internal use (logging, etc.) only. Note that server notices do
|          not trigger the NOTC bind. If the proc returns 1, Eggdrop will
|          not log the message that triggered this bind.

           New Tcl procs should be declared as
             proc notcproc {nick uhost hand text {dest ""}} {
               global botnick; if {$dest == ""} {set dest $botnick}
               ...
             }
           for compatibility.
         Module: server
Anyway, I discovered how I can do it. bind raw will solve it.

Something like:

Code: Select all

bind raw - "NOTICE" proc
See ya, and thanks for the help anyway
Post Reply