Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/autopilot-rs/autopilot-rs
A simple, cross-platform GUI automation module for Rust.
https://github.com/autopilot-rs/autopilot-rs
automation cross-platform gui input rust simulation
Last synced: about 2 months ago
JSON representation
A simple, cross-platform GUI automation module for Rust.
- Host: GitHub
- URL: https://github.com/autopilot-rs/autopilot-rs
- Owner: autopilot-rs
- License: other
- Created: 2018-04-10T22:15:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-15T17:07:38.000Z (11 months ago)
- Last Synced: 2024-05-01T17:31:16.646Z (7 months ago)
- Topics: automation, cross-platform, gui, input, rust, simulation
- Language: Rust
- Homepage:
- Size: 476 KB
- Stars: 363
- Watchers: 9
- Forks: 46
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-rust-cn - autopilot-rs/autopilot-rs - platform GUI automation library for Rust. (Libraries / GUI)
- awesome-rust - autopilot-rs/autopilot-rs - platform GUI automation library for Rust. (Libraries / GUI)
- awesome-rust - autopilot-rs/autopilot-rs - platform GUI automation library. (Libraries / GUI)
- awesome-rust-cn - autopilot-rs/autopilot-rs
- awesome-rust-zh - autopilot-rs/autopilot-rs - Rust 的简单跨平台 GUI 自动化库。 (库 / GUI)
README
[![Docs](https://docs.rs/autopilot/badge.svg)](https://docs.rs/autopilot)
[![Crates.io](https://img.shields.io/crates/v/autopilot.svg)](https://crates.io/crates/autopilot)
[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/ilcq8ev8ht49eqbx?svg=true)](https://ci.appveyor.com/project/msanders/autopilot-rs)
[![Github Build Status](https://github.com/autopilot-rs/autopilot-rs/actions/workflows/build.yaml/badge.svg)](https://github.com/autopilot-rs/autopilot-rs/actions/workflows/build.yaml)# AutoPilot
AutoPilot is a Rust port of the Python C extension
[AutoPy](http://autopy.org), a simple, cross-platform GUI automation library for
Python. For more information, see the
[README](https://github.com/autopilot-rs/autopy#autopy-introduction-and-tutorial)
on that repo.Currently supported on macOS, Windows, and X11 with the XTest extension.
## Examples
The following will move the mouse across the screen as a sine wave:
```rust
extern crate autopilot;
extern crate rand;
use rand::Rng;const TWO_PI: f64 = std::f64::consts::PI * 2.0;
fn sine_mouse_wave() {
let screen_size = autopilot::screen::size();
let scoped_height = screen_size.height / 2.0 - 10.0; // Stay in screen bounds.
let mut rng = rand::thread_rng();
for x in 0..screen_size.width as u64 {
let y = (scoped_height * ((TWO_PI * x as f64) / screen_size.width).sin() +
scoped_height).round();
let duration: u64 = rng.gen_range(1, 3);
autopilot::mouse::move_to(autopilot::geometry::Point::new(
x as f64,
y as f64
)).expect("Unable to move mouse");
std::thread::sleep(std::time::Duration::from_millis(duration));
}
}
```This will enter the keys from the string "Hello, world!" and then prompt an
alert with the same text:```rust
extern crate autopilot;fn main() {
autopilot::key::type_string("Hello, world!", &[], 200., 0.);
let _ = autopilot::alert::alert("Hello, world!", None, None, None);
}
```## Contributing
If you are interested in this project, please consider contributing. Here are a
few ways you can help:- [Report issues](https://github.com/autopilot-rs/autopilot-rs/issues).
- Fix bugs and [submit pull requests](https://github.com/autopilot-rs/autopilot-rs/pulls).
- Write, clarify, or fix documentation.
- Suggest or add new features.## License
This project is licensed under either the [Apache-2.0](LICENSE-APACHE) or
[MIT](LICENSE-MIT) license, at your option.Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.