xuchenxixu Posted February 24, 2008 Share Posted February 24, 2008 hi. how do i write a function such that autoit will click on a cretin color on the screen? how do i get the color code? and if anyone can write this for me it would be great. the color is purple as shown in the image in attachment. thank you the code i have right now is MouseClick ( "left" , $pixel[0] + 40 , $pixel[1] + 30 , 1,0) i have no idea what that means and it is not working. ty Link to comment Share on other sites More sharing options...
Tomb Posted February 24, 2008 Share Posted February 24, 2008 hi. how do i write a function such that autoit will click on a cretin color on the screen? how do i get the color code? and if anyone can write this for me it would be great. the color is purple as shown in the image in attachment. thank you the code i have right now is MouseClick ( "left" , $pixel[0] + 40 , $pixel[1] + 30 , 1,0) i have no idea what that means and it is not working. tyI think you can find everything you need right here. get pixel Link to comment Share on other sites More sharing options...
FreeFry Posted February 25, 2008 Share Posted February 25, 2008 I think you can find everything you need right here.get pixelI assume you mean PixelGetColor.Otherwise, perhaps PixelSearch would do what you want? Link to comment Share on other sites More sharing options...
xuchenxixu Posted February 25, 2008 Author Share Posted February 25, 2008 I assume you mean PixelGetColor.Otherwise, perhaps PixelSearch would do what you want? im really new to this. could someone write the command for me Link to comment Share on other sites More sharing options...
FreeFry Posted February 25, 2008 Share Posted February 25, 2008 (edited) I'm sorry but asking for someone to write the code for you is bad.Just have a look at PixelSearch in the helpfile, or PixelGetColor if that's your preferred method(but PixelSearch does basically what you would have to do with PixelGetColor anyways..)It would look something along these lines:Dim $Color = 1234567890 ; Color you want to search for Dim $ColorVariation = 10 ; Shades/Variations of the color specified While 1 ; infinite loop yay $Coords = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $Color, $ColorVariation, 1) ; Search the whole screen If Not @error Then MouseClick("left", $Coords[0], $Coords[1], 1, 0) ; Click on the position found EndIf Sleep(250) ; sleep a little to not kill the cpu when looping :P WEndEdit:The color code can be found by using the AutoIt Window Info tool, that comes with autoit. It displays the color below your mouse pointer in the "Mouse" tab. Edited February 25, 2008 by FreeFry 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