예제 #1
0
def manual_update_hunt():
    bot.go_to('right')
    set_jalon()
    time.sleep(1)
    pyautogui.click()
    event.wait_for(messages.TreasureHuntMessage)
    bot.go_to('left')
예제 #2
0
def travel(pos):
    global map_pos
    _x, _y, zone = nearest_zaap(pos)
    x, y = pos
    zaap(zone)
    chat.general("/travel {},{}".format(x, y))
    time.sleep(.5)
    pyautogui.press('enter')
    while pos != map_pos:
        event.wait_for(messages.MapComplementaryInformationsDataMessage)
예제 #3
0
def start():
    bot.zaap("champs de cania")
    bot.go_to('right')
    bot.go_to('right')
    bot.click_on_cell(356 - 14)
    event.wait_for(messages.MapComplementaryInformationsDataMessage)
    bot.click_on_cell(292)
    event.wait_for(messages.MapComplementaryInformationsDataMessage)
    bot.click_on_cell(288)
    pyautogui.moveTo(x=10, y=100)
    time.sleep(1)
    bot.click_on_image(SELECT_LEVEL_BUTTON(200))
    event.wait_for(messages.TreasureHuntMessage)
    bot.click_on_cell(503)
    event.wait_for(messages.MapComplementaryInformationsDataMessage)
    bot.click_on_cell(556)
    event.wait_for(messages.MapComplementaryInformationsDataMessage)
    bot.travel(hunt_data['map_pos'])
    pass
예제 #4
0
def start():
    global initial_places
    event.wait_for(messages.GameFightPlacementPossiblePositionsMessage)
    distances = []
    cells = []
    time.sleep(1)
    enemies = get_enemies()
    enemies_coords = [bot.cell_to_coords(x['cell_id']) for x in enemies]
    init_coords = [bot.cell_to_coords(x) for x in initial_places]
    for enemy in enemies_coords:
        for cell in init_coords:
            dist = math.sqrt((cell[0] - enemy[0])**2 + (cell[1] - enemy[1])**2)
            distances.append(dist)
            cells.append(cell)
    nearest = distances.index(min(distances))
    x, y = cells[nearest]
    bot.click_on_pos(x, y)
    bot.click_on_pos(10, 100)
    bot.press('f1')
예제 #5
0
def zaap(zone):
    pyautogui.press('h')
    event.wait_for(messages.MapComplementaryInformationsDataInHavenBagMessage)
    pyautogui.click(x=787, y=285)
    event.wait_for(messages.ZaapDestinationsMessage)
    time.sleep(1)
    pyautogui.click(x=1100, y=238)
    pyautogui.write(zone)
    pyautogui.press('enter')
    event.wait_for(messages.MapComplementaryInformationsDataMessage)
예제 #6
0
def set_jalon():
    coord = pyautogui.locateCenterOnScreen(JALON_IMG,
                                           region=(277, 249, 314, 384),
                                           confidence=0.9)
    pyautogui.click(coord)
    event.wait_for(messages.TreasureHuntMessage)
예제 #7
0
def all_steps():
    global total_steps, total_flags
    if total_steps == total_flags:
        pyautogui.click(ALL_STEPS)
        event.wait_for(messages.TreasureHuntMessage)
예제 #8
0
def set_ready():
    event.wait_for(messages.GameFightHumanReadyStateMessage)
예제 #9
0
def enter_door(x, y):
    click_on_pos(x, y)
    event.wait_for(messages.MapComplementaryInformationsDataMessage)
예제 #10
0
def go_to(direction):
    log.log("Going to {}".format(direction))
    x, y = DIRECTIONS_COORDS[direction]
    pyautogui.click(x=x, y=y)
    event.wait_for(messages.MapComplementaryInformationsDataMessage, 10)