如何加快以下脚本以自动化“ slapchris.com”。手?

发布于 2025-01-17 20:13:31 字数 667 浏览 4 评论 0原文

一位朋友与我分享了一个由 Tyler Hamilton 创建的此网站托管的轻量级有趣游戏。它计算您可以在屏幕上拖动手的图像的速度。我的个人最高分是 60 公里/小时,这是通过在横向模式下旋转手机以获得更多区域并手动拖动手来实现的。

但我想使其自动化并获得最大速度。我编写了以下 python 脚本(我知道,这是相当新手!)来模拟拖动选项。

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()

但此代码片段始终给出 36 km/hr 的最大(恒定)速度。当我尝试使用 UiPath 进行自动化时,我也得到了同样的速度。关于为什么会这样或者如何优化这段代码有什么建议吗?我的猜测可能是由于鼠标驱动程序所致。

PS:这只是一个有趣的打发时间的项目。我对实际事件没有任何两极分化的看法。 #和平

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文