egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Looking BIND processes again ...

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Wed May 27, 2015 8:49 am    Post subject: Looking BIND processes again ... Reply with quote

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 Smile
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Thu May 28, 2015 6:57 pm    Post subject: Reply with quote

How you might put a timer between each if ...
Perhaps with that fixed.
_________________
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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber