Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iberatkaya/mousebot
MouseBot is a computer automating package that can control the mouse and keyboard.
https://github.com/iberatkaya/mousebot
automation keyboard mouse node nodejs
Last synced: 8 days ago
JSON representation
MouseBot is a computer automating package that can control the mouse and keyboard.
- Host: GitHub
- URL: https://github.com/iberatkaya/mousebot
- Owner: iberatkaya
- License: mit
- Created: 2020-02-18T13:58:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T10:40:29.000Z (over 2 years ago)
- Last Synced: 2024-04-29T10:46:21.713Z (7 months ago)
- Topics: automation, keyboard, mouse, node, nodejs
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/mousebot
- Size: 194 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MouseBot
Computer automating package that can control the mouse and keyboard.
[![NPM](https://nodei.co/npm/mousebot.png)](https://nodei.co/npm/mousebot/)
MouseBot is an automating package that lets you programatically control the mouse and keyboard of your device. MouseBot was built with native Rust bindings using [neon](https://neon-bindings.com/). Check out the [API documentation](https://iberatkaya.github.io/mousebot/)!
## Building
Please make sure you have installed the global dependencies:
* Python v2.7 is recommended, although Python v3.5, v3.6, or v3.7 may work.
* npm i -g node-pre-gyp## Install
```sh
npm i mousebot
```
## Examples
```javascript
import { Bot } from 'mousebot';
//or
const { Bot } = require('mousebot');/**
* Create an instance of the class.
* Each member function of the class is an async function that returns a promise.
*/let bot = new Bot();
//Move the mouse to the coordinates x=400, y=500.
bot.mouse.move(400, 500);//Move the mouse from x=300, y=400 to x=600, y=500 smoothly.
bot.mouse.moveSmooth(300, 300, 600, 500);//Type "Hello World!"
bot.keyboard.write("Hello world!")//Chain the alt and f5 keys to perform an ALT+F5 to refresh a page.
bot.keyboard.keyChain("alt", "f5");//Directly use some implemented shortcuts.
bot.shortcuts.altTab();//Chain functions using an async function.
let chain = async () => {
await bot.mouse.moveSmooth(300, 300, 600, 500);
await bot.keyboard.write("Hello world!")
}
chain();```
## Known Issues
Currently all of the features work on Windows and Linux. On MacOS some mouse features work while most keyboard features do not work.
## Author
👤 **Ibrahim Berat Kaya**
* Github: [@iberatkaya](https://github.com/iberatkaya)
* LinkedIn: [@linkedin.com/in/ibrahim-berat-kaya/](https://linkedin.com/in/ibrahim-berat-kaya/)## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check the [issues page](https://github.com/iberatkaya/mousebot/issues).## Show your support
Give a ⭐️ if this project helped you!