AutoHotkey Community

It is currently May 26th, 2012, 12:42 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: adjust UpTime code?
PostPosted: December 18th, 2008, 4:32 am 
Offline

Joined: November 6th, 2006, 4:18 pm
Posts: 39
Location: Sechelt,BC
Min shows total minutes, I need to -d and -h .how?
Code:

SetTimer, aa, 60000  ; updates every 1 minute
aa:
IniRead, OutputVar, C:\Total Time.csv, Minutes,Total Minutes, 0 ; If no value is found, assume it is 0.
OutputVar++
IniWrite, %OutputVar%, C:\Total Time.csv, Minutes,Total Minutes
return
F11::
Gui +LastFound -Caption +ToolWindow
Gui, Color, 0x454545
Gui, Font, s20
Gui, Add, Text, vTime w500 +Center
Gui, Show
SetTimer, UpdateOSD, 1000
Gosub, UpdateOSD
OnMessage(0x201, "WM_LBUTTONDOWN")
IniRead, OutputVar, C:\Total Time.csv, Minutes,Total Minutes
UpdateOSD:
GuiControl,, Time, % ("Total Time  " d := OutputVar//1440) . " " . ("hh" d > 1 || !d ? "days" : "day")
             . " " . (h := (OutputVar-d*1440)//60) . " " . (h > 1 || !h ? "hours" : "hour")
             . " " . (m := OutputVar-h*60) . " " . (m > 1 || !m ? "mins" : "min")
Return


WM_LBUTTONDOWN() {
   PostMessage, 0xA1, 2
}
Thanks
Code:
. " " . (m := OutputVar-h*60) . " " . (m > 1 || !m ? "mins" : "min")


Last edited by redd on December 19th, 2008, 2:11 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 12:08 am 
Offline

Joined: November 6th, 2006, 4:18 pm
Posts: 39
Location: Sechelt,BC
I still can't figure out ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 8:51 am 
redd wrote:
I still can't figure out ?

You need to explain the problem clearly. Lack of clarity in your post is very likely why no one has reponded to your original post. I know I have looked at it a couple of times, and cannot figure out what you are asking for. :cry:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 11:45 am 
Offline

Joined: November 6th, 2006, 4:18 pm
Posts: 39
Location: Sechelt,BC
EG:outputvar=1502,It should show 1day 1 hour 2 min
but this shows 1 day 1 hour 1502 min
Code:
. " " . (m := OutputVar-h*60) . " " . (m > 1 || !m ? "mins" : "min")
Sorry for not being clear.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 12:25 pm 
redd wrote:
EG:outputvar=1502,It should show 1day 1 hour 2 min
but this shows 1 day 1 hour 1502 min
Code:
. " " . (m := OutputVar-h*60) . " " . (m > 1 || !m ? "mins" : "min")
Sorry for not being clear.
That is better. This works (tested outputvar = 1502, result = 1 days 1 hour 2 min
Code:
                 . " " . (m := OutputVar-h*60-d*1440) . " " . (m > 1 || !m ? "mins" : "min")


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 11:00 pm 
Offline

Joined: November 6th, 2006, 4:18 pm
Posts: 39
Location: Sechelt,BC
Thanks for all your help.
Take care
Redd


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Cerberus, patgenn123, SKAN, Yahoo [Bot] and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Group