awp123 Posted May 27, 2013 Posted May 27, 2013 ;click this image if it isn't find above images... I have problem here :/ How can i do it ? I have else statement error... I have problem on "else" code... expandcollapse popup#include <ImageSearch.au3> HotKeySet("{ESC}", "Terminate") $x = 1000 $y = 100 While 1 ;right 1 $res1 = _imagesearchArea('pictures1right.png', 1, 469, 633, 626, 739, $x, $y, 0) If $res1 = 1 Then MouseMove(620,489,3) MouseClick ("left") EndIf ;left 1 $res1 = _imagesearchArea('pictures1left.png',1, 1300, 631, 1480, 729, $x, $y, 0) If $res1 = 1 Then MouseMove(1288, 499,3) MouseClick ("left") EndIf ;right 2 $res1 = _imagesearchArea('pictures2right.png', 1, 469, 633, 626, 739, $x, $y, 0) If $res1 = 1 Then MouseMove(620,489,3) MouseClick ("left") EndIf ;left 2 $res1 = _imagesearchArea('pictures2left.png',1, 1300, 631, 1480, 729, $x, $y, 0) If $res1 = 1 Then MouseMove(1288, 499,3) MouseClick ("left") EndIf ELSE ;click this image if it isn't find above images... I have problem here :/ How can i do it ? I have else statement error... $res1 = _imagesearchArea('change.png',1, 805, 679, 1166, 805, $x, $y, 0) If $res1 = 1 Then MouseMove($x, $y,3) MouseClick ("left") WEnd Func Terminate() Exit 0 EndFunc
MouseSpotter Posted May 27, 2013 Posted May 27, 2013 Have a look at the "If" help. you cannot put an else all by itself. The pattern is If <expression> Then statements ...[ElseIf expression-n Then [elseif statements ... ]] ...[Else [else statements] ...EndIf
somdcomputerguy Posted May 27, 2013 Posted May 27, 2013 And your last If loop has no EndIf. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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