WorkHorse Posted January 5, 2008 Share Posted January 5, 2008 (edited) im getting an error that closes my prgm when the ball leaves the tophalf of the screen (and keeps running when ball leaves bottom half). Can any1 figure out why? While 1 $coord2=503 $coord = PixelSearch( 0, 0, 1300, 1300, 16768644 ) ;$coord2 = PixelSearch( 0, 0, 1300, 1300, 11225662 ) if not @error then ;MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) while $coord[1] < $coord2 send("{UP down}") $coord = PixelSearch( 10, 10, 1300, 1300, 16768644 ) if @error Then ExitLoop endif wend send("{UP up}") Endif if not @error then while $coord[1] > $coord2 send("{DOWN down}") $coord = PixelSearch( 10, 10, 1300, 1300, 16768644 ) if @error Then ExitLoop endif wend send("{DOWN up}") EndIf wend Ps. Also is there any way to send keystrokes to a window? for some reason when the window is active it doesn't allow keystrokes through. My current noobie method is having to constantly switch from desktop to the game window for it to work Edited January 5, 2008 by WorkHorse 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