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)
Exemple #2
0
def back():
    Arknights.back()
Exemple #3
0
def to():
    Arknights.bluestacks_tap_rect(*coords[NAME])
    Arknights.wait_for_changes(threshold=1000)
def to():
    Arknights.back()
Exemple #5
0
def go():
    Arknights.bluestacks_tap_rect(*coords[NAME])
    Arknights.wait_for_changes(threshold=0, interval=0.5)
    Arknights.detect_change_jpeg()
Exemple #6
0
def back():
    Arknights.back()
    Arknights.wait_for_changes(threshold=1000)