Error when using "while areamsp.inside().exists("1333547327734.png").similar(0.6)"

Asked by Kannan

Hi

I am using the code below in my script:
-----------------------------------------------------
areamsp = find("El.png")

while areamsp.inside().exists("1333547327734.png").similar(0.6):
    click(find.region)
------------------------------------------------------

but I am getting an error as below.

[error] Stopped
[error] An error occurs at line 26
[error] Error message: Traceback (most recent call last):
 File "D:\Profiles\tdg863\LOCALS~1\Temp\sikuli-tmp1351026063774970092.py", line 26, in
 while areamsp.inside().exists("1333547327734.png").similar(0.6):
AttributeError: 'org.sikuli.script.Match' object has no attribute 'similar'

Could you tell me why this error is occured.

Regards
Kannan

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

--- exists() returns a Match object ...
... and .similar() is a feature of the Pattern class, that can be used instead of plain image files

while areamsp.exists(Pattern("1333547327734.png").similar(0.6)):

inside() is redundant with Sikuli X (only for backward compatibility).

--- click(find.region) ...
... is simply nonsense ;-)

Might be a good idea to read through the docs, before guessing around.

Now I am guessing what you might have meant:

while areamsp.exists(Pattern("1333547327734.png").similar(0.6)):
    click(areamsp.getLastMatch())

Revision history for this message
Kannan (umeshmsmail) said :
#2

Which is the best docuemnt that I can read....
This code I copied from a White Paper I got from Sikuli.org site

Kannan

Revision history for this message
RaiMan (raimund-hocke) said :
#3

http://sikuli.org/docx/
accessible from IDE's help menu.

BTW: the mentioned white paper does not reflect the current features and API of Sikuli. The above docs do ;-)

Can you help with this problem?

Provide an answer of your own, or ask Kannan for more information if necessary.

To post a message you must log in.