Code: Select all
set chanserv "chanserv@Services.dal.net"
set thechannel "#yourchannel"
bind kick - * kick:remove
bind notc - "* has AOp access to *" check:verify
proc kick:remove {nick uhost hand chan targ rsn} {
if {$targ == $::botnick} {
if {[string match $chan $::thechannel]} {
putserv "PRIVMSG $::chanserv :why $chan $nick"
}
}
}
proc check:verify {nick host hand arg dest} {
if {[string equal $dest $::botnick]} {
putserv "PRIVMSG $::chanserv :AOp $::thechannel del [lindex [split $arg] end]"
}
}
Code: Select all
set arg [ctrl:filter $arg]
proc ctrl:filter {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
I knew its gonna be a probset chan [string trim [lindex [split $arg] 5] .]
set opnick [string trim [lindex [split $arg] end] .]
Code: Select all
# Full name of channel services
set chanserv "chanserv@Services.dal.net"
# Channel *not* to function in
set nogo "#channelname"
bind kick - * kick:remove
bind notc - "* has AOp access to *" check:verify
proc kick:remove {nick uhost hand chan targ rsn} {
if {$targ == $::botnick} {
if {![string match $chan $::nogo]} {
putserv "PRIVMSG $::chanserv :why $chan $nick"
}
}
}
proc check:verify {nick host hand arg {dest ""}} {
regexp -all {\002} $arg
if {[string equal $dest $::botnick]} {
set offender [lindex [split $arg] 0]
set chan [string trim [lindex [split $arg] 5] .]
set opnick [string trim [lindex [split $arg] end] .]
set thehand [findhand $offender [getchanhost $offender]]
if {$offender != "" && $thehand != "*"} {
deluser $thehand
}
putquick "PRIVMSG $::chanserv :aop $chan del $opnick"
putquick "MODE $chan -o $offender"
putkick $chan $offender "You tit head, you just lost access!"
}
}
# findhand - tries to find a handle
proc findhand {nick host} {
if {[validuser $nick]} {
return $nick
} else {
set thehand [nick2hand $nick]
if {[validuser $thehand]} {
return $thehand
}
set thehand [finduser $host]
return $thehand
}
}
### End ###
putlog "TCL \002loaded\002: Kick Remove."
Sir_Fz wrote:man, u said u want it to work when someone does /mode #channel kick botname.
anyway add this code to make the bot work on /kick #channel botname.note:do not remove Papillon's code, leave it and add this one into it.Code: Select all
bind kick - * kick:remove proc kick:remove { nick uhost hand chan targ rsn } { if {$targ == $::botnick} { putserv "PRIVMSG X :verify $nick" } }