egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to make timer in seconds and not minutes?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
daigo
Voice


Joined: 27 Jun 2014
Posts: 37

PostPosted: Fri Jul 25, 2014 11:30 pm    Post subject: How to make timer in seconds and not minutes? Reply with quote

Here is my script:
Code:
set ai_chan "#daigo"

set ai_time 1

set ai_msgs {
  "please watch your step"
  "i like cookies"
}

proc ai_start {} {
  global ai_time
  if {[string match *ai_sendmsg* [timers]]} {return 0}
  timer [expr [rand $ai_time] + 1] ai_sendmsg
}

proc ai_sendmsg {} {
  global botnick ai_chan ai_msgs ai_time
  if {[validchan $ai_chan]} {
    puthelp "PRIVMSG $ai_chan :[lindex $ai_msgs [rand [llength $ai_msgs]]]"
  }
  timer [expr [rand $ai_time] + 1] ai_sendmsg
}

set ai_chan [string tolower $ai_chan]

ai_start

It says one of those 2 random messages I have in my script, at random intervals, with the minimum time lapse of 1 minute. How do I make the timer in seconds instead of minutes so that I can make the script say something at least every 30 seconds instead of at least every 1 minute?
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Jul 26, 2014 7:59 am    Post subject: Re: How to make timer in seconds and not minutes? Reply with quote

daigo wrote:


....
How do I make the timer in seconds instead of minutes ...



Go here:
http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html
and text search for
utimer



-
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber