Samscript

Code Climate

A gem to replace AHK/Futscript for RS things

Installation

This gem will only work under JRuby.

Add this line to your application's Gemfile:

gem 'samscript'

And then execute:

$ bundle

Or install it yourself as:

$ gem install samscript

Example Usage

The below script simply checks if the pixel at the mouse cursor is close to black every 100ms for 1 second, and prints true/false to console depending on the success.

require 'samscript'

Screen::wait_for_pixel(colour: java.awt.Color::BLACK,
                       location: Mouse.position(as: :vector)
                       tolerance: 10
                       interval: 100
                       timeout: 1000) { |status| puts status }

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request