Clipper34 Posted June 15, 2008 Share Posted June 15, 2008 (edited) Hey guys, I've came across a problem with pixel detection. What I'm trying to do is say for example a health bar in a game. As it goes down to a certain point it stops its current task and clicks. Here's a code of what i thought up: Func Bar() While 1 $seach = PixelSearch(402, 194, 417, 193, 0xC31515, 2, 2) MouseClick("left", $left[0], $left[1]) WEnd EndFunc Edited June 15, 2008 by Clipper34 Link to comment Share on other sites More sharing options...
narayanjr Posted June 15, 2008 Share Posted June 15, 2008 so whats the problem? Link to comment Share on other sites More sharing options...
Clipper34 Posted June 15, 2008 Author Share Posted June 15, 2008 the problem is how do i get the program to stop what it's doing when a certain event happens in the window/program and do something else. For example to send a mouse click when, like i said above a health bar IF it reaches a certain amount the program stops and peforms a mouse click. Any ideas where to start? Thanks. Link to comment Share on other sites More sharing options...
narayanjr Posted June 15, 2008 Share Posted June 15, 2008 Func Bar() While 1 $seach = PixelSearch(402, 194, 417, 193, 0xC31515, 2, 2) If isArray($search) Then MouseClick("left", $left[0], $left[1]) ExitLoop EndIf Sleep(100) WEnd EndFunc Link to comment Share on other sites More sharing options...
Clipper34 Posted June 15, 2008 Author Share Posted June 15, 2008 Thanks narayanjr, it works perfectly 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