attack_record

command
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

cmd/attack_record is a MACRO RECORDER + REPLAYER for ClashGO.

Record mode (-mode=record -out macro.json):

Captures the device screen into a GoCV window. Every left-click on
the window is BOTH forwarded to the device via adb shell input tap
AND appended to an in-memory tap list with a relative timestamp.
Press 's' to save the tap list to disk and quit, 'q' to discard.
The user drives the attack; the tool watches. ~200ms round-trip
per tap is normal (PC click → adb → emulator).

Replay mode (-mode=replay -in macro.json):

Reads the JSON tap list and emits device taps at the recorded
cadence. Use relative timestamps (ms_since_start) so pauses,
pauses-to-zoom, etc. are preserved.

Why this exists: lets the user "teach by demonstration". Play an attack once manually, save the macro, replay N times on N different bases. No code-level coordination, no YAML strategy authoring — record writes a flat time-ordered tap list, replay is purely procedural.

Output schema (macro.json):

{
  "meta": {"width": <int>, "height": <int>},    // device dim at record time
  "taps": [{"t": <ms_since_start>, "x": <px>, "y": <px>}]
}

Caveats (intentional, not bugs):

  • Coordinates are device-pixel, recorded from whatever screen the user recorded on. Macros recorded on 1280×720 are NOT portable to 860×732. Same device + same resolution assumed.
  • Single tap only. Drags/swipes for siege targeting are out of scope for v1; siege with pre-set target = single tap works.
  • The cursor position when the user clicks on the PC window is what gets sent. Misses happen if the user clicks off-image.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL