Skip to content

Instantly share code, notes, and snippets.

@sorcererxw
Created April 27, 2019 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sorcererxw/a0abeaa8cab6e224f77e71cca4e43bec to your computer and use it in GitHub Desktop.
Save sorcererxw/a0abeaa8cab6e224f77e71cca4e43bec to your computer and use it in GitHub Desktop.
即刻南北大战 adb 自动脚本
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