This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

timer prob

Old posts that have not been replied to for several years.
Locked
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

timer prob

Post by Nexus6 »

it checks cycle time according to number of ppl in chan after some time timer stops working.

Code: Select all

if {![info exists timecheckn]} { set timecheckn [timer 5 checkn] }
proc checkn {} {
global cycle_time
if {![botonchan #chan]} {return 0}
set nusers [llength [chanlist #chan]]
if {$nusers < 10} {
if {$cycle_time == 360} {return 0}
set cycle_time 360
putlog "Cycle time set to \002360\002 seconds, \[$nusers users < 10\]"
} elseif {$nusers < 40} {
if {$cycle_time == 152} {return 0}
set cycle_time 152
putlog "Cycle time set to \002152\002 seconds, \[$nusers users < 40\]"
} elseif {$nusers < 100} {
if {$cycle_time == 97} {return 0}
set cycle_time 97 
putlog "Cycle time set to \00297\002 seconds, \[$nusers users < 100\]"
} elseif {$nusers < 120} {
if {$cycle_time == 87} {return 0}
set cycle_time 87
putlog "Cycle time set to \00287\002 seconds, \[$nusers users < 120\]"
} elseif {$nusers < 150} {
if {$cycle_time == 69} {return 0}
set cycle_time 63
putlog "Cycle time set to \00263\002 seconds, \[$nusers users < 150\]"
} elseif {$nusers > 180} {
if {$cycle_time == 63} {return 0}
set cycle_time 63
putlog "Cycle time set to \00263\002 seconds, \[$nusers users > 180\]"
 }
set timecheckn [timer 5 checkn]
}
Why does timer stops working after some time?
.tcl info exists timecheckn
[18:09] (Sentinel^) Tcl: 1
.tcl timers
[18:10] (Sentinel^) Tcl:
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Code: Select all

if {![botonchan #chan]} {return 0}
The bot is obviously not on channel on one of the timer runs - maybe you should set the timer again, then return.
Locked