Jump to content

Pixelsearch question


Recommended Posts

Hello folks. I'm working on a bot for a flash game and what I need to do is search for a pixel click it and continue searching for that pixel and clicking on it til it cant find that color anymore then moves on with the script. Lets say for example I'm playing a game where a bunch of multi colored balloons pop on my screen and I need to pop only the red ones. I want the script to search for red click it and search for the next red. If it can't find any red balloons then continue to next step of script.

Heres a sample of what I've come up with so far.

;Pixelsearch
While 1
$coord = Pixelsearch (362,330,1115,735,0xEAE3DB, 10, 3)

If UBound($coord)>1 Then
    MouseClick("left", $coord[0], $coord[1], 1, 3)


Endif
Wend

Problem is I can't figure out how to end the loop when it can't find the color its looking for. Also if possible it'd be nice to be able to set a few second delay before it gives up looking just incase it doesn't find it right away. I made a fishing bot for WoW a long time ago but I'm rusty with autoit nowadays so I tried to copy some of the code out of my old fishing bot to use for this one. Perhaps I'm doing it the wrong way all together but thats why I'm here I need the help of the pros :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...