最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

小天才《速算王者》 自動腳本

2023-03-19 11:50 作者:神坑之逗  | 我要投稿



方法寫在了圖片里,下面是文字

文件下載鏈接(新):avolip-hyp.ysepan.com

ADB命令

adb start-server

adb shell am start com.xtc.selftest/.ui.ControllerActivity

python配置(先安裝pip)

pip3 install pillow -i https://pypi.mirrors.ustc.edu.cn/simple?

pip3 install pytesseract -i https://pypi.mirrors.ustc.edu.cn/simple?

pip3 install uiautomator2 -i https://pypi.mirrors.ustc.edu.cn/simple

pip3 install pyautogui –i https://pypi.mirrors.ustc.edu.cn/simple?

uiautomator2 init

代碼:

from PIL import Image

import pytesseract

import uiautomator2 as u2

import PIL.ImageOps

import pyautogui

import os,sys

import time

pytesseract.pytesseract.tesseract_cmd = "D:\\Program Files\\Tesseract-OCR\\tesseract.exe"

#os.system("/usr/local/bin/adb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -P 320x360@320x360/0 -s >" + name)

#os.system('adb shell screencap -p /data/local/tmp/tmp.png')

#os.system('adb pull /data/local/tmp/tmp.png')

d=u2.connect('10d03286')

f=0

ansp=int(input("目標(biāo)分?jǐn)?shù):"))

input("等待第一題,確認(rèn)請回車")

while True:

? ? img = pyautogui.screenshot(region=[0,38,320,360]) # x,y,w,h

? ? #img.save('screenshot.png')

? ? #img = CV2.cvtColor(np.asarray(img),CV2.COLOR_RGB2BGR)

? ? #img = Image.open("screen.png")

? ? Img=img.convert('L')

? ? Img=PIL.ImageOps.invert(Img)

? ? threshold=20

? ? filter_func = lambda x: 0 if x < threshold else 1?

? ? photo = Img.point(filter_func,'1')

? ? box = (0,70,320,250)

? ? #photo.show()

? ? photo = photo.crop(box)

? ? jieguo = pytesseract.image_to_string( photo ,config="--psm 6 stdout -c tessedit_char_whitelist=0123456789-*+=",lang="num").split("=")

? ? if(eval(jieguo[0]) == int(jieguo[1])):

? ? ? ? d(resourceId="com.xtc.arithmeticmaster:id/btn_answer_right").click()

? ? else:

? ? ? ? d(resourceId="com.xtc.arithmeticmaster:id/btn_answer_error").click()

? ? if(f+1 == ansp):

? ? ? ? print("系統(tǒng)提示:分?jǐn)?shù)已達成,自動結(jié)束")

? ? ? ? break

? ? f+=1

? ? time.sleep(0.35)

提示:如果手表比較卡,適當(dāng)增加time.sleep的時間,否則可能因為響應(yīng)遲鈍而失敗。

小天才《速算王者》 自動腳本的評論 (共 條)

分享到微博請遵守國家法律
孟州市| 奉新县| 松滋市| 云阳县| 本溪市| 通榆县| 永川市| 墨江| 平遥县| 平乐县| 寿阳县| 沐川县| 宁乡县| 遂川县| 行唐县| 杭锦旗| 怀来县| 鹿泉市| 岳阳县| 诏安县| 达日县| 台中县| 富锦市| 大悟县| 时尚| 兰溪市| 岗巴县| 禄劝| 娄底市| 中山市| 绵竹市| 溧阳市| 柘城县| 靖安县| 繁峙县| 建阳市| 上栗县| 介休市| 乳源| 含山县| 汾阳市|