Jump to content
Sign in to follow this  
Clipper34

Quick question with pixel detection

Recommended Posts

Clipper34

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 by Clipper34

Share this post


Link to post
Share on other sites
Clipper34

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.

Share this post


Link to post
Share on other sites
Clipper34

Thanks narayanjr, it works perfectly :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.