Compare commits
5
Commits
2132107c06
...
9b95ecd551
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b95ecd551 | ||
|
|
64f597c7ff | ||
|
|
ace146a8eb | ||
|
|
b9a99f8a37 | ||
|
|
1e8327d49f |
@@ -1,10 +1,11 @@
|
||||
LARGURA_TERMINAL=50
|
||||
INTERVALO_MINIMO_CLIQUE=15
|
||||
INTERVALO_MAXIMO_CLIQUE=30
|
||||
INTERVALO_MINIMO_CLIQUE=10
|
||||
INTERVALO_MAXIMO_CLIQUE=20
|
||||
INTERVALO_PRIMEIRO_CLIQUE=10
|
||||
MAXIMO_CLIQUES_POR_SESSAO=60
|
||||
INTERVALO_ENTRE_SESSOES=3600
|
||||
MAXIMO_FALHAS=3
|
||||
MAXIMO_CLIQUES_POR_SESSAO=20
|
||||
INTERVALO_ENTRE_SESSOES=3300
|
||||
INTERVALO_CLIQUE_ESPERA=900
|
||||
MAXIMO_FALHAS=10
|
||||
HORA_INICIO=09:00
|
||||
HORA_FIM=18:00
|
||||
CONFIANCA=0.9
|
||||
|
||||
Regular → Executable
BIN
Binary file not shown.
@@ -24,6 +24,7 @@ INTERVALO_MAXIMO_CLIQUE = int(os.getenv("INTERVALO_MAXIMO_CLIQUE", "30"))
|
||||
INTERVALO_PRIMEIRO_CLIQUE = int(os.getenv("INTERVALO_PRIMEIRO_CLIQUE", "10"))
|
||||
MAXIMO_CLIQUES_POR_SESSAO = int(os.getenv("MAXIMO_CLIQUES_POR_SESSAO", "20"))
|
||||
INTERVALO_ENTRE_SESSOES = int(os.getenv("INTERVALO_ENTRE_SESSOES", "60"))
|
||||
INTERVALO_CLIQUE_ESPERA = int(os.getenv("INTERVALO_CLIQUE_ESPERA", "900"))
|
||||
MAXIMO_FALHAS = int(os.getenv("MAXIMO_FALHAS", "5"))
|
||||
HORA_INICIO = os.getenv("HORA_INICIO", "09:00")
|
||||
HORA_FIM = os.getenv("HORA_FIM", "18:00")
|
||||
@@ -87,6 +88,7 @@ def painel_config() -> None:
|
||||
(C_CYAN, "Espera antes do 1º clique", f"{INTERVALO_PRIMEIRO_CLIQUE}s"),
|
||||
(C_YELLOW, "Máximo de cliques por sessão", str(MAXIMO_CLIQUES_POR_SESSAO)),
|
||||
(C_YELLOW, "Intervalo entre sessões", f"{INTERVALO_ENTRE_SESSOES}s"),
|
||||
(C_CYAN, "Clique de espera entre sessões", f"{INTERVALO_CLIQUE_ESPERA}s"),
|
||||
(C_MAG, "Máximo de falhas", str(MAXIMO_FALHAS)),
|
||||
(C_WHITE, "Horário de funcionamento", f"{HORA_INICIO} às {HORA_FIM}"),
|
||||
(C_GRAY, "Confiança mínima", str(CONFIANCA)),
|
||||
@@ -258,17 +260,15 @@ def main() -> None:
|
||||
falhas_consecutivas += 1
|
||||
log(
|
||||
f"[Sessão {numero_sessao}] Botão não encontrado. "
|
||||
f"Falhas: {falhas_consecutivas}/{MAXIMO_FALHAS} | Total: {total_cliques}",
|
||||
f"Falhas: {falhas_consecutivas} | Total: {total_cliques}",
|
||||
C_RED,
|
||||
)
|
||||
if falhas_consecutivas >= MAXIMO_FALHAS:
|
||||
print()
|
||||
log(
|
||||
f"⚠ Máximo de falhas ({MAXIMO_FALHAS}) atingido. Encerrando.",
|
||||
C_RED + BOLD,
|
||||
)
|
||||
log(f"Total de cliques realizados: {total_cliques}", C_YELLOW)
|
||||
sys.exit(1)
|
||||
log(
|
||||
f"[Sessão {numero_sessao}] Re-tentando em {INTERVALO_MINIMO_CLIQUE}s...",
|
||||
C_YELLOW,
|
||||
)
|
||||
time.sleep(INTERVALO_MINIMO_CLIQUE)
|
||||
continue
|
||||
|
||||
if cliques_na_sessao >= MAXIMO_CLIQUES_POR_SESSAO:
|
||||
log(
|
||||
@@ -281,7 +281,31 @@ def main() -> None:
|
||||
f"Aguardando {INTERVALO_ENTRE_SESSOES}s até a Sessão {numero_sessao}...",
|
||||
C_YELLOW,
|
||||
)
|
||||
time.sleep(INTERVALO_ENTRE_SESSOES)
|
||||
tempo_restante = INTERVALO_ENTRE_SESSOES
|
||||
while tempo_restante > 0:
|
||||
tempo_ate_clique = min(tempo_restante, INTERVALO_CLIQUE_ESPERA)
|
||||
log(
|
||||
f"[Espera] Dormindo {tempo_ate_clique}s (restam {tempo_restante}s)...",
|
||||
C_GRAY,
|
||||
)
|
||||
time.sleep(tempo_ate_clique)
|
||||
tempo_restante -= tempo_ate_clique
|
||||
if tempo_restante <= 0:
|
||||
break
|
||||
log(
|
||||
f"[Espera] Executando clique de keep-alive (restam {tempo_restante}s)...",
|
||||
C_CYAN,
|
||||
)
|
||||
pos_espera = encontrar_botao(IMAGEM_BOTAO, CONFIANCA)
|
||||
if pos_espera:
|
||||
px, py = pos_espera
|
||||
log(
|
||||
f"[Espera] Clicando em ({px}, {py})...",
|
||||
C_GREEN,
|
||||
)
|
||||
pyautogui.click(px, py)
|
||||
else:
|
||||
log("[Espera] Botão não encontrado no clique de keep-alive.", C_RED)
|
||||
primeiro_clique = True
|
||||
continue
|
||||
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user