Hold to Auto-Click

@rebind / hold-to-auto-clickv0.1.2Public

Hold a side button and it clicks up to 50 times a second. Let go, it stops.

Files

Older release. Installs get 0.1.2.

main.luau498 B

-- Hold to Auto-Click: while the trigger is held, click the left button at the
-- chosen rate. Letting go stops it at once.

local cfg = UI.Schema({
  trigger = UI.Keybind("Mouse5", { label = "Hold to click" }),
  cps = UI.Slider(20, {
    min = 5,
    max = 50,
    suffix = " /s",
    label = "Clicks per second",
  }),
})

Bind(
  cfg.trigger,
  Async(function()
    while Input.IsDown(cfg.trigger) do
      HID.Press("Mouse1", 10)
      Sleep(math.max(0, 1000 / cfg.cps - 10))
    end
  end)
)

3 files, 1.8 KB.