Nebieboy Posted December 13, 2006 Share Posted December 13, 2006 (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 EndIfit 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 December 13, 2006 by Nebieboy Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 13, 2006 Share Posted December 13, 2006 (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 December 13, 2006 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 More sharing options...
Nebieboy Posted December 13, 2006 Author Share Posted December 13, 2006 ok cheers for the advice 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. 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