Skip to content

Instantly share code, notes, and snippets.

@nozpheratu
Created March 17, 2013 02:10
Show Gist options
  • Save nozpheratu/5179238 to your computer and use it in GitHub Desktop.
Save nozpheratu/5179238 to your computer and use it in GitHub Desktop.
script
$CLASSPATH << "/bin/Sikuli-IDE/"
require "sikuli-script.jar"
java_import 'org.sikuli.script.Region'
java_import 'org.sikuli.script.Screen'
java_import 'org.sikuli.script.Settings'
java_import 'org.sikuli.script.SikuliEvent'
java_import 'org.sikuli.script.SikuliScript'
#Crome X30 Y109
#wine /usr/local/bin/ColorPix.exe to locate pixel xy
class Bot
include Java
Sikuli=OrgSikuliScript
def initialize
@screen = Screen.new
@image_path = "images/"
@sikuli = SikuliScript.new
@screen.set_throw_exception(false)
end
def click_image(file_name)
@screen.find("#{@image_path}/#{file_name}.png")
end
def do_stuff
@screen.click(Sikuli::Location.new(30,109))
click_image("sign_in")
end
end
thing = Bot.new
thing.do_stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment