Sign in to follow this  
Followers 0
Nebieboy

cant get pixel search to work..

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

ok cheers for the advice :P ive edited it so its a bit more clean, also kinda got it working.. now just to make it decide the health "barrior" before using healing spells.

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  
Followers 0