Skip to main content

stars issues ci build version deno version vr scripts

AutoPilot is a simple cross-platform desktop automation library for Deno.

Get in touch:

  • Discord: undefined_void#8575

Features

  • Keyboard

    • Type a string using .type
    • Tap a key using .tap
    • Toggle key using .toggleKey
  • Mouse

    • Simulate mouse movement using .moveMouse
    • Get mouse position using .mousePosition
    • Get mouse position pixel color .pixelColor
  • Screen

    • Capture screen using .screenshot
    • Get screen size using .screenSize
    • Check if point out of bounds using .pointVisible
    • Get number of pixels in a point using .screenScale
  • Notifications

    • Native popup using .alert
    • Notifications using .notify
  • Window management (only on Linux, sry)

    • Get the number of monitors using .getMonitors
    • Get window title using .getWindow
    • Transform windows size using .transformByIndex

Documentation

Detailed documentation of the API is available at:

https://autopilot.divy.work

Requirements

Linux

sudo apt-get update
sudo apt-get install libdbus-1-dev x11-xserver-utils wmctrl libxtst-dev cmake libc-dev libx11-dev libxcb1-dev

Usage

Running your Deno script with AutoPilot requires some flags

deno run --unstable -A file.ts

NOTE: Prebuilt binaries are automatically downloaded the first time you import Autopilot in your project and are cached.

import AutoPilot from 'https://deno.land/x/autopilot/mod.ts';

// create a new AutoPilot instance.
var pilot = new AutoPilot();

// type a string
pilot.type("Yay! This works");

// alert something
pilot.alert("This is a alert");

// get screen size
pilot.screenSize();

// move mouse
pilot.moveMouse(200, 400);

// take a full-screen screenshot
pilot.screenshot("screenshot.png");