juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Wed May 27, 2015 8:49 am Post subject: Looking BIND processes again ... |
|
|
I made a code to verify that bind cron processes are active (bind) and which are not (unbind).
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:
| Quote: | 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: |
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
}
} |
I tried several ways, including testing the idea of caesar to look BIND process, which is at the end of this post.
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: | | putquick "PRIVMSG $canal_admin :I found nothing!" |
And runs that line.
Example:
| Code: | 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!"
|
_________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|