Help me finish the script.
It works manually, but not with a script.
Maybe I don't have to drive exactly straight so that there is a curved line,or did I pick up the speed incorrectly?
I tried many variants.
You need to hold down the left button, swipe in the right direction, release it, return the mouse to its original position.
for comfortable swipe photos in mobile applications or for swiping talkback gestures on an Android virtual machine.
Global $iX = 0, $iY = 0
Global $sKeySwipeLeft = "^{LEFT}"
Global $sKeySwipeRight = "^{RIGHT}"
Global $sKeySwipeUp = "^{UP}"
Global $sKeySwipeDown = "^{DOWN}"
Beep(1000, 300)
HotKeySet($sKeySwipeLeft, "swipe_left")
HotKeySet($sKeySwipeRight, "swipe_right")
HotKeySet($sKeySwipeUp, "swipe_up")
HotKeySet($sKeySwipeDown, "swipe_down")
While 1
Sleep(1000)
WEnd
Func swipe_left()
HotKeySet($sKeySwipeLeft)
Sleep(10)
;Beep(900, 100)
$iX = MouseGetPos(0)
$iY = MouseGetPos(1)
MouseDown("left")
Sleep(10)
MouseMove($iX - 100, $iY, 10)
Sleep(10)
MouseUp("left")
Sleep(10)
MouseMove($iX, $iY, 1)
HotKeySet($sKeySwipeLeft, "swipe_left")
EndFunc
Func swipe_right()
HotKeySet($sKeySwipeRight)
Sleep(10)
;Beep(900, 100)
$iX = MouseGetPos(0)
$iY = MouseGetPos(1)
MouseDown("left")
Sleep(10)
MouseMove($iX + 100, $iY, 10)
Sleep(10)
MouseUp("left")
Sleep(10)
MouseMove($iX, $iY, 1)
HotKeySet($sKeySwipeRight, "swipe_right")
EndFunc
Func swipe_up()
HotKeySet($sKeySwipeUp)
Sleep(10)
;Beep(900, 100)
$iX = MouseGetPos(0)
$iY = MouseGetPos(1)
MouseDown("left")
Sleep(10)
MouseMove($iX, $iY + 100, 10)
Sleep(10)
MouseUp("left")
Sleep(10)
MouseMove($iX, $iY, 1)
HotKeySet($sKeySwipeUp, "swipe_up")
EndFunc
Func swipe_down()
HotKeySet($sKeySwipeDown)
Sleep(10)
;Beep(900, 100)
$iX = MouseGetPos(0)
$iY = MouseGetPos(1)
MouseDown("left")
Sleep(10)
MouseMove($iX, $iY - 100, 10)
Sleep(10)
MouseUp("left")
Sleep(10)
MouseMove($iX, $iY, 1)
HotKeySet($sKeySwipeDown, "swipe_down")
EndFunc
I repeat, this works when executed manually.