| View previous topic :: View next topic |
| Author |
Message |
honeybee Halfop
Joined: 01 Jan 2006 Posts: 80
|
Posted: Mon Sep 24, 2007 9:47 pm Post subject: calc changes with time. |
|
|
| 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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Sep 25, 2007 10:17 am Post subject: |
|
|
| 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 |
|
 |
honeybee Halfop
Joined: 01 Jan 2006 Posts: 80
|
Posted: Fri Sep 28, 2007 8:12 am Post subject: |
|
|
| thanks Fz. |
|
| Back to top |
|
 |
|