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.

timers

Old posts that have not been replied to for several years.
Locked
S
Snapple
Voice
Posts: 38
Joined: Fri Jul 18, 2003 4:41 pm
Location: Israel
Contact:

timers

Post by Snapple »

I have a command that I want to be repeated, that every 10 minutes it will send a message

Code: Select all

bind join - * join:join
proc join:join {nicka uhost hand chan} {
 if {[string tolower $nicka] == [string tolower mynick]} { 
    starta $chan
  }    
}
proc starta {chan} { 
   global botnick botChan
   putserv "PRIVMSG $chan :message"
      timer 1 [starta $chan]
}
that is the code,
when I run it
it says "too many nested evaluations (infinity loop?)"
on join:join
anyone know why? =\
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: timers

Post by user »

Snapple wrote:when I run it
it says "too many nested evaluations (infinity loop?)"
on join:join
anyone know why? =\
That's due to your old friend "command substitution". The proc calls itself immediately and the value returned is passed as an argument to 'timer'. Try

Code: Select all

timer 1 [list starta $chan]
instead :)
S
Snapple
Voice
Posts: 38
Joined: Fri Jul 18, 2003 4:41 pm
Location: Israel
Contact:

thanks

Post by Snapple »

working 8)
Snapple
There are 10 kind of people here, the one's who know binary code and the one's who don't.
Locked