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"
}
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.
Okay... use this.
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.
==================================
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.
(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
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.
==================================
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
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'.
### 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.
==================================
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.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================