But not working properly, there are processes that are active (bind) and gives me like they are (unbind).
They bind cron processes that are checked if they are ON (bind) or OFF (unbind) are:
bind cron - {*/10 0 * * 1,2,3,4} advertise
bind cron - {*/15 0 * * 1,2,3,4} advertise15
bind cron - {*/20 0 * * 1,2,3,4} advertise2
bind cron - {*/30 0 * * 1,2,3,4} advertise3
Code: Select all
bind pub ato|vn !timers control:timers
proc control:timers { nick uhost hand chan arg } {
global canal_admin
foreach ele [binds cron] {
foreach {type flags cmd hits func} $ele {
if {$func eq "advertise"} {
putquick "PRIVMSG $canal_admin :\0033 \(STATUS TIMERs\)\002\0031 TIMER 10 min \0033ON"
}
if {$func ne "advertise"} {
putquick "PRIVMSG $canal_admin :\0034 \(STATUS TIMERs\)\002\0031 TIMER 10 min \0034OFF"
}
if {$func eq "advertise15"} {
putquick "PRIVMSG $canal_admin :\0033 \(STATUS TIMERs\)\002\0031 TIMER 15 min \0033ON"
}
if {$func ne "advertise15"} {
putquick "PRIVMSG $canal_admin :\0034 \(STATUS TIMERs\)\002\0031 TIMER 15 min \0034OFF"
}
if {$func eq "advertise2"} {
putquick "PRIVMSG $canal_admin :\0033 \(STATUS TIMERs\)\002\0031 TIMER 20 min \0033ON"
}
if {$func ne "advertise2"} {
putquick "PRIVMSG $canal_admin :\0034 \(STATUS TIMERs\)\002\0031 TIMER 20 min \0034OFF"
}
if {$func eq "advertise3"} {
putquick "PRIVMSG $canal_admin :\0033 \(STATUS TIMERs\)\002\0031 TIMER 30 min \0033ON"
}
if {$func ne "advertise3"} {
putquick "PRIVMSG $canal_admin :\0034 \(STATUS TIMERs\)\002\0031 TIMER 30 min \0034OFF"
}
}
break
}
}
Using the form if - else, at times it not find anything, go to the line off break.
For debuggin purpose, I changed the line break:
Code: Select all
putquick "PRIVMSG $canal_admin :I found nothing!"
Example:
Code: Select all
if {$func eq "advertise"} {
putquick "PRIVMSG $canal_admin :\0033 \(STATUS TIMERs\)\002\0031 TIMER 10 min \0033ON"
} else {
putquick "PRIVMSG $canal_admin :\0034 \(STATUS TIMERs\)\002\0031 TIMER 10 min \0034OFF"
}
if {$func eq "advertise15"} {
putquick "PRIVMSG $canal_admin :\0033 \(STATUS TIMERs\)\002\0031 TIMER 15 min \0033ON"
} else {
putquick "PRIVMSG $canal_admin :\0034 \(STATUS TIMERs\)\002\0031 TIMER 15 min \0034OFF"
}
######etc.................
putquick "PRIVMSG $canal_admin :I found nothing!"