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 notc

Old posts that have not been replied to for several years.
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

bind notc

Post by lsn »

Code: Select all

set home "#somechan"

bind notc - "*is now operator*" op:say

proc op:say {nick uhost hand text {dest ""}} {
               global botnick home; if {$dest == ""} {set dest $botnick}
               puthelp "PRIVMSG $home :Someone use oper command"
             }
is not working, can you help me ? :wink:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Remember you are trying to trigger the notice on a channel so $botnick != $dest. Meaning the destination will not be the bot's nick, it will be your channel in the variable $home. :P
Okay... use this. :mrgreen:

Code: Select all

set home "#somechan"

bind notc - "*" op:say

proc op:say {nick uhost hand text {dest ""}} {
 global botnick home
  if {(![isbotnick $dest]) && ([string equal -nocase $home $dest]) && ([string match -nocase "*is now an operator*" $text])} {
   puthelp "PRIVMSG $home :$nick used the oper command!"
   return 0
   }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

Post by lsn »

not working

bot get notice from server

Code: Select all

[08:41:16] <bot> -NOTICE- *** Notice -- nick (ident@host) is now operator (O)
and cod is not working :cry:
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

Quoted from tcl-commands.doc:

Code: Select all

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.
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

Post by lsn »

hm... so what can i do then ? :P
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

lsn wrote:hm... so what can i do then ? :P
you can bind to raw:

Code: Select all

    (17) RAW (stackable)
         bind raw <flags> <keyword> <proc>
         procname <from> <keyword> <text>

         Description: previous versions of Eggdrop required a special compile
           option to enable this binding, but it's now standard. The keyword
           is either a numeric, like "368", or a keyword, such as "PRIVMSG".
           from will be the server name or the source user (depending on
           the keyword); flags are ignored. The order of the arguments is
           identical to the order that the IRC server sends to the bot. The
           pre-processing  only splits it apart enough to determine the
           keyword. If the proc returns 1, Eggdrop will not process the line
           any further (this could cause unexpected behavior in some cases).
         Module: server
or bind to msgm, as a PRIVMSG.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

This should be binded to the server notice. The 'bind notc' will not trigger when a server notice occurs. Bind notc only work of private/channel notices sent to the bot.

Yes you will need to bind to raw, if a raw key number is present then it will be better, otherwise just string match the $arg/$text.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

there is no raw number code for a server notice, it is a keyword... NOTICE... simple as that...

bind raw - "NOTICE" proc_to_call
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

Post by lsn »

Code: Select all

set home "#chan"

bind raw -|- "NOTICE *is now operator*" operjoin

proc operjoin {from idx args} { 
   global botnick home
 set nick [lindex [lindex $args 0] 4]
 puthelp "PRIVMSG $home :OPERJOIN: $nick is now an IRCoperator"
 return 0 
}

bind raw -|- "NOTICE *HACK(4)*" operop

proc operop {from idx args} { 
   global botnick home
 set nick [lindex [lindex $args 0] 5]
 puthelp "PRIVMSG $home :OPERJOIN: $nick opmode command"
 return 0 
}


where i can define what notice he will use, because ,like is here he take only the first raw :wink:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Here you can use it like this. Define a match pattern and do a string match in the proc rather than matching your pattern in the bind itself.

Oh and by the way "return 1" on raw's not 'return 0' or 'return'. Returning 1 will cause no further action to be taken place after your proc has ended. It is the opposite of what is used in other binds. See tcl-commands.doc for more info on 'bind raw'.

Code: Select all

### VARIABLES ###
set home "#mychan"
set notice "is now operator"

### SCRIPT ###
bind raw - NOTICE oper:up

proc oper:up {from keyword arg} {
 global home notice
 if {([string match "*$notice*" $arg])} {
  putserv "PRIVMSG $home :OPERUP: [lindex [lindex $arg 0] 5] is now an IRC Operator."
   return 1
   }
}
Last edited by awyeah on Mon Sep 27, 2004 1:10 am, edited 1 time in total.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

Post by lsn »

ok, and for the second one ? :mrgreen:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Define another raw with a new notice variable and a new proc.

If you have many like this you can combine all in one, but you will need a foreach loop and your patterns must be stored in list which you would have to do a string match on for each element in the list. The first pattern to be matched against the notice will trigger your putserv function. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

Post by lsn »

Code: Select all

OPERUP:  is now an IRC Operator.
not recognize

Code: Select all

[lindex [lindex $arg 0] 5]
:cry:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Show me the output of the server notice, so I can split the correct lindex to get the nick. You have done it wrong. Add this line in your proc:

Code: Select all

putlog "OPER UP: $arg"
Like this:
putlog "OPER UP: $arg"
putserv "PRIVMSG $home :OPERUP: [lindex [lindex $arg 0] 5] is now an IRC Operator."

Trigger the script and check in DCC with the bot the what result you get and paste it here.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
l
lsn
Voice
Posts: 25
Joined: Mon Jul 19, 2004 8:11 am

Post by lsn »

i get

Code: Select all

[08:43:56] <aZ> OPER UP: * :*** Notice -- nick (ident@host) is now operator (O)
Locked