Created
April 27, 2019 14:07
-
-
Save sorcererxw/a0abeaa8cab6e224f77e71cca4e43bec to your computer and use it in GitHub Desktop.
即刻南北大战 adb 自动脚本
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
import subprocess | |
import sys | |
import time | |
from datetime import datetime | |
def adbShell(command): | |
subprocess.Popen(["adb", "shell", command], | |
stdin=subprocess.PIPE, stdout=subprocess.PIPE) | |
cnt = 0 | |
peer = 20 | |
tapTime = 0 | |
startTime = datetime.utcnow().timestamp() | |
while True: | |
cnt += 1 | |
command = "" | |
for j in range(0, peer): | |
command += "input tap 512 1800;" | |
command += "input tap 512 1500;" # 关闭警告窗口 | |
adbShell(command) | |
endTime = datetime.utcnow().timestamp() | |
tapTime += peer | |
avg = tapTime/100/(endTime - startTime) | |
print("SUM={} AVG={:.1f} tap/S SPEED={:.1f} S/碗".format(tapTime, avg, 1.0/avg)) | |
time.sleep(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment