Trubbleguy
Joined: 20 Jan 2007 Posts: 76 Location: Melbourne
|
Posted: Sat Apr 19, 2008 12:33 am Post subject: Pill Timer |
|
|
+bug fix: removed Return after menu as it stopped timer running
I kept forgetting my Anti-Biotic pills and made them ineffective, so i wrote this when i first joined up here over a year ago, and use it a few times a year. and it really does work because its worse than my wife in nagging me to take the meds at the right time.
| Code: |
; Language: English
; Platform: XP,ME,98,Vista
; Author: T. Gowshall <trubbleguy@optusnet.com.au>
programFullName=Trubbleguys Pill Timer
#SingleInstance,Force
xhours=09`,13`,17`,22 ;default 4 times a day setting
MsgBox,32,24Hr clock format,%xhours% ( 24hr format ) currently set
; set tray tip
Menu, Tray, Tip, %programFullName%
; disable standard menu items
Menu, Tray, NoStandard
; separator
Menu, Tray, Add
; show Setup message
Menu, Tray, Add, &Alarm Times Are Currently:, setuptimes
; separator
; Menu, Tray, Add
Menu, Tray, Add, %xhours%, setup
Menu, Tray, Add
; terminate script
Menu, Tray, Add, &quit, quit
#Persistent
Settimer,start,on
Return
start:
If A_Hour in %xhours%
If A_Min in 00
If A_Sec in 00
{
Time=%A_Hour% : %A_Min%
Gosub sound
}
return
sound:
MsgBox,4,Take your PILL, Time for your %Time% Pill at %A_Hour%:%A_Min%`nYes to Continue on for the next Pill Time`nNo to exit,15
ifMsgBox,Timeout
goto sound
ifMsgBox,Yes
goto start
ifMsgBox,No
ExitApp
Return
setup:
setuptimes:
oldhours:=xhours
Inputbox,xhours,Input what hours to show reminder,24hr format separated by comma (00 to 24),,,120,,,,,%xhours%
if oldhours<>%xhours%
Menu, Tray, Rename, %oldhours%,%xhours%
stringReplace,xhours,xhours,%A_Space%,,All
Return
quit:
ExitApp
Return
| It simply triggers on the HOUR set and waits for acknowledgement .
Guess what pills my avatar is on......hehehehe _________________
 |
|