AI chat

Move my mouse in a slow circle while F8 is held

How it works

  • Trigger & Hold Check: When F8 is pressed, OnDown intercepts the key, returns false so F8 is swallowed by the system, and launches a background coroutine via Run(). The loop continues as long as Input.IsDown("F8") remains true.
  • Parametric Circle: At each step, it calculates the next $(x, y)$ coordinate along a circle using math.cos and math.sin. Using elapsed time (System.Time()) ensures the motion stays smooth and matches the configured revolution speed regardless of tick timing.
  • Sub-Pixel Preservation: Because mouse movement coordinates (HID.Move) must be integer deltas, sub-pixel remainders are accumulated across iterations to prevent trajectory drift or uneven stuttering.
  • Options Panel: You can adjust the circle radius and revolution duration directly in the script's Options tab without touching the code.
  • Cleanup: OnStop and OnBlur cancel the active movement task if the script is stopped or your active window loses focus.

Learn more