bunbot
Version:
Desktop automation for Bun.
67 lines (45 loc) • 1.35 kB
Markdown
[<img src="https://i.imgur.com/iQgEyms.jpg" title="Generated using Craiyon, formerly DALL-E mini" align="right" width="120">]([https://deno.land](https://www.craiyon.com/))
Desktop automation for the Bun runtime. Currently works on Mac.
[](https://www.npmjs.com/package/bunbot) 
Bunbot uses [RobotGo](https://github.com/go-vgo/robotgo) via `bun:ffi`. Please see RobotGo's requirements [here](https://github.com/go-vgo/robotgo#requirements).
```bash
bun add bunbot
```
```ts
import Bunbot from 'bunbot'
const bb = new Bunbot()
// Click
bb.click()
// Get mouse position coordinates
const mousePosition = bb.getMousePosition()
// Move mouse
bb.moveMouse(200, 400)
// Move mouse smoothly
bb.moveMouseSmooth(200, 400)
// Scroll mouse
bb.scrollMouse(100, 200)
```
```ts
import Bunbot from 'bunbot'
const bb = new Bunbot()
// Type a string
bb.type('Hello world!')
// Tap a key
bb.tap('i', 'alt', 'command')
```
```ts
import Bunbot from 'bunbot'
const bb = new Bunbot()
// Get screen size
const screenSize = bb.getScreenSize()
// Get scale size
const scaleSize = bb.getScaleSize()
```
MIT