Mutalgaettae Posted October 19, 2009 Posted October 19, 2009 $hWndGame = WinGetHandle( "Insert game window title here") While 1 $var1 = PixelSearch ( 642, 102, 646, 107, 0x181818, 0, 1, $hWndGame) $var2 = PixelSearch ( 642, 102, 646, 107, 0xAF8840, 0, 1, $hWndGame) If NOT ($var1 OR $var2) Then ControlSend ( "Insert game window title here", "", "", "{o}" ) EndIf Sleep(250) WEnd i asked for help to come up with this code, so i can open game window and internet explorer at the same time and browse. I never block the game screen while i surf and this code worked!.. well partly... there is a weird problem. i use this for automatic health. when my health is low enough to trigger the code (press o), it doesn't fill the health. however, during that time if i open a conversation box in the game, i can see o constantly typing... so it does work in game but y not actually heal?
omikron48 Posted October 19, 2009 Posted October 19, 2009 Try putting this at the top of your code: Opt("SendKeyDownDelay", 50) It may just be the case that the button press is too fast for the game to register.
bo8ster Posted October 20, 2009 Posted October 20, 2009 or ControlSend($hWndGame, "", "", "{o}") No idea what {o} does ... Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
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