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.

want help with a time left command

Help for those learning Tcl or writing their own scripts.
Post Reply
j
janii
Halfop
Posts: 41
Joined: Wed Aug 03, 2011 8:08 am

want help with a time left command

Post by janii »

I made a code for time left for stats reset on daily bases now i want it to show days to left until next month reset

Code: Select all

duration [expr {[clock scan "tomorrow 00:00"] - [clock seconds]}] " 
}
and it shows
Daily Stats Reset in: 19 hours 39 minutes 23 seconds

Now i want to add one more command with it tht whn sum1 do !time
the bot shall answer like this

Daily Stats Reset in: 19 hours 39 minutes 23 seconds & Monthly stats Reset in : 11 days 5 hours 59 minutes 40 seconds.

if its 19th April and month to be end on 1st May
Thanx in advance
Last edited by janii on Sun Apr 22, 2012 12:31 pm, edited 1 time in total.
User avatar
Pixelz
Voice
Posts: 24
Joined: Wed Jun 15, 2005 9:37 am
Location: EFnet

Post by Pixelz »

This was a pretty interesting question, here you go:

Code: Select all

duration [expr {[clock scan [clock format [clock scan "next month"] -format "%Y-%m-01"]] - [clock seconds]}]
Pixelz @ EFnet, freenode, QuakeNet, Undernet
j
janii
Halfop
Posts: 41
Joined: Wed Aug 03, 2011 8:08 am

Post by janii »

ThankYou Pixelz
Your code is working perfectly now thanx once again
Post Reply