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 

check bots

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Kraka
Voice


Joined: 21 Apr 2005
Posts: 19

PostPosted: Sun Nov 16, 2008 2:55 pm    Post subject: check bots Reply with quote

i am wondering if there is a way to make check_bots scan all chans or chans that i can set as +checkbots instead of just having it check one chan. thanks

Code:

#####################check_bots ver1a 5/21/04 by KalZoo#######################
##############################################################################
### Just a small script that checks how many bots are in channel and that  ###
### are op'ed,then if not at the minimun required amount it checks for     ###
### certain flag [ z ]to ones allowed to stay op until other bots return   ###
### .chattr +z [global] and [channel] to all bots and whoever are allowed  ###
### to stay op'd.  [prob n m users].I would recomend you load this onto    ###
###  1 bot from each shell you have,and make subhubs for each shell as to  ###
### be sure they all send the chattr command. When low bots they deop      ###
### non +z users and chattr them +d-o [channel specific].Then when bots    ###
### return and  meet the bots_min they get their status returned.          ###
##############################################################################
##############################################################################

#set this to the channel u want to run in.Only single channel.

set allowed "#channel"

#set this to the minimum amount of bots before action

set bots_min 12

#set this to how many minutes timer to check for bots

set bo_timer 5

############################end settings#####################################
#######################code begins dont edit#################################

proc low_chkbots {} {
  global bot bots botnick allowed bo_timer bots_min
  if {![string match "*low_chkbots*" [timers]]} { timer $bo_timer low_chkbots }
  set bots 1
  foreach bot [chanlist $allowed b] {
    if {$bot != $botnick && [isop $bot $allowed]} {
      incr bots
    }
  }
  if {$bots >= $bots_min} {
  return_status }
  if {$bots <= $bots_min} {
  remove_status }
}
if {![string match "*low_chkbots*" [timers]]} { timer $bo_timer low_chkbots }


proc remove_status {} {
  global channick hnick allowed bots_min
  foreach channick [chanlist $allowed -z] {
   set hnick [nick2hand $channick]
    pushmode $allowed -o $channick
    if {([matchattr $hnick -z|-z $allowed])} {
     if {([matchattr $hnick |-d $allowed])} {
      chattr $hnick |-o+d $allowed
   }
  }
 }
}


proc return_status {} {
 global allowed channick ahnick
  foreach channick [chanlist $allowed -z] {
   set ahnick [nick2hand $channick]
    if {([matchattr $ahnick |-z $allowed])} {
     if {([matchattr $ahnick |-o $allowed])} {
      chattr $ahnick |-d+o $allowed
   }
  }
 }
}

bind bot - low_chkbots


###########################################################################
putlog "check-bots ver1a loaded created by KalZoo"
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 -> Script Support & Releases 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