 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
redd
Joined: 06 Nov 2006 Posts: 39 Location: Sechelt,BC
|
Posted: Thu Dec 18, 2008 3:32 am Post subject: adjust UpTime code? |
|
|
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 |
|
 |
redd
Joined: 06 Nov 2006 Posts: 39 Location: Sechelt,BC
|
Posted: Thu Dec 18, 2008 11:08 pm Post subject: |
|
|
| I still can't figure out ? |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Dec 19, 2008 7:51 am Post subject: |
|
|
| 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.  |
|
| Back to top |
|
 |
redd
Joined: 06 Nov 2006 Posts: 39 Location: Sechelt,BC
|
Posted: Fri Dec 19, 2008 10:45 am Post subject: |
|
|
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 |
|
 |
same guest Guest
|
Posted: Fri Dec 19, 2008 11:25 am Post subject: |
|
|
| 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
|
Posted: Fri Dec 19, 2008 10:00 pm Post subject: |
|
|
Thanks for all your help.
Take care
Redd |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|