https://github.com/fbeline/automata
Automation tool for Windows
https://github.com/fbeline/automata
automation c hotkeys lua scripting windows
Last synced: about 1 month ago
JSON representation
Automation tool for Windows
- Host: GitHub
- URL: https://github.com/fbeline/automata
- Owner: fbeline
- License: bsd-2-clause
- Created: 2024-04-17T02:53:59.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-16T13:46:47.000Z (over 1 year ago)
- Last Synced: 2025-11-13T23:30:14.130Z (7 months ago)
- Topics: automation, c, hotkeys, lua, scripting, windows
- Language: C
- Homepage: https://github.com/fbeline/automata
- Size: 112 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Automata
Powerful windows automation tool for advanced users.
Automata is designed to efficiently handle keyboard and mouse input tasks through scripting.
It ensures high performance and minimal resource usage, with no reliance on external libraries or dependencies.
*Please be aware that this project is currently in its early stages.*
## Why?
**Minimal Resource Usage**:
Automata is designed to be lightweight and efficient. With a binary size of approximately 300KB and no external dependencies. The application operates in the background, consuming around 2MB of RAM.
**Flexibility and Freedom**:
Automata empowers you to write your automation scripts using [Lua](https://www.lua.org/), a open-source and battle-tested language. No need to learn a new scripting language or be constrained by limited implementations.
## Scripting with LUA
The scripting interface exposes functions for key presses, key releases, mouse movements, clicks and more.
Refer to the [scripting documentation](doc/scripting.md) for more details.
### Example
```lua
function foo()
write("foo")
end
function bar()
tap_key(KC_B)
wait(50)
press_key(KC_A)
wait(100)
release_key(KC_A)
end
function baz()
pos = mouse_position()
mouse_move(pos.x + 100, pos.y + 50)
mouse_click(M_LEFT)
end
function open_cmd()
run("powershell.exe")
-- also accepts working directory
-- run("C:\\Users", "powershell.exe")
end
-- keyboard hook
-- press those keys combinations and the action will be triggered
actions = {
{ keycode = { KC_CONTROL, KC_F1 }, action = "foo" },
{ keycode = { KC_F2 }, action = "bar" },
{ keycode = { KC_F3 }, action = "baz" },
{ keycode = { KC_CONTROL, KC_MENU, KC_T }, action = "open_cmd" },
}
```
# Quick Start
- Double-click to open `automata.exe`.
- Create a new Lua file or use the `default.lua` located in `$HOME\AppData\Roaming\Automata\`.
- Click on the tray icon to open the menu and select the script you want to load.
# UI

1. **Scripts**: List of available scripts.
1. **Reload**: Reloads the active script to apply any changes.
1. **Log**: Shows the most recent log entries.
1. **Log Pressed Keys**: Logs every pressed key, useful for debugging.
1. **Start with windows**: Launches Automata when the computer starts.
1. **Exit**: Exit the application.
# Build
- CLang
- CMake
- Ninja
- vcpkg;
```bash
# install lua
vcpkg install lua:x64-windows-static
# create build folder
cmake --preset=release
# build
cmake --build build-release
```