bowo Posted September 8, 2013 Share Posted September 8, 2013 (edited) Can someone fix my script? script does not wait for the active window expandcollapse popup#Include <WinAPI.au3> Func First () TrayTip ( "Example", "F1 to out", 20000, 1) HotKeySet("{F1}", "dead") AutoitSetoption ( "MouseClickDelay", 50 ) if ProcessExists ("example.exe") Then WinWaitActive ( "Example Program", "", "" ) $4 = 0xFFCC00 $count = 0 $movx = 1 $movy = 1 WinMove ( "Example Program", "", $movx, $movy ) $a = PixelSearch ( 124, 119, 129, 122, $4 ) if isArray ( $a ) = True Then $Count += 1 Else EndIf $b = PixelSearch ( 250, 119, 257, 122, $4 ) if isArray ( $b ) = True Then $Count += 1 Else EndIf $c = PixelSearch ( 383, 119, 385, 122, $4 ) if isArray ( $c ) = True Then $Count += 1 Else EndIf $d = PixelSearch ( 516, 119, 513, 122, $4 ) if isArray ( $d ) = True Then $Count += 1 Else EndIf if $Count == 4 Then call ("ready") Else call ("First") EndIf Else Msgbox (0, "Failure", "Program Closed") sleep ( 2000 ) EndIf EndFunc Func Dead() ; variable exit hotkey Exit 0 EndFunc Func ready() blah blah blah call ("First") EndFunc Edited September 8, 2013 by bowo Link to comment Share on other sites More sharing options...
FireFox Posted September 8, 2013 Share Posted September 8, 2013 Hi, What do you need this script for? There may be more reliable ways to automate what you're trying to do. Br, FireFox. Link to comment Share on other sites More sharing options...
Valuater Posted September 8, 2013 Share Posted September 8, 2013 Not being able to test this script... Maybe... if ProcessExists ("example.exe") Then WinActivate( "Example Program", "") WinWaitActive ( "Example Program", "", "" ) 8)) Link to comment Share on other sites More sharing options...
TheSaint Posted September 9, 2013 Share Posted September 9, 2013 I gather you've tried the Window Info Tool? That you've used MsgBox and return values to determine where any issue might lie? That you've tried Sleep in various places to determine if any delay is needed? Timing issues? It may just be, that a Window needs to be fully drawn, before it can be moved? Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) 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