Guest Liquid8 Posted December 24, 2003 Posted December 24, 2003 Hi I would like to make a script that scans every pixel in a window for a certain color, if the color is found it clicks on it. could someone please help me with the code ?
Guest Liquid8 Posted December 24, 2003 Posted December 24, 2003 ok , im not that skilled in these things... if you have more time could you be more specific please? thanx on forehand
Lemures Posted December 24, 2003 Posted December 24, 2003 (edited) $window = "windowname" ;put window name here $color = 111111111 ;put color here WinActivate($window) WinWaitActive($window) ;sometimes it takes a second to activate it $size = WinGetPos($window) While 1 $spot = PixelSearch(0,0,$size[2],$size[3],$color) ;2 is width, 3 is height, i believe if (@error=1) Then MsgBox(0,"oh no","cant find color!") ;comment this line and the next out, and comment the continueloop, if you want it to just keep looping if it catn find it Exit ;ContinueLoop EndIf ;you might also want to move the mouse there first, it looks cooler MouseClick("left",$spot[0],$spot[1]) WEnd [code=auto:0] ..i think... *EDIT* i hate things. too lazy to fix that or whatever... but that should work Edited December 24, 2003 by Lemures
Lemures Posted December 25, 2003 Posted December 25, 2003 regarding larry's code... thats what i meant. lol. thanks
oompa86 Posted December 26, 2003 Posted December 26, 2003 how would you do a search in a certain coord box?
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