這個暑假我用Python賺了30000元!因為做了一個王者金幣腳本

原理很簡單,就是用adb調試工具模擬點擊屏幕,多次刷冒險之旅->冒險模式->挑戰->隕落的廢都->魔女回憶。用Linux的shell等其他工具也可輕鬆實現。


這個暑假我用Python賺了30000元!因為做了一個王者金幣腳本

私信小編(資料) 獲取打包好的源碼哦!

廢話不多說,adb工具請點擊 http://adbshell.com/downloads ,adb.exe 所在路徑需要添加到path變量裡。

python 3代碼如下:


import os
import time
def kill_monsters():
#殺怪
for t in range(45):
print("kill time: {0}".format(t))
#adb路徑不加入到path變量,需要絕對路徑運行adb,類似:
#os.system("C:\\\\your_adb_path\\\\adb shell input tap 1320 600")
os.system("adb shell input tap 1320 600")
def again():
#再來一次
os.system("adb shell input tap 1277 656")
def click_start():
#點擊開始
os.system("adb shell input tap 1094 588")
if __name__ == '__main__':
times = 0
while True:
times += 1
print("repeat times: \\t {0}".format(times))
again()
time.sleep(6)
click_start()
time.sleep(12)
kill_monsters()
time.sleep(6)

上面代碼的 "adb shell input tap 1320 600" 中的兩個數字是我手機屏幕的座標,這可以通過打開安卓的開發人員選項->指針位置獲得。


這個暑假我用Python賺了30000元!因為做了一個王者金幣腳本


進一步,如果想實現連招等操作(如露娜),會比較困難,因為一次點擊用的時間比較長,我暫時還無法實現~

對其他一些需要大量重複操作(點擊、滑動屏幕等)的手機遊戲用adb加編程可輕鬆實現。

另,滑動屏幕的操作adb命令如下:


#從(666,666)滑動到(777,777)200毫秒內
input swipe 666 666 777 777 200


分享到:


相關文章: