greetings, im using this tcl at the moment it checks for the modes that lock channel incase some OP forgot to remove them i was wondering if it could be modified to only remove the actuall modes that are set and detected unlike as it is now where it removes the modes anyway regardless if they are set or not
########################################################################
### checklock.tcl v.1.0 ###
### checklock.tcl v1.0 has been made and development ###
### BY ###
### (c) SnowBot (ha0) Script Team Development (c) ###
### *** Copyright (C) 1999-2002 Clovis #Mania @ DalNet *** ###
### The purpose from this script is for educational only ###
### Not available for commercial purpose ###
### For contact you can email me at hendra_asianto@hotmail.com ###
### Our Homepage on www.snowbot.s5.com or visit our chan on #mania ###
########################################################################
#######################################################################
## --- Don't change anything below here if you don't know how ! --- ###
## ---------------------------------------------------------------- ###
## NOTE : THIS SCRIPT CAN SET BECOME AUTO AWAY .TCL WITH RANDOM AWAY MSG :)
## DEPEND'S YOUR IDEAL :)NOW... I JUST CAN GIVE A LITTLE WAY
# Set how long that bot must check modelock back again.
set timechks 30
# Version number - DON'T TOUCH!
### Start Call Command
timer $timechks snowbotchk
proc snowbotchk {} {
global timechks
foreach chan [channels] {
if {[botisop $chan]} {
if {[string match +*m* [lindex [getchanmode $chan] 0]] || [string match +*i* [lindex [getchanmode $chan] 0]] || [string match +*N* [lindex [getchanmode $chan] 0]] || [string match +*R* [lindex [getchanmode $chan] 0]] || [string match +*M* [lindex [getchanmode $chan] 0]] || [string match +*c* [lindex [getchanmode $chan] 0]]} {
putserv "MODE $chan -cimMNR"
}
}
}
timer $timechks snowbotchk
}
putlog " . . : : checklock . T C L : : . .Loaded Successfuly..."
########################################################################
### checklock.tcl v.1.0 ###
### checklock.tcl v1.0 has been made and development ###
### BY ###
### (c) SnowBot (ha0) Script Team Development (c) ###
### *** Copyright (C) 1999-2002 Clovis #Mania @ DalNet *** ###
### The purpose from this script is for educational only ###
### Not available for commercial purpose ###
### For contact you can email me at hendra_asianto@hotmail.com ###
### Our Homepage on www.snowbot.s5.com or visit our chan on #mania ###
########################################################################
#######################################################################
## --- Don't change anything below here if you don't know how ! --- ###
## ---------------------------------------------------------------- ###
## NOTE : THIS SCRIPT CAN SET BECOME AUTO AWAY .TCL WITH RANDOM AWAY MSG :)
## DEPEND'S YOUR IDEAL :)NOW... I JUST CAN GIVE A LITTLE WAY
# Set how long that bot must check modelock back again.
set timechks 30
# Version number - DON'T TOUCH!
### Start Call Command (made safe from rehash starting double loops)
if {![info exists chklock_running]} {
timer $timechks [list snowbotchk]
set chklock_running 1
}
proc snowbotchk {} {
global timechks
foreach chan [channels] {
if {[botisop $chan]} { set modes ""
set chanmode [lindex [split [getchanmode $chan]] 0]
if {[string match +*c* $chanmode]} { append modes c }
if {[string match +*i* $chanmode]} { append modes i }
if {[string match +*m* $chanmode]} { append modes m }
if {[string match +*M* $chanmode]} { append modes M }
if {[string match +*N* $chanmode]} { append modes N }
if {[string match +*R* $chanmode]} { append modes R }
if {$modes ne ""} { putserv "MODE $chan -$modes" }
}
}
timer $timechks [list snowbotchk]
}
putlog " . . : : checklock . T C L : : . .Loaded Successfuly..."
namespace eval lockCheck {
setudef str lockModes
bind time * * [namespace current]::check
proc check {args} {
foreach chan [channels] {
if {![botisop $chan]} continue
set modes [split [channel get $chan lockModes] ""]
set cm [lindex [split [getchanmode $chan] +] 1]
if {[string first k $cm] != -1} {
scan $cm {%s%s} cm key
}
foreach m [split $cm ""] {
if {[lsearch -nocase $modes $m] != -1} {
if {$m eq "k"} {
pushmode $chan -k $key
} else {
pushmode $chan -$m
}
}
}
}
}
}
Difference between mine and yours?
- can have different lock modes to be removed for each channel in particular, just .chanset #channel lockModes mki for #channel and .chanset #anotherchannel lockModes for #anotherchannel for instance, or to be more specific .chanset #channel lockModes cimMNR
- supports removal of a channel key if such a mode is desired to be removed
- doesn't require any change of the actual script file so all changes in channel lock modes are on-the-fly
- by using pushmode it will push all mode changes in just one line rather than spamming with multiple mode changes
Once the game is over, the king and the pawn go back in the same box.
i tried yours caesar it seems to not make difference between lower and upper case while there is a difference for example we want to use N not n and use T not t as they both are default modes and shouldnt be removed ever
.chanset * lockModes cimMRcSNk
resulted in:
10:24:23 +ctcp Sets Mode on #Cappuccino to: +imk kjhffd
10:25:01 &Hawk Sets Mode on #Cappuccino to: -imCnk kjhffd
10:25:02 &ChanServ Sets Mode on #Cappuccino to: +n
10:26:01 &Hawk Sets Mode on #Cappuccino to: -n
10:26:02 &ChanServ Sets Mode on #Cappuccino to: +n
10:27:01 &Hawk Sets Mode on #Cappuccino to: -n
10:27:01 &ChanServ Sets Mode on #Cappuccino to: +n