Ready-to-use Code ExampleswipeGesturePointPoint

Swipe Between Coordinates

Creates a swipe gesture between two coordinates. Define waypoints with GesturePoint(Point, holdMs, moveMs) and pass them as a table to swipe(): moveMs is the duration of the move into the point and holdMs the rest after reaching it. Used for scrolling lists and switching pages.

Completion, parameter hints and type checking. Installation instructions and downloads are hosted on GitHub.

Copyable Example Code

You can paste this into the code editor; still verify target image, region, color, text, and timing values in your own device flow.

-- Basic swipes
-- GesturePoint(Point(x, y), holdMs, moveMs)

-- Scroll a list up
swipe({
  GesturePoint(Point(540, 1500), 0, 0),
  GesturePoint(Point(540, 500), 0, 400)
})
wait(500)

-- Switch page sideways
swipe({
  GesturePoint(Point(900, 960), 0, 0),
  GesturePoint(Point(180, 960), 0, 300)
})
wait(500)

-- Slow swipe for precise control
swipe({
  GesturePoint(Point(540, 1200), 0, 0),
  GesturePoint(Point(540, 800), 0, 1000)
})
toast("Swipes finished")

Implementation and Adaptation Notes

  • Before running, replace sample values such as image names, text, colors, coordinates, and file paths with your own macro values.
  • For examples that use Region or coordinates, retest the target area on different resolutions and DPI values.
  • Tune mScore, timeout, and scan rate in a test macro first, then move the verified values into the production macro.