how can i sort it? like givin all the channels in line? and how could the bot will stay out of chan for couple minutes(i wanna figure the waitin time). tx anyway...
set timecycle 20
set timewait 2
set chancycle "#adam #ayva"
proc part_chan { } {
foreach chan [split $::chancycle] {
if {![botonchan $chan]} {
continue
}
channel set $chan +inactive
timer $::timewait "channel set $chan -inactive"
}
timer $::timecycle part_chan
}
the "timewait" is the time (in minutes) u want the bot to stay out of channel before rejoining.
Tnx for da code it works but there is a problem i couldnt get why it doesnt start the timer by it self. i had to write .tcl part_chan when bot restarts or dies. Is it about eggdrop version?
well, I don't have alot of experiance in this. but I think that the timer $::timecycle part_chan means that the bot will cycle every 20mins, which means when the bot joins the channel u have to wait 20mins to see if it will cycle.
any way try adding this code which will let the script work on connect:
Sir_Fz wrote:well, I don't have alot of experiance in this. but I think that the timer $::timecycle part_chan means that the bot will cycle every 20mins, which means when the bot joins the channel u have to wait 20mins to see if it will cycle.
any way try adding this code which will let the script work on connect:
# channel to cycle
set cyclechan "#blabla"
# minutes between each cycle
set timecycle 120
# minutes to idle before rejoining chan
set timewait 1
bind RAW * 366 cyclestart
proc cyclestart { from key arg } {
global cyclechan timecycle
set chan [lindex [split $arg] 1]
if { $chan != $cyclechan } { return 0 }
timer $timecycle cycle
}
proc cycle { } {
global scanchan timewait
channel set $cyclechan +inactive
timer $timewait "channel set $cyclechan -inactive"
}
you could alternatively use for-statements if you need more chans, I didn't bother adding that feature