mousebot
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

MouseBot

Computer automating package that can control the mouse and keyboard.

NPM

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. Check out the API documentation!

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

npm i mousebot

Examples

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

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check the issues page.

Show your support

Give a ⭐️ if this project helped you!

Package Sidebar

Install

npm i mousebot

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

977 kB

Total Files

6

Last publish

Collaborators

  • iberatkaya