Maxisking Posted October 13, 2008 Share Posted October 13, 2008 Well, i want this script to Find the pixel, and click it. pretty simple, but i cant get it to work, heres my code so far: Func TestProgram $Pixel = PixelSearch(32,309,2,2,0xADDEA4) If @error <> 1 Then;if pixel is found... Endif EndFunc Ok help . Can you add ; to the code for me, So i know what u did Link to comment Share on other sites More sharing options...
FaT3oYCG Posted October 13, 2008 Share Posted October 13, 2008 (edited) $Pixel = PixelSearch(32,309,2,2,0xADDEA4);if found returns an x and y co-ordinate stored in an array with the name you used as 0 and 1 If Not @error Then;if it did find it then MouseClick("left", $Pixel[0], $Pixel[1] , 1, 0);move the mouse to it instantly click the left mouse button once EndIf Edited October 13, 2008 by FaT3oYCG Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. Link to comment Share on other sites More sharing options...
Maxisking Posted October 13, 2008 Author Share Posted October 13, 2008 MouseClick("left");click the left mouse button I think thats wrong. Would it be {left}? Link to comment Share on other sites More sharing options...
Maxisking Posted October 13, 2008 Author Share Posted October 13, 2008 Also another questionhttp://www.autoitscript.com/autoit3/docs/f...PixelSearch.htmHow do i get the PixelSearch ( left, top, right, bottom )Left top right bottom Coords? Cos there is two coords? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 13, 2008 Moderators Share Posted October 13, 2008 Left = Top left "x" position of the rectangle you want to search Top = Top left "y" position of the rectangle you want to search Right = Bottom right "x" position of the rectangle you want to search (not really bottom, but you get the picture) Bottom = Bottom right "y" position of the rectangle you want to search Left/Top xy........................................ ............................................ ............................................ ............................................ ........................................xy --------------------Right/Bottom So you would have two sets of x and y coords (a starting x, a starting y, an ending x and an ending y). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Maxisking Posted October 13, 2008 Author Share Posted October 13, 2008 Thanks for clearing this up! No wonder it wouldnt find the pixel i had it all faked up Link to comment Share on other sites More sharing options...
Maxisking Posted October 13, 2008 Author Share Posted October 13, 2008 (edited) TestProgram() Func TestProgram() Send("{LWINDOWN}") Send("{LWINUP}") $Pixel = PixelSearch(14,288,42,316,0x58A6F7);if found returns an x and y co-ordinate stored in an array with the name you used as 0 and 1 If Not @error Then;if it did find it then MouseMove($Pixel[0], $Pixel[1] , 0 );move the mouse to it instantly MouseClick("");click the left mouse button EndIf EndFunc This should work? All it does is open up the menu? Edited October 13, 2008 by Maxisking Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 13, 2008 Moderators Share Posted October 13, 2008 TestProgram() Func TestProgram() Send("{LWINDOWN}") Send("{LWINUP}") $Pixel = PixelSearch(14,288,42,316,0x58A6F7);if found returns an x and y co-ordinate stored in an array with the name you used as 0 and 1 If Not @error Then;if it did find it then MouseMove($Pixel[0], $Pixel[1] , 0 );move the mouse to it instantly MouseClick("");click the left mouse button EndIf EndFunc This should work? All it does is open up the menu?Are you seriously asking us this question? Are we to know what in the world you're doing? lol... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Maxisking Posted October 13, 2008 Author Share Posted October 13, 2008 O srry ill explain, first it opens up The windows menu, then it find the windows live messenger icon and clicks it. prety simple but it doesnt seem to be working. 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