← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #214725]: Facing issue while importing Sikuli script in Eclipse

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
again step by step:
- unjar (or uncompress with smthg. like 7zip) sikuli-script.jar to some folder x
- there is a folder Lib, that contains a folder sikuli
- ONLY this folder sikuli copy to the jython lib site-packages folder
- now you should delete the above folder x again (no longer needed)
- remove the entry C:\sikuli-script\Lib from the projects libraries list (this is a wrong entry!). Since the Sikuli Python stuff is now in site-packages, it will be found automatically by Jython.
- have the entry "C:\Program Files\Sikuli X\sikuli-script.jar" in Jython Interpreters Preferences dialog box_Libraries tab. (you have it already - ok)

to test that it works, just put these lines in your main source file:
from sikuli import *
setShowActions(True) # switch on slow motion
img = capture() # interactive capture sthg. visible
find(img) # find it
getLastMatch().highlight(2) # highlight it
hover(getLastMatch()) # move mouse to it

If this works, then you can start to make a concept on how to structure
your project and where to store the images.

All the above assumes, that you have a running Sikuli X installation as
mentioned in faq 2005

In Eclipse editor you have to live with the problem, that it tells you,
that it does not know the Sikuli names like click and others. This
cannot be solved with the mix of Jython and Java as it is used with
Sikuli.

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