← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #213271]: wait problems and cut-off screen

 

Question #213271 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/213271

    Status: Needs information => Open

Lorien Stice-Lawrence gave more information on the question:
I'm using Windows 7 on both machines that I'm running this on. And it's
the newest sikuli version; I've downloaded this within the last month or
so.

--find failed error

Now I'm beginning to think perhaps this is a problem with my
understanding of the wait function. What I'd really like sikuli to do is
wait for the image to appear, or simply wait for the specified length of
time if the image doesn't show up. I've been writing this as:

wait([image],5)

or however many seconds. I then have an if statement after this so that
if the image hasn't appeared, I run another set of commands. My program
looks like this:

wait([image], 5)
if not exists([image]):
   [if statement]

but I never get to the if statement, because sikuli comes up with the
following error if the image isn't there within those 5 seconds:

[error] Stopped
[error] An error occurs at line 1
[error] Error message: Traceback (most recent call last):
 File "C:\Temp\sikuli-tmp7564513169940689990.py", line 1, in 
 wait(Pattern("OsirisList-2.png").similar(0.94),5)
 File "C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\Region.py", line 101, in wait
 Line 1, in file C:\Temp\sikuli-tmp7564513169940689990.py

 at org.sikuli.script.Region.handleFindFailed(Region.java:420) 
at org.sikuli.script.Region.wait(Region.java:511) 
at org.python.proxies.sikuli.Region$Region$0.super__wait(Unknown Source) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 

org.sikuli.script.FindFailed: FindFailed: can not find Pattern("OsirisList-2.png").similar(0.94) on the screen.
 Line 1, in file C:\Temp\sikuli-tmp7564513169940689990.py


Am I perhaps supposed to be using the sleep function for this instead? I need some way for my program to keep on running whether the image appears or not. The documentation at this point seems confusing, though I had thought before the wait function waited either for the image to appear, or the specified time, and didn't have any problems if the image didn't actually appear...

--screenshot

I'll need to wait for this problem to manifest again to take a
screenshot. But in the preview window, the bottom of the screen simply
isn't there. I'm using two monitors (though sikuli only operates on one
of them), so could that be the problem?

Thanks for your help!

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.