Hi.
can someone tell me some chanmodes locker script? Because i am trying use normal chanmode of eggdrop, but it isn't sensitive to uppercase.
Regards,
Code: Select all
# script to retain preconfigured channel modes
# checks current modes when the bot comes online and corrects them if required
# checks mode changes and reverses them if required
# script has limited functionality (will not deal with channel modes requuiring an additional argument +b, -b, +k, +l etc)
# modes configured below must not conflict with mlocked modes otherwise the script will attempt to fight channel services
# set here the channel modes not allowed to be set +mode
# maximum one line per channel
# channel name must be lower case
# modes must be a space delimited list
array set vRetainMode0 {
"#eggtcl" {c R}
"#atlantis" {M}
}
# set here the channel modes required to be set +mode
# maximum one line per channel
# channel name must be lower case
# modes must be a space delimited list
array set vRetainMode1 {
"#eggtcl" {M}
}
bind JOIN - * pRetainModeJoin
bind MODE - * pRetainModeMode
proc pRetainModeJoin {nick uhost hand chan} {
if {[isbotnick $nick]} {
set channel [string tolower $chan]
utimer 10 [list pRetainModeDelay $channel]
}
return 0
}
proc pRetainModeMode {nick uhost hand chan mode target} {
global vRetainMode0 vRetainMode1
set channel [string tolower $chan]
switch -- [string index $mode 0] {
- {
if {[info exists vRetainMode1($channel)]} {
if {[lsearch -exact $vRetainMode1($channel) [string index $mode 1]] != -1} {
pRetainModeSet 1 $channel [string index $mode 1]
}
}
}
+ {
if {[info exists vRetainMode0($channel)]} {
if {[lsearch -exact $vRetainMode0($channel) [string index $mode 1]] != -1} {
pRetainModeSet 0 $channel [string index $mode 1]
}
}
}
default {}
}
return 0
}
proc pRetainModeDelay {chan} {
global vRetainMode0 vRetainMode1
if {[info exists vRetainMode0($chan)]} {
foreach mode $vRetainMode0($chan) {
if {[regexp -- [subst -nocommands -nobackslashes {\+[^\-]*$mode}] [getchanmode $chan]]} {
pRetainModeSet 0 $chan $mode
}
}
}
if {[info exists vRetainMode1($chan)]} {
foreach mode $vRetainMode1($chan) {
if {![regexp -- [subst -nocommands -nobackslashes {\+[^\-]*$mode}] [getchanmode $chan]]} {
pRetainModeSet 1 $chan $mode
}
}
}
return 0
}
proc pRetainModeSet {type chan mode} {
if {[botisop $chan]} {
switch -- $type {
0 {pushmode $chan -$mode}
1 {pushmode $chan +$mode}
default {}
}
flushmode $chan
}
return 0
}
# eof