Created
February 24, 2024 22:56
-
-
Save Jimbly/d92d4fa88d273d7fa4e9ee9cbc1aa43f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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