bind mode - "*-*o*" protect:autoreop
proc protect:autoreop {nick uhost hand chan mode target} {
global botnick
if {($target == $botnick) && ($nick != $botnick)} {
putnow "privmsg chan op $chan $botnick"
putnow "mode $chan -o $nick"
putnow "privmsg $nick :$nick \002 what you are doing is not helping the smooth running of the channel\002"
putnow "privmsg MEMO send owner :$nick removed @ from $chan's $botnick"
}
}
bind mode - "* +b" prot_banX
proc prot_banX {nick uhost hand chan mc ban} {
global botnick botname
if {[string match "$ban" "$botname"]} {
putnow "privmsg chan unban $chan $botnick"
putnow "privmsg $nick :\002what you are doing is not helping the smooth running of the channel\002"
putnow "privmsg MEMO send owner :$nick bans $botnick from $chan"
putnow "mode $chan -o $nick"
}
}
thank you in advance for all the help provided, thanks to people like you, this does not fall into oblivion.
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" {
puthelp "PRIVMSG Chan dop $chan $nick"
puthelp "PRIVMSG Chan op $chan $botnick"
puthelp "PRIVMSG $nick :$nick \002 what you are doing is not helping the smooth running of the channel\002"
puthelp "PRIVMSG Memo send owner :$nick removed @ from $chan's $botnick"
}
"+b" {
if {![matchaddr $target $::botname]} return
if {[botisop $chan]} {
puthelp "MODE $chan -b $target"
} else {
puthelp "PRIVMSG chan unban $chan $botnick"
puthelp "PRIVMSG Chan op $chan $botnick"
}
puthelp "PRIVMSG $nick :\002what you are doing is not helping the smooth running of the channel\002"
puthelp "PRIVMSG Memo send owner :$nick banned $target on $chan that is matching my address."
}
}
}
The matchaddr command doesn't exist in eggdrop versions below 1.6.20 if recall right, so in case you run an older version replace:
@simo by any chance you had n flag? that's the only option that makes sense not to trigger anything.
@ComputerTech since I put the switch there we don't need to bind everything separately.
Also, use isbotnick when you want to check if any given nick is bot, I mean instead of [$target == $botnick] or [$nick == $botnick]} use [isbotnick $target] or [isbotnick $nick]
Once the game is over, the king and the pawn go back in the same box.
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 op $chan $botnick"
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 "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
} else {
puthelp "privmsg chan unban $chan $botnick"
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
}
}
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 op $chan $botnick"
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 "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
} else {
puthelp "privmsg chan unban $chan $botnick"
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
}
}
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 "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" } else { puthelp "chanserv unban $chan $botnick" }
puthelp "PRIVMSG $chan :\002 $nick what you are doing is not helping the smooth running of the channel\002"
}
}
}