Created
March 17, 2013 02:10
-
-
Save nozpheratu/5179238 to your computer and use it in GitHub Desktop.
script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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