tater Posted January 15, 2009 Share Posted January 15, 2009 Hi everyone. I'm trying to make a Quake Arena timer that will keep track of 3 basic variables. I've done this easily but the lack of a GUI doesn't make it as enjoyable or appealing to me anymore. Unfortunately I have absolutely no idea what to do at this point. #include <GUIConstantsEx.au3> Timer() Func Timer() Local $quad, $yellowarmor, $redarmor, $msg GUICreate("Timer") $quad = GUICtrlCreateCheckbox("Quad Damage", 12, 80, 120,20) $yellowarmor = GUICtrlCreateCheckbox("Yellow Armor", 12, 100, 120,20) $redarmor = GUICtrlCreateCheckbox("Red Armor", 12, 120, 120,20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd EndFunc Now I don't know what to do here because without a GUI I would just set hotkeys and make them loop. So my questions are the following: If a checkbox is selected, can you assign a hotkey to it so that it can loop? If so, please give me a brief explanation how/where this would go in the program. Would I need to create a sort of 'Start' button so that timers don't start instantly (assuming you cannot assign a hotkey)? Any additional information anyone provides will be greatly appreciated. I'm not that great of a programmer (especially when it comes to dialogs) but I'm trying to learn! Sorry for the novice questions. Thank you for any help! Link to comment Share on other sites More sharing options...
rasim Posted January 15, 2009 Share Posted January 15, 2009 taterSee in the help file:GuiCtrlRead() HotkeySet() While ...Wend Link to comment Share on other sites More sharing options...
tater Posted January 15, 2009 Author Share Posted January 15, 2009 Thank you for the reply and help Rasim! expandcollapse popup#include <GUIConstantsEx.au3> Timer() Func Timer() Local $quad, $yellowarmor, $redarmor, $msg GUICreate("Timer") $quad = GUICtrlCreateCheckbox("Quad Damage", 12, 80, 120,20) $yellowarmor = GUICtrlCreateCheckbox("Yellow Armor", 12, 100, 120,20) $redarmor = GUICtrlCreateCheckbox("Red Armor", 12, 120, 120,20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $quad and BitAND(GUICtrlRead($quad), $GUI_CHECKED) = $GUI_CHECKED MsgBox(64, 'Info:','Quad will be timed at 55 seconds.') HotKeySet("{UP}", "Quad") Case $msg = $yellowarmor and BitAND(GUICtrlRead($yellowarmor), $GUI_CHECKED) = $GUI_CHECKED MsgBox(64, 'Info:','Yellow will be timed at 30 seconds.') Case $msg = $redarmor and BitAND(GUICtrlRead($redarmor), $GUI_CHECKED) = $GUI_CHECKED MsgBox(64, 'Info:','Red will be timed at 25 seconds.') EndSelect WEnd EndFunc Func Quad() MsgBox(64, 'Test', 'Test') EndFunc Now the only problem I'm having is the hotkey still going on even when the field is not checked. How would you disable it if it's not checked? Many thanks! Link to comment Share on other sites More sharing options...
rasim Posted January 15, 2009 Share Posted January 15, 2009 @taterTry this:expandcollapse popup#include <GUIConstantsEx.au3> Timer() Func Timer() Local $quad, $yellowarmor, $redarmor, $msg GUICreate("Timer") $quad = GUICtrlCreateCheckbox("Quad Damage", 12, 80, 120, 20) $yellowarmor = GUICtrlCreateCheckbox("Yellow Armor", 12, 100, 120, 20) $redarmor = GUICtrlCreateCheckbox("Red Armor", 12, 120, 120, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $quad If BitAND(GUICtrlRead($quad), $GUI_CHECKED) Then MsgBox(64, 'Info:', 'Quad will be timed at 55 seconds.') HotKeySet("{UP}", "Quad") Else MsgBox(64, 'Info:', 'Quad timer disabled.') HotKeySet("{UP}") EndIf Case $msg = $yellowarmor And BitAND(GUICtrlRead($yellowarmor), $GUI_CHECKED) = $GUI_CHECKED MsgBox(64, 'Info:', 'Yellow will be timed at 30 seconds.') Case $msg = $redarmor And BitAND(GUICtrlRead($redarmor), $GUI_CHECKED) = $GUI_CHECKED MsgBox(64, 'Info:', 'Red will be timed at 25 seconds.') EndSelect WEnd EndFunc ;==>Timer Func Quad() MsgBox(64, 'Test', 'Test') EndFunc ;==>Quad Link to comment Share on other sites More sharing options...
tater Posted January 15, 2009 Author Share Posted January 15, 2009 Oh I see what you did. Very smart! Thank you 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