python版微信跳一跳游戲輔助
更新時間:2018年01月11日 14:08:15 作者:Primary_wind
這篇文章主要為大家詳細(xì)介紹了python版微信跳一跳游戲輔助,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了微信跳一跳游戲輔助python代碼,供大家參考,具體內(nèi)容如下
import os import PIL import numpy import matplotlib matplotlib.use('TKAgg') import matplotlib.pyplot as plt import time from matplotlib.animation import FuncAnimation # 是否需要進(jìn)行圖片更新 need_update = True def get_screen_image(): # 截取手機當(dāng)前圖片 os.system('adb shell screencap -p /sdcard/screen.png') # 拉取到PC端 os.system('adb pull /sdcard/screen.png') # 將圖像轉(zhuǎn)成數(shù)組返回 return numpy.array(PIL.Image.open('screen.png')) def jump_to_next(point1, point2): x1, y1 = point1; x2, y2 = point2 distance = ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5 # 計算按壓指令和按壓時長 os.system("adb shell input touchscreen swipe 320 410 320 410 %d" % (distance * 1.35)) def on_clack(event, coor=[]): global need_update coor.append((event.xdata, event.ydata)) if len(coor) == 2: # 執(zhí)行跳步指令 jump_to_next(coor.pop(), coor.pop()) # 進(jìn)行圖片刷新 need_update = True def update_screen(frame): global need_update if need_update: time.sleep(2) axes_image.set_array(get_screen_image()) # 已刷新,設(shè)置為false need_update = False return axes_image, figure = plt.figure() axes_image = plt.imshow(get_screen_image(), animated=True) figure.canvas.mpl_connect('button_press_event', on_clack) # 定時更新 ani = FuncAnimation(figure, update_screen, interval=50, blit=True) plt.show()
更多內(nèi)容大家可以參考專題《微信跳一跳》進(jìn)行學(xué)習(xí)。
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:
- 微信跳一跳python自動代碼解讀1.0
- 微信跳一跳python輔助腳本(總結(jié))
- 小米5s微信跳一跳小程序python源碼
- 微信跳一跳自動運行python腳本
- 分?jǐn)?shù)霸榜! python助你微信跳一跳拿高分
- 微信跳一跳游戲python腳本
- 微信跳一跳小游戲python腳本
- 微信跳一跳輔助python代碼實現(xiàn)
- 微信跳一跳python代碼實現(xiàn)
- Python+OpenCV讓電腦幫你玩微信跳一跳
- 微信跳一跳python輔助軟件思路及圖像識別源碼解析
- python實現(xiàn)微信跳一跳輔助工具步驟詳解
- 教你用 Python 實現(xiàn)微信跳一跳(Mac+iOS版)
- python微信跳一跳游戲輔助代碼解析
相關(guān)文章
Python list與NumPy array 區(qū)分詳解
這篇文章主要介紹了Python list與NumPy array 區(qū)分詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-11-11Python3標(biāo)準(zhǔn)庫之threading進(jìn)程中管理并發(fā)操作方法
這篇文章主要介紹了Python3標(biāo)準(zhǔn)庫之threading進(jìn)程中管理并發(fā)操作方法,本文通過實例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-03-03淺談Python編程中3個常用的數(shù)據(jù)結(jié)構(gòu)和算法
這篇文章主要介紹了淺談Python編程中3個常用的數(shù)據(jù)結(jié)構(gòu)和算法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2019-04-04詳解如何在VS Code中安裝Spire.PDF for Python
這篇文章主要為大家詳細(xì)介紹了如何在VS Code中安裝Spire.PDF for Python,文中的示例代碼簡潔易懂,有需要的小伙伴可以跟隨小編一起學(xué)習(xí)一下2023-10-10