Skip to content

Instantly share code, notes, and snippets.

@Jimbly
Created February 24, 2024 22:56
Show Gist options
  • Save Jimbly/d92d4fa88d273d7fa4e9ee9cbc1aa43f to your computer and use it in GitHub Desktop.
Save Jimbly/d92d4fa88d273d7fa4e9ee9cbc1aa43f to your computer and use it in GitHub Desktop.
assert(loadfile("common.inc"))();
askText = singleLine([[
Choose window
]]);
function sws(delay, msg)
sleepWithStatus(delay, msg, 0xFFFFFFff);
end
function doit()
local click = false;
local held = false;
askForWindow(askText);
while 1 do
checkBreak();
if lsControlHeld() then
sws(10, "Release!");
held = true;
else
if held then
held = false;
click = not click;
sws(10, "Toggled");
end
if click then
sws(10, "Clicking!");
local x, y = srMousePos();
srKeyEvent(" "); -- adjust this to the required key
else
sws(100, "tap ctrl to toggle clicking");
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment