Skip to content

Instantly share code, notes, and snippets.

@AeroXi
Created September 26, 2019 15:17
Show Gist options
  • Save AeroXi/be2e0b9a7336c6ac77b4b4f1211754da to your computer and use it in GitHub Desktop.
Save AeroXi/be2e0b9a7336c6ac77b4b4f1211754da to your computer and use it in GitHub Desktop.
家国梦自动收集金币和运送列车物资
from subprocess import run
from time import sleep
run(['adb devices'], shell=True)
# 打开USB调试
# 打开开发者选项——指针位置
# 将已开启的土地坐标填入 land
# 列车上物资的坐标填入 train
land = [
(322, 927),
(564, 776),
(820, 677),
(313, 1181),
(557, 1039),
(828, 941),
(323, 1426),
(585, 1318),
(810, 1180)
]
train = [
(650, 1873),
(829, 1789),
(972, 1710)
]
def get_coin(land: list):
for coord in land:
run([f'adb shell input tap {str(coord[0])} {str(coord[1])}'], shell=True)
def get_train(land: list, train: list):
for t in train:
for l in land:
run([f'adb shell input swipe {str(t[0])} {str(t[1])} {str(l[0])} {str(l[1])} 50'], shell=True)
while True:
get_coin(land)
get_train(land, train)
@AeroXi
Copy link
Author

AeroXi commented Sep 26, 2019

其实运送物资时就会手机金币,可以把get coin注释掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment