Exemplo n.º 1
0
def test_jump():
    algorithm = Algorithm()
    op = Operation()
    im = op.screen_cap()
    start_x, start_y, end_x, end_y = algorithm.find_point(im)
    start_point = (start_x, start_y)
    end_point = (end_x, end_y)
    distance = algorithm.euclidean_distance(start_point, end_point)
    press_time = algorithm.distance_to_time(distance)
    op.jump(start_point, end_point, press_time)
Exemplo n.º 2
0
def test_jump():
    algorithm = Algorithm()
    op = Operation()
    im = op.screen_cap()
    start_x, start_y, end_x, end_y = algorithm.find_point(im)
    start_point = (start_x, start_y)
    end_point = (end_x, end_y)
    distance = algorithm.euclidean_distance(start_point, end_point)
    press_time = algorithm.distance_to_time(distance)
    print(press_time)
    #op.jump(start_point, end_point, press_time)
    cmd = "adb shell input swipe %d %d %d %d %d" % (100, 100, 100, 100,
                                                    press_time)
    os.system(cmd)