Question #698118 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698118

RaiMan proposed the following answer:
if nothing else is said, images are searched on the whole screen.
The search would be faster, if you restrict the region as much as possible to 
the area, where you expect the image to appear.

On large screens in most cases it is enough to restrict to the app window:
searchArea = App.focusedWindow()

now you might define additional search areas relative to the (x,y) of your 
primary area
see: 
https://sikulix-2014.readthedocs.io/en/latest/region.html#extend-regions-and-create-new-regions-based-on-existing-regions

I do not understand, why you click 4 times using the image:
if exists(fishButton):
    for x in range(4):
        click (fishButton)

my variant:
click(wait(fishButton))

or for more control:
if exists(fishButton):
    click() # clicks on the last match

now a region, where you expect things to happen:
reg = ... # somehow define it

if reg.exists(fishAppear, 2 * 60):
    reg.click(getFish) # see comment

comment: this should work, since if nothing else is said, the search
repeats for 3 seconds.

Another aspect to look at: Settings.WaitScanRate
This 3 in the standard, meaning 3 searches per second max, which normally is 
sufficient.

In special cases, when you have small search areas, where a search might take 
only some 10 milli secs you might raise this value to a higher value (e.g. 10 
means max 10 searches per second, which only makes sense, if searches ar faster 
then 100 milli secs).
Higher values don't do any harm, but only have an effect, if the search times 
fit.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to