← Back to team overview

sikuli-driver team mailing list archive

[Bug 1199690] Re: Region.exists(img) collects items outside Region

 

your "solution" ;-) is how it has to be.

each action, that has to be a region-restricted search, needs the
qualifier region. , otherwise it searches the whole screen.

click(image) internally is split internally into (virtually spoken)
m = region.find(image)
click(m)

with region being SCREEN (constant object for Screen(0)), if not
specified

this case should be written this way, to save the repeated search:
    if Reps.exists("1373032124430.png",2):
       Reps.click(getLastMatch());wait(3)


With 1.0.0, the usage is far easier though:
    if Reps.exists("1373032124430.png",2):
       Reps.click();wait(3)

click() clicks the last match with this region or of SCREEN if not
given.

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1199690

Title:
  Region.exists(img) collects items outside Region

Status in Sikuli:
  Invalid

Bug description:
  SikuliIDE v 1.0.0
  WinXP SP3 x86
  I have some icons(img.png) on the screen. I have to click those, that are located within sertain region.
  So I defined Region Reps and use script:
      if Reps.exists("1373032124430.png",2):   
         click("1373032124430.png");wait(3)
  It clicks on ALL icons on the screen.
  I've sold the problem with that:
      if Reps.exists("1373032124430.png",2):   
         Reps.click("1373032124430.png");wait(3)

  But I think, this is a bug.

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1199690/+subscriptions


References