'How to speed up the following script to automate the "slapchris.com" hand?

A friend shared with me a lightweight funny game hosted on this site, created by Tyler Hamilton. It calculates the speed at which you can drag the image of a hand across the screen. I have a personal high score of 60km/hr, achieved by rotating the phone in landscape mode to get more area and manually dragging the hand.

But I wanted to automate it and get the maximum speed. I wrote this following python script (Pretty novice, I know!) to emulate the drag option.

import webbrowser
import time
import pyautogui

webbrowser.open("https://www.slapchris.com")

time.sleep(3)

pyautogui.moveTo(392,517)
pyautogui.mouseDown(button='left')
pyautogui.moveTo(1435,493)
pyautogui.mouseUp()

But this snippet always gives a maximum (constant) speed of 36 km/hr. I got this same speed when I tried to automate using UiPath too. Any suggestions on why is it so, or how to optimize this code? My guess is probably due to the mouse driver.

PS: This is just a fun time pass project. I don't have any polarized opinion on the actual event. #Peace



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source