Skip to content

sometgirldotonline/Autom8

Repository files navigation

Autom8 - Apple Automate alternative in Python

This application is licensed under the Mozilla Public License Version Two. Autom8 is only tested for compatability with Linux (Ubuntu 24.04 specifically), and may not be compatible with other systems. If you'd like to help with compatability, please create an issue.

./am8cli.py

The commandline tool to execute AM8 Scripts, which can be written in AM8Lang or AM8Lang JSON. Pass it the file to run as the first argument, or append --convert to convert a file with output ending up in the path specified after the argument

Commandline options:

--convert {output filename} Convert AM8Lang into AM8Lang JSON. Currently only from AM8 to JSON.

./am8gui.py

The GUI editor for AM8. Outputs JSON files Uses pyqt6. Currently only supports a small subset of the actions (no inline python or repeats)

Why two formats?

I created AM8 to run JSON based code orignally, but I realised that JSON is a bit clunky to write, so I built AM8Lang for simplicity. I kept JSON around as it is: A. Easier to work with, AM8Lang is parsed into JSON for codebase simplicity B. AM8Lang is entirely positional and, due to its positionality is not recomended for long time use.

AM8Lang Command Structure

print {string}

the print command, you can provide it a string, variable, integer.

type {string}

types text by pressing keys. you can provide it a string, variable, integer.

set var=val

Set a variable. Can be retrieved with $varname

hotkey {string+}

Presses a hotkey combo. To press control+a as an example, you'd write hotkey ctrl a

click {x,y or string} [--btn left,right]

Clicks at a position, or uses OCR to find a string on screen and click the string.

sleep s

Sleep for s seconds.

repeat int

Repeats the following code for int repetitions. You can access the current count with the $RPT variable. End loops with end command

mmove {x,y or string}

moves to text position, or uses OCR to find a string on screen and move to it

Inline python

You can execute python inside of AM8 like this

print("Hello from python!")
>PY

You can access any variables from AM8 using the env object like this env["am8-object"] Any changes to this object appear in AM8

Builtins

AM8 provides several builtin variables for ease of use. These can be used from both python and AM8. Currently these variables are not updated live in python. To update the variables, please end the python block and start a new one.

am8.clipboard

Can be used to read and set the clipboard. Uses pyperclip under the hood

am8.time

Gets current system time in format of H:M:S AM/PM

am8.date

Gets current date in format of: 24th November 2025

am8.epoch

Current seconds since the unix epoch.

AM8JSON.

heres a small subset of actions i am lazy lolz

print

{
    "act":"print",
    "text": "i am printed :3"
}

type

{
    "act":"type",
    "text":"Text to type",
    "iv": 0 # how many seconds between keypresses
}

set

{
    "act":"set",
    "var":"variable name",
    "val":"variable value"
}

hotkey

{
    "act":"hotkey",
    "keys":"ctrl a"
}

click

{
    "act":"click",
    "x":0,
    "y":0,
    "text":"Text to click (cannot be used with X/Y)"
}

sleep

{
    "act":"sleep",
    "s": 0 # seconds to wait
}

mmove

{
    "act":"mmove",
    "x": 0,
    "y": 0,
    "text": "Text to move to, cannot be used with X/Y"
}

The future of AM8

I plan to continue improving AM8 outside of Hack Club Siege, as AM8 (and a few other of my siege projects) are actually useful to myself, and I see value of improving it.

Future improvements include

  • Run JS in Nodejs, including synchronisation of variables
  • If statments (somehow i forgot about these)
  • Run JS in browser windows (wuth sync of vars)
  • Run shell scripts.
  • Rewrite in RUST :3
  • Making the GUI support all actions, and rewriting it so its not a cursed spaghetti of Python and HTML.

Read todo.txt for all planned commands

Technical Overview of command parser

I had originally planned to use an Abstract Syntax Tree (aka AST) for AM8, but soon realised that it overcomplicates things and that there technically was an AST avaliable to us already, this comes in the form of the argparse library, which is designed to parse commandline arguments, but you can feed arbitrary arguments to it, so line by line we pass each command into argparse, parse it and put it into a JSON array, which is then later executed with a loop. However there was a small interim between these two when the language used JSON. I had the dumb idea of making strings arrays so you could insert variables something like this: {"var":"varname"} but when it pivoted to using its own language, I realised that this would not work, or just be clunky, the language has since been migrated to using the dollarsign syntax, which can be used in basically any input, numbers, text etc.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published