Teckx Posted July 26, 2017 Share Posted July 26, 2017 (edited) for some reason the script will not make it past the first if statement. I want it to goto the second one if the first one fails $result = _ImageSearch("supv2.png",1,$x1,$y1,0) If $result=1 Then MouseMove($x1,$y1,3) MouseClick("left",$x1,$y1,1) Else $result = _ImageSearch("supv1.png",1,$x1,$y1,0) If $result=1 Then MouseMove($x1,$y1,3) MouseClick("left",$x1,$y1,1) EndIf EndIf Edited July 26, 2017 by Jos Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2017 Developers Share Posted July 26, 2017 How did you determine that? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Teckx Posted July 26, 2017 Author Share Posted July 26, 2017 12 minutes ago, Jos said: How did you determine that? Jos I hid the first image from view and the 2nd never initiated Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2017 Developers Share Posted July 26, 2017 So, how does that prove that it doesn't get past the first if? Add a MsgBox() at strategic places in the code and check that way and stop Assuming! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Teckx Posted July 26, 2017 Author Share Posted July 26, 2017 4 minutes ago, Jos said: So, how does that prove that it doesn't get past the first if? Add a MsgBox() at strategic places in the code and check that way and stop Assuming! Jos well I know it didn't get there because I removed some commands that never activate which I edited out of my first post bc of clutter aside from whether I entered message boxes etc, is my function correct? im noticing the images are not always hitting 100% and this may be the case here I tried adding $tolerance but it does not seem to work or im entering it incorrectly $result = _ImageSearch("ticketnotes.png",1,$x1,$y1,X) X = Tolerance field right? here is what I have ,, its messy that's why I removed it from here $result = _ImageSearch("supv2.png",1,$x1,$y1,0) If $result=1 Then MouseMove($x1,$y1,3) MouseClick("left",$x1,$y1,1) Send("{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{SHIFTDOWN}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{SHIFTUP}{CTRLDOWN}c{CTRLUP}") Else $result = _ImageSearch("supv1.png",1,$x1,$y1,0) If $result=1 Then MouseMove($x1,$y1,3) MouseClick("left",$x1,$y1,1) Send("{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{SHIFTDOWN}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{RIGHT}{SHIFTUP}{CTRLDOWN}c{CTRLUP}") EndIf EndIf Link to comment Share on other sites More sharing options...
Developers Jos Posted July 26, 2017 Developers Share Posted July 26, 2017 1 minute ago, Teckx said: $result = _ImageSearch("ticketnotes.png",1,$x1,$y1,X) X = Tolerance field right? No idea, this isn't a standard function. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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