I'm trying to understand your problem...
An op can add a
+b m:*!*@* to mute anyone on the channel, and you want the eggdrop to automaticaly remove it after 20 minutes.
BUT if someone removes the ban, you want to kill the timer.
Code: Select all
bind mode - "#% +b" runban
bind mode - "#% -b" stopban
proc runban {nick uhost handle chan mode target} {
if {[string match -nocase m:*!*@* $target]} {
set ::btimer [list [timer 20 rmban]]
}
}
proc stopban {nick uhost handle chan mode target} {
if {[string match -nocase m:*!*@* $target]} {
rmban
}
}
proc rmban {} {
if { [info exists ::btimer] } {
killtimer $::btimer
unset ::btimer
}
}
Explanations
The runban proc create the timer, and will run "rmban" at the end of the timer.
The stopban proc directly call the rmban proc
The rmban proc checks if the timer exists, and if it exists, it kills the timer and unset its id.