Jump to content

Recommended Posts

Posted (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 by Jos
Posted
12 minutes ago, Jos said:

How did you determine that?

Jos

I hid the first image from view and the 2nd never initiated

Posted
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

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...