and eggdrop notice the operator "Please let me handle the channel mode settings."* Operator sets mode: +mRsC
*Eggdrop sets mode: -mRsC
Thanks in advance.
and eggdrop notice the operator "Please let me handle the channel mode settings."* Operator sets mode: +mRsC
*Eggdrop sets mode: -mRsC
Code: Select all
bind mode * "% +mRsC" mode:check
proc mode:check {nick uhost handle channel change target} {
if {[isbotnick $nick]} return
pushmode $channel -mRsC
putserv "NOTICE $nick :Please let me handle the channel mode settings."
}
Code: Select all
set lockModes "mRsC"
bind mode * * mode:check
proc mode:check {nick uhost handle channel change target} {
global lockModes
if {[isbotnick $nick]} return
foreach m [split $lockModes ""] {
if {![string match "*$m*" $change]} continue
lappend modes $m
}
if {![isset $modes]} return
pushmode $channel -$modes
putserv "NOTICE $nick :Please let me handle the channel mode settings."
}
Code: Select all
set lockModes "mRsC"
bind raw - "MODE" raw:modeCheck
proc raw:modeCheck {from key text} {
set nick [lindex [split $from "!"] 0]
#Sanity check
if {[isbotnick $nick]} {
return 0
}
set items [split $text]
set lock [split $::lockModes ""]
set target [lindex $items 0]
set add 1
set act 0
foreach mode [split [lindex $items 1] ""] {
switch -- $mode {
"+" {
set add 1
}
"-" {
set add 0
}
"I" -
"e" -
"b" {
set items [lreplace $items 2 2]
}
"k" {
if {$add} {
set key [lindex $items 2]
set items [lreplace $items 2 2]
}
}
"l" {
if {$add} {
set limit [lindex $items 2]
set items [lreplace $items 2 2]
}
}
default {
if {[lsearch -- $lock $mode] >= 0 && !$add} {
pushmode $target "+$mode"
set act 1
} elseif {[lsearch -- $lock $mode] < 0 && $add} {
pushmode $target "-$mode"
set act 1
}
}
}
#Uncomment this to bounce key and limits
#if {[info exists key]} {
# pushmode $target -k $key
#}
#if {[info exists limit]} {
# pushmode $target -l
#}
if {$act} {
puthelp "NOTICE $nick :Please let me handle the channel mode settings."
}
}
return 0
}
Code: Select all
bind raw - "MODE" raw:noticeMode
proc raw:noticeMode {from key text} {
set nick [lindex [split $from "!"] 0]
set handle [nick2hand $nick]
set channel [lindex [split $text] 0]
#Don't bug owners or bots
if {![matchattr $handle "+nb"]} {
puthelp "NOTICE $nick :Please let me handle the channel mode settings."
}
return 0
}
Code: Select all
bind raw - "MODE" raw:noticeMode
proc raw:noticeMode {from key text} {
set nick [lindex [split $from "!"] 0]
set handle [nick2hand $nick]
set channel [lindex [split $text] 0]
#Don't bug owners or bots
if {![matchattr $handle "+nb"]} {
puthelp "NOTICE $nick :Please let me handle the channel mode settings."
}
return 0
}
Code: Select all
.chattr otherbot +m #thechannel
Code: Select all
--- eggdrop1.6.20/src/mod/irc.mod/mode.c 2010-07-01 18:10:49.000000000 +0200
+++ eggdrop1.6.20+modelock/src/mod/irc.mod/mode.c 2011-08-12 18:16:15.256931403 +0200
@@ -1323,7 +1323,8 @@
if ((((ms2[0] == '+') && (chan->mode_mns_prot & todo)) ||
((ms2[0] == '-') && (chan->mode_pls_prot & todo))) &&
!glob_master(user) && !chan_master(user) &&
- !match_my_nick(nick))
+ !glob_friend(user) && !chan_friend(user) &&
+ !glob_bot(user) && !match_my_nick(nick))
add_mode(chan, ms2[0] == '+' ? '-' : '+', *chg, "");
else if (reversing && ((ms2[0] == '+') ||
(chan->mode_pls_prot & todo)) && ((ms2[0] == '-') ||
Code: Select all
set timechks 30
timer $timechks snowbotchk
proc snowbotchk {} {
global timechks
foreach chan [channels] {
if {[botisop $chan] && [isbotnick $nick] && ![string equal "Eggdrop" $nick]} {
if {[string match +*m* [lindex [getchanmode $chan] 0]]} {
pushmode #bot -m
}
} elseif {[string match +*M* [lindex [getchanmode $chan] 0]]} {
pushmode #bot -M
}
} elseif {[string match +*R* [lindex [getchanmode $chan] 0]]} {
pushmode #bot -R
}
}
timer $timechks snowbotchk
Code: Select all
nml375@linux:~/eggdrop1.6.20$ patch -p1 modelock.patch
Code: Select all
patching file src/mod/irc.mod/mode.c
Hunk #1 succeeded at 1323 with fuzz 1.
nml375@linux:~/eggdrop1.6.20$
Code: Select all
set lockModes "mRsC"
bind raw - "MODE" raw:modeCheck
proc raw:modeCheck {from key text} {
set nick [lindex [split $from "!"] 0]
#Sanity check
if {[isbotnick $nick]} {
return 0
}
set items [split $text]
set lock [split $::lockModes ""]
set target [lindex $items 0]
set add 1
set act 0
foreach mode [split [lindex $items 1] ""] {
switch -- $mode {
"+" {
set add 1
}
"-" {
set add 0
}
"I" -
"e" -
"b" {
set items [lreplace $items 2 2]
}
"k" {
if {$add} {
set key [lindex $items 2]
set items [lreplace $items 2 2]
}
}
"l" {
if {$add} {
set limit [lindex $items 2]
set items [lreplace $items 2 2]
}
}
default {
if {[lsearch -- $lock $mode] >= 0 && !$add} {
pushmode $target "+$mode"
set act 1
} elseif {[lsearch -- $lock $mode] < 0 && $add} {
pushmode $target "-$mode"
set act 1
}
}
}
#Uncomment this to bounce key and limits
#if {[info exists key]} {
# pushmode $target -k $key
#}
#if {[info exists limit]} {
# pushmode $target -l
#}
if {$act} {
puthelp "NOTICE $nick :Please let me handle the channel mode settings."
}
}
return 0
}