GithubHelp home page GithubHelp logo

linecode / libsikuli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from doubleshow/libsikuli

0.0 2.0 0.0 18.15 MB

c++ library for Sikuli

CMake 0.08% C++ 80.57% C 7.00% Shell 0.05% Java 7.58% Python 1.38% Ruby 0.01% HTML 0.51% JavaScript 2.77% CSS 0.03%

libsikuli's Introduction

Dependencies
------------

 * opencv2.1

      A computer vision library the Sikuli's visual technology is
      based upon.

Build and install Sikuli Python module
--------------------------------------

Download the source from github

$ git clone git://github.com/doubleshow/libsikuli.git

Run the Python setup script

$ cd sikuli
$ python setup.rb install

Test if it's working by running an example script

$ cd examples/python
$ python mute.rb

You can also try some basic Sikuli commands from Python's interactive shell

$ python
Python 2.7 (r27:82508, Jul  3 2010, 21:12:11) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sikuli import *
>>> click("http://www.sikuli.org/images/apple.png")



Running a script created by the Sikuli IDE
------------------------------------------

1. Use Sikuli-IDE to create a simple script to click on something.

click(IMAGE)

2. Save the script as click.sikuli

When saving the script, the Sikuli IDE will create a new directory
called click.sikuli under the directory you choose to save the
script. Using the console, you can examine the content of the
click.sikuli directory as follows:

$ cd click.sikuli
$ ls

  1281093568271.png  click.html  click.py

click.py is the python script with the one line of code you just
wrote. click.html is a web page letting you visualize the
script. 1281093568271.png is the image you captured and assigned to
the click command as the target. This image's filename is a random
number generated by the IDE and does not have any special
meaning. Don't be surprised if you see a different filename for this
image on your system.

3. To run click.py as a pure Python script. We need to explicitly
import the sikuli module in the script using an import statement. To
do so, open click.py in a text editor and add the following line in
the beginning of the file:

from sikuli import *

Note that when running the script, Sikuli IDE automatically adds the
import statement to the script and that's why we don't need to bother
adding the import statement.

After adding the import statement, the modified script should look
like:

from sikuli import * 
click("1281093568271.png")

4. In the console, run the script as follows:

$ python click.py



libsikuli's People

Contributors

doubleshow avatar vgod avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.