It work out nicely now!
If it can punish (deop the user) who deop or ban the bot nick will be even greater.
simo wrote:edited
Code: Select all
bind MODE - * protect:modes
proc protect:modes {nick uhost hand chan mode target} {
global botnick
if {[isbotnick $nick]} return
if {[matchattr $hand n]} return
switch -- $mode {
"-o" {
if {[isbotnick $target]} { puthelp "chanserv op $chan $botnick" ; puthelp "mode $chan -o $nick" }
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
"+b" {
if {![matchaddr $target $::botname]} return
if {[botisop $chan]} { puthelp "mode $chan -b $target" ; puthelp "mode $chan -o $nick" } else { puthelp "chanserv unban $chan $botnick" ; puthelp "chanserv deop $chan $nick" }
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
}
Code: Select all
bind MODE - * protect:modes
proc protect:modes {nick uhost hand chan mode target} {
global botnick
if {[isbotnick $nick]} return
if {[matchattr $hand n]} return
switch -- $mode {
"-o" {
if {[isbotnick $target]} {
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
puthelp "chanserv deop $chan $nick"
puthelp "chanserv op $chan $botnick"
}
}
"+b" {
if {![matchaddr $target $::botname]} return
if {[botisop $chan]} { puthelp "mode $chan -b $target" ; puthelp "mode $chan -o $nick" } else { puthelp "chanserv unban $chan $botnick" ; puthelp "chanserv deop $chan $nick" }
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
}
Yep! that is correct, although in DalNET(following users above request to make it work for DalNET), you have to either useCrazyCat wrote:My 2 cents: using puthelp "PRIVMSG ChanServ :deop $chan $nick" might be better than puthelp "chanserv deop $chan $nick" as the command chanserv is a server-specific alias.
Code: Select all
puthelp "PRIVMSG ChanServ@services.dal.net :deop $chan $nick"
Code: Select all
puthelp "Chanserv :deop $chan $nick"
simo wrote:edited:
Code: Select all
bind MODE - * protect:modes proc protect:modes {nick uhost hand chan mode target} { global botnick if {[isbotnick $nick]} return if {[matchattr $hand n]} return switch -- $mode { "-o" { if {[isbotnick $target]} { puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002" puthelp "chanserv deop $chan $nick" puthelp "chanserv op $chan $botnick" } } "+b" { if {![matchaddr $target $::botname]} return if {[botisop $chan]} { puthelp "mode $chan -b $target" ; puthelp "mode $chan -o $nick" } else { puthelp "chanserv unban $chan $botnick" ; puthelp "chanserv deop $chan $nick" } puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002" } } }
Code: Select all
bind mode - "*-*o*" self-pro:autoreop
proc self-pro:autoreop {nick uhost hand chan mode target} {
global botnick
if {($target == $botnick)} {
putquick "cs op $chan"
}
}
bind kick - * prot:kick
proc prot:kick {nick uhost handle channel theone arg} {
global botnick
if {[string tolower $theone] == [string tolower $botnick] } {
if {[matchattr handle o]} { return 0 }
putserv "cs unban $channel"
putserv "cs invite $channel"
putserv "join $channel "
pushmode $channel +o $botnick
return 0
}
}
bind mode - "* +b" prot_ban
proc prot_ban {nick uhost hand chan mc ban} {
global botnick botname
if {[string match "$ban" "$botname"]} {
putserv "cs unban $chan $botnick"
} else {
set pnicks ""
foreach user [chanlist $chan b] {
if {[matchattr [nick2hand $user $chan] o]} {lappend pnicks $user}
}
foreach pnick $pnicks {
if {[string match "$ban" "$pnick![getchanhost $pnick $chan]"]} {
putserv "cs unban $chan $botnick"
}
}
}
}
simo wrote:when a random chanops gets deopped it sends out the text?
that seems odd since its checks if the BOT is deopped and only the BOT