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 vs. Rehash Question

Old posts that have not been replied to for several years.
Locked
s
studman

Timer vs. Rehash Question

Post by studman »

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?

Code: Select all

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
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Like the error says, you're using the wrong number of arguments. Look in tcl-commands.doc for information on how time bind procs should be made.
Locked