← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #670704]: Jython non-interactive command line quick as in runsikuli -i ? (Ubuntu 16.4)

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Yes, you are on the right track.

The cause for the delay at startup of running a script form commandline
is the SikuliX internal init of the Jython/Java environment, that
depending on power and memory takes about 5 seconds (and may take more
if the content of internal caches has to be renewed).

This delay can only be eliminated, if you run a script in an already initiated environment like
- SikuliX/Jython interactive using runscript() or execfile()
- running scripts in the SikuliX IDE
- using the experimental runserver
- setting up your own solution (e.g. using the hotkey feature or other mechanisms, that trigger a runscript())

- SikuliX experimental run-server feature
Be aware: currently not documented and not fully tested
The server is started using
runsikulix -s
you should get something like
[info] RunServer: Starting: trying port: 50001 
[info] RunServer: now waiting on port: 50001 at 192.168.2.103

then you can issue requests with some client (like curl from commandline):
- set the folder where the scripts are found
- set an image path
- run scripts

I will check the status of the feature during the next 24 hours and put
some info into the docs.

You might already now start experiments, If you are able to read Java code: 
org.sikuli.script.Runserver

the client requests are handled in the internal class HandleClient
method run().

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.