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 

Countdown problem

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


Joined: 13 Sep 2005
Posts: 23

PostPosted: Wed Jan 04, 2006 7:17 pm    Post subject: Countdown problem Reply with quote

Quote:

set date "October 22 14:00:00 2000"
set msj "have passed with McLaren being losers"

bind pub - !mcloser pub:mcloser
proc pub:mcloser {nick uhost hand chan text} {
global date msj
set dur [expr [clock scan $date]-[clock seconds]]
putquick "PRIVMSG $chan : [duration $dur] $msj"
}




<bot> 0 seconds have passed with McLaren being losers

How can fix them? THANKS!
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jan 04, 2006 8:11 pm    Post subject: Reply with quote

[clock seconds] is recent while $date is very old, so you're doing it vise-versa. Replace
Code:
set dur [expr [clock scan $date]-[clock seconds]]

with
Code:
set dur [expr {[clock seconds] - [clock scan $date]}]

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
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