|
Post by joaoxfranco on Aug 17, 2019 2:39:58 GMT
In some game I'm playing, you "walk" by dragging and holding until you stop.
I wish to make a macro that drags and hold right in a 1920 x 1080 screen, for 20 seconds. Let go, then drag and hold left for 20 seconds; with the phone held horizontally(landscape).
I came across the function dragDrop(PSMRL, PSMRL) But I don't understand how to use it properly. Can anyone make an example with numbers, if possible using the numbers above?
|
|
|
Post by AnkuLua on Aug 17, 2019 22:49:55 GMT
|
|
|
Post by Exilereven on Aug 19, 2019 4:31:30 GMT
In some game I'm playing, you "walk" by dragging and holding until you stop. I wish to make a macro that drags and hold right in a 1920 x 1080 screen, for 20 seconds. Let go, then drag and hold left for 20 seconds; with the phone held horizontally(landscape). I came across the function dragDrop(PSMRL, PSMRL) But I don't understand how to use it properly. Can anyone make an example with numbers, if possible using the numbers above? Not tested. But play around with this code and you can do a lot in a game like your playing. This should go left by using moveDir("left") for 20 seconds. And vice versa for the right side. Settings:setCompareDimension(true, 1920) Settings:setScriptDimension(true, 1920) function swipeDir(direction) print("Swiping: " ..direction) --1920x1080 locs local start = Location(960, 540) --middle of screen local move_Left = Location(560, 540) local move_Right = Location(1460, 540) setManualTouchParameter(5, 1) left = { {action = "touchDown", target = start}, {action = "wait", target = 0.2}, {action = "touchMove", target = move_Left}, {action = "wait", target = 20}, --how many seconds to hold the swipe left {action = "touchUp", target = move_Left} } right = { {action = "touchDown", target = start}, {action = "wait", target = 0.2}, {action = "touchMove", target = move_Right}, {action = "wait", target = 20}, --how many seconds to hold the swipe right {action = "touchUp", target = move_Right} } if direction == "right" then manualTouch(right) print(direction) end if direction == "left" then manualTouch(left) print(direction) end end swipeDir("left") swipeDir("right")
|
|