set cycle_channel "#channel"
#cycle time in minutes
set cycle_time "2"
#wait time until rejoin (seconds)
set wait_time "5"
if {![info exists cycle_start]} {
timer $cycle_time cycle:process
set cycle_start 1
}
proc cycle:process {} {
global cycle_channel cycle_time wait_time botnick
if {[validchan $cycle_channel]} {
if {[onchan $botnick $cycle_channel]} {
channel set $cycle_channel +inactive
utimer $wait_time [list join:process]
}
}
}
proc join:process {} {
global cycle_time cycle_channel
channel set $cycle_channel -inactive
timer $cycle_time cycle:process
}