[2.0.4] lastMatch not updated using wait() in imported function
I stumbled across an unexpected behaviour while using one Sikuli script as import in another Sikuli script and would like to know, if maybe I am doing it wrong.
This is the main script (foo.sikuli):
-------
import bar
reload(bar)
bar.search()
-------
This is the imported script (bar.sikuli):
-------
from sikuli import *
def search():
click(
wait(
click(
-------
My expectation was that "click(
[log] CLICK on L[117,53]@S(0) (523 msec)
[log] CLICK on L[117,53]@S(0) (21 msec)
I found out that it works as expected if I use 'SCREEN.
-------
def search():
click(
SCREEN.
click(
-------
[log] CLICK on L[117,53]@S(0) (525 msec)
[log] CLICK on L[1448,395]@S(0) (523 msec)
-------
But as SCREEN should be the default, could it be that the single "wait()" updates lastMatch in the wrong context? With "find()" it works with or without an explicit "SCREEN."
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Matthias for more information if necessary.