Jump to content

cant get pixel search to work..


Nebieboy
 Share

Recommended Posts

ive read numerous posts about people not understanding pixel search or whatever so im sure you experanced AutoIT coders are bored of answering them,

however would any of you mind assisting with this?

Func Healthcheck()

$Coordshealth = PixelSearch(0,0,800,600,0xDD0000,10) ;red colour search

If NOT @ERROR Then

If Hex( PixelGetColor($Coordshealth[0],$Coordshealth[1] ), 6 ) = 'DD0000' Then

MsgBox(1,"WOOOO FULL HEALTH!","lol")

EndIf

EndIf

it does not give me and error it simply doesnt find the color red... even though theirs about 10 red seconds on screen.

if im correct that code should check the whole screen(when at res of 800X600 for red.

its probably an obvious mistake.

Thanks in advance,

Edited by Nebieboy
Link to comment
Share on other sites

Is there a reason to do a double check? The PixelSearch is returning true, and giving you coordinates to the point where it found the color, but then afer that you recheck the coordinates for the color? I think you can remove that whole second If statement, but if you would like to keep it, try removing the optional parameter from the Hex() call and match that.

Edit: typo

Edited by mikehunt114
IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
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...