I wrote a little coding here to have the bot execute the proc based upon a timer. When I execute the code using a bind evnt - rehash check_channels, the code executes properly. But when I set the timer to run the code, I get a Tcl error [check_channels_timed]: wrong # args: should be "check_channels_timed" error.
What am I doing wrong with the timer (or code) to cause this?
set chan_invite "#invite"
set chan_listen "#listen"
set services_name "ChanServ"
proc check_channels_timed {chan} {
#Setup some parameters
global chan_listen chan_invite botnick services_name
#Check to see if the bot is in the invite channel
if (![botonchan $chan_invite]) {
putlog "$chan_invite - I am not in $chan_invite. Changing channel settings to attempt entry."
channel set $chan_invite -inactive
putserv "$services_name invite $chan_invite $botnick"
return 0
}
#Check to see if the bot is in the listen channel
if (![botonchan $chan_listen]) {
putlog "$chan_listen - I am not in $chan_listen. Changing channel settings to attempt entry."
channel set $chan_listen -inactive
return 0
}
}
bind time - "?? * * * *" check_channels_timed