123 lines
2.9 KiB
Markdown
123 lines
2.9 KiB
Markdown
# Anti Prestige Tool v0.7.5
|
|
|
|
Queue-position reader for Arma Reforger on Linux Wayland.
|
|
|
|
The tool captures a user-selected Reforger window through xdg-desktop-portal/PipeWire, crops the queue-number region, and reads the orange UI digits with bundled real-game digit templates. Normal use does not require external OCR libraries, desktop-specific screenshot hooks, or a specific installed font.
|
|
|
|
## Install
|
|
|
|
Install system dependencies:
|
|
|
|
```bash
|
|
# Arch example
|
|
sudo pacman -S --needed base-devel uv qt6-base gstreamer gst-plugins-base gst-plugin-pipewire imagemagick xdg-desktop-portal
|
|
```
|
|
|
|
Install the portal backend for your desktop:
|
|
|
|
```text
|
|
KDE: xdg-desktop-portal-kde
|
|
GNOME: xdg-desktop-portal-gnome
|
|
wlr: xdg-desktop-portal-wlr
|
|
```
|
|
|
|
Set up the Python environment and build the portal helper:
|
|
|
|
```bash
|
|
uv sync
|
|
make
|
|
```
|
|
|
|
No sudo install step is required.
|
|
|
|
## Use
|
|
|
|
Run:
|
|
|
|
```bash
|
|
uv run reforger_queue_read.py --portal-window --show-crop --debug
|
|
```
|
|
|
|
On first run, your desktop should show a window-sharing picker. Select the Arma Reforger window. If the portal grants persistence, the tool stores a restore token here:
|
|
|
|
```text
|
|
~/.local/state/anti-prestige-tool/portal-window-restore-token
|
|
```
|
|
|
|
Later runs try to reuse that token:
|
|
|
|
```bash
|
|
uv run reforger_queue_read.py --portal-window --show-crop --debug
|
|
```
|
|
|
|
Force a fresh picker if the saved selection is wrong or stale:
|
|
|
|
```bash
|
|
uv run reforger_queue_read.py --portal-window --portal-reselect --show-crop --debug
|
|
```
|
|
|
|
Save the captured input image while debugging:
|
|
|
|
```bash
|
|
uv run reforger_queue_read.py --portal-window --save-input /tmp/apt-portal-window.png --show-crop --debug
|
|
```
|
|
|
|
## Validation
|
|
|
|
Run the regression set:
|
|
|
|
```bash
|
|
uv run reforger_queue_read.py --dataset datasets/regression-test-set --expect-filenames
|
|
```
|
|
|
|
Expected result:
|
|
|
|
```text
|
|
summary: 21 passed, 0 failed
|
|
```
|
|
|
|
Run the smaller smoke dataset:
|
|
|
|
```bash
|
|
uv run reforger_queue_read.py --dataset datasets/scootz-dataset --show-crop
|
|
```
|
|
|
|
Expected output:
|
|
|
|
```text
|
|
datasets/scootz-dataset/1920x1080.png crop=788,465,75,45
|
|
datasets/scootz-dataset/1920x1080.png 22
|
|
datasets/scootz-dataset/2160x1440.png crop=1050,620,100,60
|
|
datasets/scootz-dataset/2160x1440.png 24
|
|
```
|
|
|
|
## Debug Options
|
|
|
|
Read an existing screenshot:
|
|
|
|
```bash
|
|
uv run reforger_queue_read.py --image /path/to/screenshot.png --show-crop --debug
|
|
```
|
|
|
|
The default matcher uses bundled templates from:
|
|
|
|
```text
|
|
templates/reforger_digits.json
|
|
```
|
|
|
|
Font mode is only for debugging. Known-good overrides:
|
|
|
|
```bash
|
|
uv run reforger_queue_read.py --portal-window --font Roboto-Condensed --show-crop --debug
|
|
uv run reforger_queue_read.py --portal-window --font Adwaita-Sans --show-crop --debug
|
|
```
|
|
|
|
Default crop reference:
|
|
|
|
```text
|
|
reference-size: 2560x1440
|
|
reference-crop: 1050,620,100,60
|
|
scale-mode: width
|
|
```
|
|
|
|
Portal restore behavior depends on the desktop portal. If the selected window disappears after an Arma restart, the portal may show the picker again.
|