Ejemplo n.º 1
0
def nextPage():
    nextBtn = findNext()
    friendsRegion = [nextBtn.left - 640, nextBtn.top - 50, 530, 80]
    before = pyautogui.screenshot(region=friendsRegion)
    pressButton(nextBtn, True)
    randSleepMs()
    after = pyautogui.screenshot(region=friendsRegion)
    return same(before, after)
Ejemplo n.º 2
0
def processSocialPage():
    output = True
    while output is not None:
        output = findAnySocialButton()
        if output is not None:
            logging.info("Precessing social button")
            pressButton(output, True)
            randSleepMs(500, 900)
Ejemplo n.º 3
0
def processGoodsOutput(output):
    with lock:
        pressCollect1(output)
        randSleepMs()
        pressEsc()
        pressCollect2(output)
        randSleepMs()
        logging.debug("Bot has restarted a production building.")
        pressEsc()
Ejemplo n.º 4
0
def processIdleOutput(output):
    with lock:
        pressCollect1(output)
        randSleepMs()
        pyautogui.typewrite(['1', '2', '3', '4', '5'])
        pressCollect2(output)
        randSleepMs()
        pyautogui.typewrite(['1', '2', '3', '4', '5'])
        logging.debug("Bot has restarted a production building.")
        pressEsc()
Ejemplo n.º 5
0
def zoomOut():
    if findLandscape() is not None:
        randSleepSec(60, 120)
        return
    panel = findButtonsPanel()
    if panel is None:
        randSleepSec(5, 10)
        return
    with lock:
        checkIfPaused()
        logging.info("Zooming out")
        pyautogui.moveTo(panel[0], panel[1], duration=randDur())
        pyautogui.moveRel(50, -50, duration=randDur())
        pyautogui.click()
        randSleepMs()
        scroll(-1, 1)
        randSleepMs()
        scroll(-1, 1)
        randSleepMs()
        logging.info("Zoomed out")
    randSleepSec(60, 120)
Ejemplo n.º 6
0
def hide(window):
    if not window.isMinimized:
        window.minimize()
        randSleepMs()
Ejemplo n.º 7
0
def activate(window):
    window.activate()
    randSleepMs()
Ejemplo n.º 8
0
def show(window):
    if not window.isMaximized:
        window.maximize()
        randSleepMs()
    if not window.isActive:
        trySkip(lambda: activate(window))
Ejemplo n.º 9
0
def hideAll():
    pyautogui.hotkey('win', 'd')
    randSleepMs()
    for window in getGameWindows():
        hide(window)