is sikuli like a device driver for the system?

Asked by katherine

does anyone know?

Question information

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

no.

It is just a Java application, that uses Java AWT Robot for mouse and keyboard actions, OpenCV for image searching and Tesseract for the Text features.
To use these features it just offers an API available in Java or Java aware scripting languages.

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

meanwhile you seem to have changed the content of the mentioned question.

but anyway:
if you do not get a match (exists returns None) you say
return failed

What is failed?

if you now run the click with this whatever return value your have:
click(failed-whatever-this-is)

if failed can be casted to a string value, then it surely is not a valid filename and hence you get the mentioned error, since Sikuli tries to use the String for text search, but text search is switched off.

Raimund aka RaiMan

On 23 Jul 2014, at 22:07, katherine <email address hidden> wrote:

New question #252079 on Sikuli:
https://answers.launchpad.net/sikuli/+question/252079

in other words, i want for it to be okay if the image is not found on the screen every time

in my code i have a class for images.

for every new image i instantiate an object of that class.

that object is used in click() and things like that.

if the image is on screen or appears before the time out, it works great!

but when the image does not appear, i get the textsearch switched off error...but im not using text search....

class image()
def __init__(image_url, timer=10)
self.image = image_url
self.timer = timer
self.pattern = self.image_pattern()

def image_pattern(self):
return Pattern(self.image)

def get(self):
image_match = SCREEN.exists(self.pattern, self.timer)
if not image_match: return failed
else: return image_match

to instantiate:

my_image = image('/home/kyoung/images/image.png', 10)

then for a click

click(my_image.get())

i typed this from memory and i know some syntax was wrong but trust me its not a syntax error how do i handle it if the image is not on screen?

--
You received this question notification because you are an answer
contact for Sikuli.

Revision history for this message
katherine (kyoung-e) said :
#3

Thanks RaiMan, that solved my question.