Lucidity Posted April 3, 2012 Share Posted April 3, 2012 (edited) Alright, I got a blue button I want to click on when it's available, so far the script works. When the blue button is clicked, the button will turn gray instantly. The code then wanna check if the blue button now turned the gray color, if it did, then it will click on a green button. If it doesn't, it will jump to a skip function. Where it fails, is when it's gonna check for the gray color. The gray color is there, but it jumps to the skip function anyway. Where in the script is the wrong? I have red it a couple of times myself and added notes on the side of them. Func Go() $Blue = PixelSearch(822, 550, 860, 565, 0x3B5998) ; Setup for the blue $Gray = PixelSearch(822, 550, 860, 565, 0xEEEEEE) ; Setup for the gray $Green = PixelSearch(741, 609, 812, 650, 0x009D0B) ; Setup for the green If IsArray($Blue) Then ; If it is blue Mouseclick("left",$Blue[0], $Blue[1]) ; then it will click on the blue Sleep(500) Else ; If it's not blue.. Sleep(100) Wait() ; ..it will jump to wait function EndIf If IsArray($Gray) Then ; If the blue is now gray.. Mouseclick("left",$Green[0], $Green[1]) ; ..then click on the green Else ; If it is not gray Skip() ; .. it jumps to skip function EndIf Wait() ; jumps to wait function EndFunc Edited April 3, 2012 by Lucidity Link to comment Share on other sites More sharing options...
subzerostig Posted April 3, 2012 Share Posted April 3, 2012 (edited) Just one thing, this seems a lot like game automation. I would be happy to help, if you could tell/show me what this script will be used for. Edited April 3, 2012 by subzerostig There are 10 types of people in this world. Those that understand binary, and those that do not Link to comment Share on other sites More sharing options...
Lucidity Posted April 3, 2012 Author Share Posted April 3, 2012 It's for a site and not a game. Though I fixed it by putting the $Gray = PixelSearch one before the if $Gray code Link to comment Share on other sites More sharing options...
Bert Posted April 3, 2012 Share Posted April 3, 2012 If it is a site, have you tried to see if you could use the IE controls so you could click on the control directly? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Lucidity Posted April 3, 2012 Author Share Posted April 3, 2012 If it is a site, have you tried to see if you could use the IE controls so you could click on the control directly?I don't understand. What's IE controls? internet explorer? :s Link to comment Share on other sites More sharing options...
Bert Posted April 3, 2012 Share Posted April 3, 2012 no. IE.au3. Look in the AutoIt Help file The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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