Tomb Posted March 21, 2008 Share Posted March 21, 2008 I decided to make a alarm clock that could be minimized to tray. it is most effective in the startup folder so the alarm can go off always at the time you have inputted, and it saves the information in Alarm.ini as you change the inputboxes. just put the hour, minute (must be 2 digits(so if its like 12:07 you have to write 07 here, can't just be 7)), AM or PM, and the custom message you want to be in the message box. minimizing the gui window sends it to tray, and clicking the tray icon gives you the option of restore or exit. i have attached the script and the compiled .exe and i will also put the code here. expandcollapse popup#include <Date.au3> #include <GuiConstants.au3> #include <Constants.au3> #NoTrayIcon $gui = GuiCreate("Alarm", 250, 165, -1, -1) GUISetBkColor(0x000000, $gui) $font="Arial" GUISetFont(9, 400, 0, $font) $inihour = IniRead("alarm.ini", "hour", "key", "hour") $iniminute = IniRead("alarm.ini", "minute", "key", "minute") $iniAMPM = IniRead("alarm.ini", "AMPM", "key", "AMPM") $inimessage = IniRead("alarm.ini", "message", "key", "message") $hour = GuiCtrlCreateInput(($inihour), 20, 20, 50, 20) $minute = GuiCtrlCreateInput(($iniminute), 100, 20, 50, 20) $AMPM = GuiCtrlCreateInput(($iniAMPM), 180, 20, 50, 20) $message = GuiCtrlCreateInput(($inimessage), 20, 75, 210, 20) $timelabel = GuiCtrlCreatelabel("Current Time : " & _NowTime(), 20, 125, 200, 20) GUICtrlSetColor(-1,0xff0000) GuiSetState(@SW_SHOW) Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) Opt("GUIOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitScript") GUISetOnEvent($GUI_EVENT_MINIMIZE, "_MinTray") $restoreitem = TrayCreateItem("Restore") TrayItemSetOnEvent(-1,"RestoreTray") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"ExitScript") TraySetState(2) While 1 If _NowTime() = GUICtrlRead($hour) & ":" & GUICtrlRead($minute) & ":00 " & GUICtrlRead($AMPM) Then Beep(500, 500) sleep(500) Beep(500, 500) sleep(500) Beep(500, 500) sleep(500) Beep(500, 500) sleep(500) MsgBox(0, "Alarm", "It is " & _NowTime() & ". " & GUICtrlRead($message)) Else sleep(1000) GuiCtrlSetData($timelabel, "Current Time : " & _NowTime()) EndIf If GUICtrlRead($hour) <> $inihour then IniWrite("alarm.ini", "hour", "key", GUICtrlRead($hour)) EndIf If GUICtrlRead($minute) <> $iniminute then IniWrite("alarm.ini", "minute", "key", GUICtrlRead($minute)) EndIf If GUICtrlRead($AMPM) <> $iniAMPM then IniWrite("alarm.ini", "AMPM", "key", GUICtrlRead($AMPM)) EndIf If GUICtrlRead($message) <> $inimessage then IniWrite("alarm.ini", "message", "key", GUICtrlRead($message)) EndIf WEnd Func _MinTray() GuiSetState(@SW_HIDE) TraySetState(1) EndFunc Func RestoreTray() GuiSetState(@SW_SHOW) GuiSetState(@SW_RESTORE) TraySetState(2) EndFunc Func ExitScript() Exit EndFuncAlarm.au3Alarm.exe Link to comment Share on other sites More sharing options...
JustinReno Posted March 21, 2008 Share Posted March 21, 2008 Have you ever heard of Tidy? Link to comment Share on other sites More sharing options...
Tomb Posted March 21, 2008 Author Share Posted March 21, 2008 Have you ever heard of Tidy?yeahtide/y Xandy 1 Link to comment Share on other sites More sharing options...
Swift Posted March 21, 2008 Share Posted March 21, 2008 Cool alarm clock, No one cares if it's tidy'd, JustinReno, stop critizing others work and make some of your own. Link to comment Share on other sites More sharing options...
JustinReno Posted March 21, 2008 Share Posted March 21, 2008 I'm not critisising his work dumbass. Its called improving it with Tidy. Anyways, its a good Alarm Clock. Link to comment Share on other sites More sharing options...
Tomb Posted March 21, 2008 Author Share Posted March 21, 2008 Cool alarm clock, No one cares if it's tidy'd, JustinReno, stop critizing others work and make some of your own.thanks Swift. Link to comment Share on other sites More sharing options...
BillLuvsU Posted March 22, 2008 Share Posted March 22, 2008 Quiet down children. Justin, stop cursing, it'll just make you look like a very immature child, which I know your not. Swift, don't argue back. If anyone should be cursing it's me, nobody like my alarm clock, and it was much better IMO. xD but good job anyways. [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Tomb Posted March 23, 2008 Author Share Posted March 23, 2008 this is good. a ton of people downloaded it. 19 of the au3 and 16 of the exe. i was only 1 of each to make sure i uploaded correctly. lol. i hope people can make practical use of my Alarm Clock. thanks for nice comments guys. Link to comment Share on other sites More sharing options...
Tomb Posted April 16, 2008 Author Share Posted April 16, 2008 there were almost 40 downloads of the .exe in the last week. and like 5 of the .au3 but no new comments. maybe its just a display bug of how many downloads. Link to comment Share on other sites More sharing options...
Triblade Posted April 16, 2008 Share Posted April 16, 2008 Looks great. Maybe add a checkbox for the beeps There may be some people out there who don't like noise.. And, and, and maybe lose the am/pm I personally don't like the am/pm system and above all there are not many countries out there who use the am/pm system. 24h FTW!! My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
jvanegmond Posted April 16, 2008 Share Posted April 16, 2008 There's a gazillion alarm clocks out there.http://www.autoitscript.com/forum/index.php?showtopic=55498That one's mine. github.com/jvanegmond Link to comment Share on other sites More sharing options...
EdwinSanchez Posted October 28, 2020 Share Posted October 28, 2020 I don't know why but whenever I enter the Autoit forum there are people arguing or answering questions angry Link to comment Share on other sites More sharing options...
JockoDundee Posted October 28, 2020 Share Posted October 28, 2020 On 3/21/2008 at 3:53 PM, JustinReno said: Have you ever heard of Tidy? All’s well that Ends well Func ExitScript() Exit EndFunc Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now