from Device import Arknights import json import time import cv2 import os port = 22823 a = Arknights(port, launch=False) with open('coords.json') as f: coords = json.load(f) crop = [0, 100, 10, 100] def do_stage(stage): v = True try: a.compare_to('.cache/' + stage + '.jpg', 100, 1, crop=crop, verbose=v, timeout=60) except: a.bluestacks_tap(50, 50, 4) a.compare_to('.cache/' + stage + '.jpg', 100, 1, crop=crop, verbose=v, timeout=60)
def back(): Arknights.back()
def to(): Arknights.bluestacks_tap_rect(*coords[NAME]) Arknights.wait_for_changes(threshold=1000)
def to(): Arknights.back()
def go(): Arknights.bluestacks_tap_rect(*coords[NAME]) Arknights.wait_for_changes(threshold=0, interval=0.5) Arknights.detect_change_jpeg()
def back(): Arknights.back() Arknights.wait_for_changes(threshold=1000)