Last active
October 13, 2016 07:35
-
-
Save jdewind/1057cf1ed97f3b62021a6da8956c3e57 to your computer and use it in GitHub Desktop.
This file contains 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
function doTap(x, y, numTaps, delay) | |
delay = delay or 16000; | |
local fingerId = 1; | |
for i=numTaps,1,-1 | |
do | |
touchDown(fingerId, x, y); | |
usleep(delay); | |
touchUp(fingerId, x, y); | |
usleep(delay); | |
end | |
end | |
function interleaveTaps(x1, y1, x2, y2, numTaps, delay) | |
delay = delay or 16000; | |
local fingerId = 1; | |
for i=numTaps,1,-1 | |
do | |
if i % 2 == 0 then | |
touchDown(fingerId, x1, y1); | |
usleep(delay); | |
touchUp(fingerId, x1, y1); | |
usleep(delay); | |
else | |
touchDown(fingerId, x2, y2); | |
usleep(delay); | |
touchUp(fingerId, x2, y2); | |
usleep(delay); | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment