Ryukk0 Posted August 27, 2011 Share Posted August 27, 2011 Hi, im new in coding i just want to make a simple pixel search script. I put a folder in my desktop and i run the script to find it by pixel coller and click's 2x. It does fine, but after it opens the folder the script just spam click's on the folder place, but the coller isnt there anymore cus ther folder open in fullscreen. HotKeySet("{F3}","exit") Func exit() Exit EndFunc MsgBox(0, "Test", "Press F3 to close.") $pixel = PixelSearch(0,0,1023,800, 0xE78A3A) while 1 = 1 if IsArray($pixel) = True Then MouseMove($pixel[0], $pixel[1],1) MouseClick("left") MouseClick("left") sleep(1000) EndIf WEnd can any 1 plez help me XS can't get it right. ps: sorry for bad english Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 27, 2011 Share Posted August 27, 2011 $pixel gets set to be an array, and in the while loop it's always an array, so it's always true. The three mouse statements can be replaced with one mouseclick line - MouseClick("left", $pixel[0], $pixel[1], 2, 1). - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Ryukk0 Posted August 27, 2011 Author Share Posted August 27, 2011 (edited) ok so i did this: while 1 = 1 if IsArray($pixel) Then MouseClick("left", $pixel[0], $pixel[1], 2, 1) sleep(1000) EndIf WEnd it does the same thing click spam =/ Edited August 27, 2011 by Ryukk0 Link to comment Share on other sites More sharing options...
JohnOne Posted August 27, 2011 Share Posted August 27, 2011 Just remove while 1 = 1 and WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Ryukk0 Posted August 27, 2011 Author Share Posted August 27, 2011 no, i think. i whant the script to do this: find the color click it and if color desapears stop clicking till i have the color again to do the same thing i think cod is right i can't figure out is why spam click when the color isnt there =/ Link to comment Share on other sites More sharing options...
JohnOne Posted August 27, 2011 Share Posted August 27, 2011 Then put this $pixel = PixelSearch(0,0,1023,800, 0xE78A3A) first inside your loop AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Ryukk0 Posted August 27, 2011 Author Share Posted August 27, 2011 OMG! i was busting my * off, and it was that simple omg. why it needs to be in loop??? and ty for the help Link to comment Share on other sites More sharing options...
JohnOne Posted August 27, 2011 Share Posted August 27, 2011 Because it needs to keep checking if the pixel is there. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Ryukk0 Posted August 27, 2011 Author Share Posted August 27, 2011 Make's sence... TY all for Help.... 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