Automation Runtime

Automation Runtime is a library for a separately prepared script or program. The code opens a saved project, matches visual or text states, waits for conditions, and calls a unified input API. Execution is separate from project editing.

What you need to start

  • A saved project with GUI targets and the required visual features, prepared in General or GUI Automation.
  • A separate Python script that explicitly opens the project and specifies the sequence of actions.
  • Prepared dependencies for script, image search and optional OCR.
  • An input method available on the selected system, if the script needs to control the mouse and keyboard.

Automation Manager and Runtime Workbench

Automation Manager opens a prepared GUI script, its parameters, and execution log. The Run and check window (Runtime Workbench) brings together available execution and inspection targets: final code uses a saved project, a script, and a Python environment.

Viewing a saved result does not start computation or input. Before a run, the program environment and the selected input method are checked separately. Repairing a dependency or connecting a device requires another check; a green launch status does not confirm the state of the target window.

Runtime Workbench: execution target, source, inspection, and diagnostics.

Practice example. Changes apply only here and reset when you leave the example. The example provides inspection and diagnostics tabs. The source, program, and input are not started.

Input mode for a run

  • Disabled: library input actions are not sent. The rest of the script's Python code continues to run.
  • Record actions only: requested actions are saved for review without being sent through the selected input method.
  • Live input: each run requires a successful check of the configured device or driver and explicit confirmation.

These modes apply only to the Screph input library. Arbitrary Python code is not isolated: direct calls to a third-party library or command can perform actions outside this check.

Check before execution

Before a run, Screph checks that the project can be read and contains the required data. Immediately before an action, the script must check the target window, its scale, theme, and monitor. The project check does not cover these conditions.

Search for targets

MethodWhen to use it
Image matchingFor a stable visual pattern with a known scale and interface state.
OCRFor text that can change position but remains readable.
Coordinates and areaFor a limited search in a known part of the selected monitor or window.

Templates depend on scale, theme, window state, and source image quality. After searching, the script must check for the expected state before sending the input.

Input methods

  • FakerInput Virtual HID uses a system driver installed separately with Windows confirmation.
  • Arduino USB HID uses a compatible external device with prepared firmware.
  • Arduino Serial uses the selected port and matching firmware. Linux uinput requires system access to the input device; the Linux path remains experimental.

Input emulation settings select the implementation, device, keyboard layout, and typing behaviour. Settings take effect from the next operation; saving them does not send input. After moving the program to another computer, input must be configured again in its execution environment.

VHF and PS/2 are laboratory options that require a separate driver; they are not ready replacements for the main input methods. PyAutoGUI is a separate project profile, not an automatic fallback for the Screph library.

If the selected input method is not available, Automation Runtime displays an error and does not automatically switch to another method.

Start and stop

  1. Open the project and script in Automation Manager.
  2. Check the target window, monitor, scale, and input method.
  3. Run the script under supervision and keep an emergency stop available.
  4. After each important action, check the expected state of the interface.

Stopping cancels further work and shuts down processes owned by the run. If cleanup has not yet been confirmed, the stopping state remains. Commands already sent and changes already made are not undone automatically.

Security

  • The script runs with the rights of the running program and can read or modify files available to it.
  • Do not run an untested script and keep the working folder in version control or a backup.
  • Do not use the Alpha version for unattended control of critical systems.

Typical problems

  • Template not found: check the scale, theme, window state, search area and quality of the template.
  • Text not found: check Tesseract, the OCR language and the image quality in the selected region.
  • Coordinates are shifted: check the monitor, Windows scale and window position.
  • Input does not start: re-check the selected input method and the target window's permission level.