AutoHotkey Community

It is currently May 26th, 2012, 3:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Pill Timer
PostPosted: April 19th, 2008, 1:33 am 
Offline

Joined: January 20th, 2007, 1:29 pm
Posts: 96
Location: Melbourne
+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

_________________
Image


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users 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:
Powered by phpBB® Forum Software © phpBB Group