AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

adjust UpTime code?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
redd



Joined: 06 Nov 2006
Posts: 39
Location: Sechelt,BC

PostPosted: Thu Dec 18, 2008 3:32 am    Post subject: adjust UpTime code? Reply with quote

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 Fri Dec 19, 2008 1:11 am; edited 1 time in total
Back to top
View user's profile Send private message
redd



Joined: 06 Nov 2006
Posts: 39
Location: Sechelt,BC

PostPosted: Thu Dec 18, 2008 11:08 pm    Post subject: Reply with quote

I still can't figure out ?
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Dec 19, 2008 7:51 am    Post subject: Reply with quote

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. Crying or Very sad
Back to top
redd



Joined: 06 Nov 2006
Posts: 39
Location: Sechelt,BC

PostPosted: Fri Dec 19, 2008 10:45 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
same guest
Guest





PostPosted: Fri Dec 19, 2008 11:25 am    Post subject: Reply with quote

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")
Back to top
redd



Joined: 06 Nov 2006
Posts: 39
Location: Sechelt,BC

PostPosted: Fri Dec 19, 2008 10:00 pm    Post subject: Reply with quote

Thanks for all your help.
Take care
Redd
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group