Blacktongue Posted January 11, 2007 Share Posted January 11, 2007 This sounds simple but it's got a beginner stuck.. I want a message box to pop up and then disappear but then I want the script to wait for keyboard input..... MsgBox(0 "", "Choose- press A , B, or C") then what? Thanks, Link to comment Share on other sites More sharing options...
BALA Posted January 11, 2007 Share Posted January 11, 2007 Set up a HotKey, look it up in the help file [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Joon Posted January 11, 2007 Share Posted January 11, 2007 Another way. #include <Misc.au3> $timeout = 5 MsgBox(0,"","Choose- press A , B, or C",$timeout) $dll = DllOpen("user32.dll") While 1 Sleep ( 50 ) If _IsPressed("41", $dll) Then MsgBox(0,"_IsPressed", "A Key Pressed") ExitLoop EndIf If _IsPressed("42", $dll) Then MsgBox(0,"_IsPressed", "B Key Pressed") ExitLoop EndIf If _IsPressed("43", $dll) Then MsgBox(0,"_IsPressed", "C Key Pressed") ExitLoop EndIf WEnd DllClose($dll) Link to comment Share on other sites More sharing options...
BALA Posted January 11, 2007 Share Posted January 11, 2007 (edited) Using Hotkeys: #include <Misc.au3> ;'!' = 'Shift +' HotKeySet("!a", "A") HotKeySet("!b", "B") HotKeySet("!c", "C") MsgBox(0, "", "Choose- press A , B, or C") Func A() ;put code here for if the user presses A EndFunc Func B() ;put code here for if the user presses B EndFunc Func C() ;put code here for if the user presses C EndFunc ;'keep alive' loop While 1 Sleep(10) WEnd EDIT: fixed code Edited January 12, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
Helge Posted January 11, 2007 Share Posted January 11, 2007 @BALA :- Uppercase "a" requires you to press Shift+A, not just "a".- Missing comma on MsgBox-line- Script will close after MsgBox closes, due to missing keep-alive loop. Link to comment Share on other sites More sharing options...
Bert Posted January 12, 2007 Share Posted January 12, 2007 Also for the messagebox, you can put a timeout for how long it will be displayed. The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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