Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b95ecd551 | ||
|
|
64f597c7ff | ||
|
|
ace146a8eb | ||
|
|
b9a99f8a37 | ||
|
|
1e8327d49f |
@@ -1,10 +1,11 @@
|
|||||||
LARGURA_TERMINAL=50
|
LARGURA_TERMINAL=50
|
||||||
INTERVALO_MINIMO_CLIQUE=15
|
INTERVALO_MINIMO_CLIQUE=10
|
||||||
INTERVALO_MAXIMO_CLIQUE=30
|
INTERVALO_MAXIMO_CLIQUE=20
|
||||||
INTERVALO_PRIMEIRO_CLIQUE=10
|
INTERVALO_PRIMEIRO_CLIQUE=10
|
||||||
MAXIMO_CLIQUES_POR_SESSAO=60
|
MAXIMO_CLIQUES_POR_SESSAO=20
|
||||||
INTERVALO_ENTRE_SESSOES=3600
|
INTERVALO_ENTRE_SESSOES=3300
|
||||||
MAXIMO_FALHAS=3
|
INTERVALO_CLIQUE_ESPERA=900
|
||||||
|
MAXIMO_FALHAS=10
|
||||||
HORA_INICIO=09:00
|
HORA_INICIO=09:00
|
||||||
HORA_FIM=18:00
|
HORA_FIM=18:00
|
||||||
CONFIANCA=0.9
|
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"))
|
INTERVALO_PRIMEIRO_CLIQUE = int(os.getenv("INTERVALO_PRIMEIRO_CLIQUE", "10"))
|
||||||
MAXIMO_CLIQUES_POR_SESSAO = int(os.getenv("MAXIMO_CLIQUES_POR_SESSAO", "20"))
|
MAXIMO_CLIQUES_POR_SESSAO = int(os.getenv("MAXIMO_CLIQUES_POR_SESSAO", "20"))
|
||||||
INTERVALO_ENTRE_SESSOES = int(os.getenv("INTERVALO_ENTRE_SESSOES", "60"))
|
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"))
|
MAXIMO_FALHAS = int(os.getenv("MAXIMO_FALHAS", "5"))
|
||||||
HORA_INICIO = os.getenv("HORA_INICIO", "09:00")
|
HORA_INICIO = os.getenv("HORA_INICIO", "09:00")
|
||||||
HORA_FIM = os.getenv("HORA_FIM", "18: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_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, "Máximo de cliques por sessão", str(MAXIMO_CLIQUES_POR_SESSAO)),
|
||||||
(C_YELLOW, "Intervalo entre sessões", f"{INTERVALO_ENTRE_SESSOES}s"),
|
(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_MAG, "Máximo de falhas", str(MAXIMO_FALHAS)),
|
||||||
(C_WHITE, "Horário de funcionamento", f"{HORA_INICIO} às {HORA_FIM}"),
|
(C_WHITE, "Horário de funcionamento", f"{HORA_INICIO} às {HORA_FIM}"),
|
||||||
(C_GRAY, "Confiança mínima", str(CONFIANCA)),
|
(C_GRAY, "Confiança mínima", str(CONFIANCA)),
|
||||||
@@ -258,17 +260,15 @@ def main() -> None:
|
|||||||
falhas_consecutivas += 1
|
falhas_consecutivas += 1
|
||||||
log(
|
log(
|
||||||
f"[Sessão {numero_sessao}] Botão não encontrado. "
|
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,
|
C_RED,
|
||||||
)
|
)
|
||||||
if falhas_consecutivas >= MAXIMO_FALHAS:
|
log(
|
||||||
print()
|
f"[Sessão {numero_sessao}] Re-tentando em {INTERVALO_MINIMO_CLIQUE}s...",
|
||||||
log(
|
C_YELLOW,
|
||||||
f"⚠ Máximo de falhas ({MAXIMO_FALHAS}) atingido. Encerrando.",
|
)
|
||||||
C_RED + BOLD,
|
time.sleep(INTERVALO_MINIMO_CLIQUE)
|
||||||
)
|
continue
|
||||||
log(f"Total de cliques realizados: {total_cliques}", C_YELLOW)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if cliques_na_sessao >= MAXIMO_CLIQUES_POR_SESSAO:
|
if cliques_na_sessao >= MAXIMO_CLIQUES_POR_SESSAO:
|
||||||
log(
|
log(
|
||||||
@@ -281,7 +281,31 @@ def main() -> None:
|
|||||||
f"Aguardando {INTERVALO_ENTRE_SESSOES}s até a Sessão {numero_sessao}...",
|
f"Aguardando {INTERVALO_ENTRE_SESSOES}s até a Sessão {numero_sessao}...",
|
||||||
C_YELLOW,
|
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
|
primeiro_clique = True
|
||||||
continue
|
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