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 

calc changes with time.

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


Joined: 01 Jan 2006
Posts: 80

PostPosted: Mon Sep 24, 2007 9:47 pm    Post subject: calc changes with time. Reply with quote

Code:
proc modes {nick host hand chan mode target} {
global botnick
  if {($mode == "+M")} {
    lappend tmode [unixtime]
    if {$tmode => "1190655265"} {;# clock scan for 10 mins
      [lreplace $tmode 0 XX]
   }
}


so we can count how many modes in 10 mins; i dont know if my logic is correct or it can be done this way please suggest me.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Sep 25, 2007 10:17 am    Post subject: Reply with quote

Code:
set initialTime [unixtime]

proc modes {nick host hand chan mode target} {
 global initialTime
 set mins [expr {([unixtime]-$initialTime)/60}]
 if {$mins > 10} {
  # more than 10 mins passed, reset time
  set initialTime [unixtime]
 } {
  # else, 10 mins still did not pass.
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
honeybee
Halfop


Joined: 01 Jan 2006
Posts: 80

PostPosted: Fri Sep 28, 2007 8:12 am    Post subject: Reply with quote

thanks Fz.
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