Beispiel #1
0
async def click_arrow_field(menu, field, cmp_list_name, count):
    cmp = menu_utils.find_component_by_field(menu[cmp_list_name], "name",
                                             field)
    for i in range(count):
        await menu_utils.click_component(cmp)
        if i < count - 1:
            await asyncio.sleep(0.1)
Beispiel #2
0
async def click_equipment_icon(page, item):
    cmp = menu_utils.find_component_by_field(page['equipmentIcons'], 'name',
                                             item["name"])
    await menu_utils.focus_component(cmp)
    with server.player_items_stream() as stream:
        player_items = await stream.next()
    if player_items['cursorSlotItem'] and not player_items['equippedItems'][
            item['field']]:
        await menu_utils.click_component(cmp)
    else:
        await menu_utils.focus_component(cmp)
Beispiel #3
0
async def click_farm(menu, farm):
    cmp = menu_utils.find_component_by_field(menu["farmTypeButtons"], "name",
                                             farm)
    await menu_utils.click_component(cmp)
Beispiel #4
0
async def click_main_button(menu, btn_name: str):
    button = menu_utils.find_component_by_field(menu['buttons'], 'name',
                                                btn_name)
    await menu_utils.click_component(button)
Beispiel #5
0
async def click_tab(tab_name):
    menu = await get_game_menu()
    cmp = menu_utils.find_component_by_field(menu["tabs"], 'name', tab_name)
    await menu_utils.click_component(cmp)