import pyautogui
import time
import yaml
stream = open("config.yaml", 'r')
c = yaml.safe_load(stream)
persist = c["counter"]["persist"]
time_persist = c["intervals"]["time_persist"]
delay = c["intervals"]["btn_delay"]
long_delay = c["intervals"]["btn_long_delay"]
interval = c["intervals"]["farm_cicle"]
confidence = c["percents"]["confidence"]
def click(target,confidence=confidence,stopOnFail=True):
_click = pyautogui.locateCenterOnScreen(f'images/{target}.png', confidence=confidence)
print(f"Procurando {target}")
if _click is None:
for i in range(persist):
_click = pyautogui.locateCenterOnScreen(f'images/{target}.png',confidence=confidence)
time.sleep(time_persist)
if _click is not None: break
if i==persist-1 and stopOnFail is True:
print("Target não encontrado. Resetando sistema")
main()
time.sleep(delay)
pyautogui.click(_click)
print(f" Clicou! {_click}")
time.sleep(1)
if pyautogui.locateCenterOnScreen(f'images/{target}.png',confidence=confidence) is not None:
pyautogui.click(_click)
def main():
counter = 0
print("**BOMB BOT STARTED**")
click('aba_bomb')
pyautogui.hotkey("F5")
while True:
print(f"\nIniciando ciclo: {counter}")
time.sleep(long_delay)
click('btn_connect')
click('btn_login')
time.sleep(long_delay)
click('btn_tesouro')
click('btn_seta_cima',confidence=0.65)
click('btn_heroes')
click('btn_all',confidence=confidence,stopOnFail=False)
click('btn_x')
click('btn_key')
print("Farmando...")
time.sleep(interval-60 if interval > 120 else 60)
print("1 minuto para finalizar o processo!")
time.sleep(60)
pyautogui.hotkey("F5")
time.sleep(delay)
counter+=1
if __name__ == '__main__':
main()
top of page
Buscar
Posts recentes
Ver tudobottom of page
Comments