国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

python版微信跳一跳游戲輔助

2020-02-16 11:36:28
字體:
來源:轉載
供稿:網友

本文實例為大家分享了微信跳一跳游戲輔助python代碼,供大家參考,具體內容如下

import osimport PILimport numpyimport matplotlibmatplotlib.use('TKAgg')import matplotlib.pyplot as pltimport timefrom matplotlib.animation import FuncAnimation# 是否需要進行圖片更新need_update = Truedef get_screen_image(): # 截取手機當前圖片 os.system('adb shell screencap -p /sdcard/screen.png') # 拉取到PC端 os.system('adb pull /sdcard/screen.png') # 將圖像轉成數組返回 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: # 執行跳步指令 jump_to_next(coor.pop(), coor.pop()) # 進行圖片刷新 need_update = Truedef update_screen(frame): global need_update if need_update: time.sleep(2) axes_image.set_array(get_screen_image()) # 已刷新,設置為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()

更多內容大家可以參考專題《微信跳一跳》進行學習。

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林站長站。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 增城市| 南丰县| 齐河县| 鲁甸县| 塔城市| 中宁县| 东兰县| 阿克陶县| 西华县| 南部县| 中西区| 道孚县| 黎城县| 专栏| 历史| 台南县| 康定县| 图们市| 双流县| 东光县| 壤塘县| 保亭| 澄迈县| 宝清县| 静宁县| 保康县| 邯郸市| 宁化县| 湟源县| 阿坝| 新疆| 南陵县| 松江区| 天津市| 甘谷县| 新河县| 方山县| 安丘市| 南江县| 疏勒县| 盖州市|