Add complete Flask web application with Telegram bot integration, multiple AI provider support (llama.cpp, OpenRouter, z.ai, StepFun), extensive order banks for BDSM-themed gameplay, automated cron scheduling, and responsive web UI with inference parameter controls.
4133 lines
183 KiB
HTML
Executable File
4133 lines
183 KiB
HTML
Executable File
<!DOCTYPE html>
|
||
<html lang="pt-BR">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||
<meta http-equiv="Pragma" content="no-cache">
|
||
<meta http-equiv="Expires" content="0">
|
||
<title>Sistema do Mestre - Ordens Supremas</title>
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
body {
|
||
font-family: 'Segoe UI', 'Arial', sans-serif;
|
||
background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
|
||
min-height: 100vh;
|
||
display: flex;
|
||
justify-content: center;
|
||
padding: 20px;
|
||
color: #fff;
|
||
}
|
||
|
||
.container {
|
||
max-width: 960px;
|
||
width: 100%;
|
||
padding: 20px 25px;
|
||
background: rgba(255, 255, 255, 0.04);
|
||
border-radius: 16px;
|
||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
||
backdrop-filter: blur(10px);
|
||
align-self: flex-start;
|
||
}
|
||
|
||
h1 {
|
||
text-align: center;
|
||
margin-bottom: 20px;
|
||
font-size: 1.6em;
|
||
color: #ff6b6b;
|
||
text-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
|
||
letter-spacing: 1px;
|
||
}
|
||
|
||
.order-container {
|
||
background: rgba(0, 0, 0, 0.35);
|
||
padding: 18px 20px;
|
||
border-radius: 12px;
|
||
margin-bottom: 18px;
|
||
min-height: 100px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
}
|
||
|
||
.order-text {
|
||
font-size: 1.1em;
|
||
line-height: 1.5;
|
||
text-align: center;
|
||
margin-bottom: 12px;
|
||
color: #e0e0e0;
|
||
white-space: pre-wrap;
|
||
}
|
||
|
||
.timestamp {
|
||
text-align: center;
|
||
color: #888;
|
||
font-size: 0.8em;
|
||
}
|
||
|
||
.btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 4px;
|
||
padding: 6px 10px;
|
||
font-size: 0.7em;
|
||
font-weight: 600;
|
||
color: #fff;
|
||
background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
|
||
border: none;
|
||
border-radius: 6px;
|
||
cursor: pointer;
|
||
transition: all 0.2s ease;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.3px;
|
||
white-space: nowrap;
|
||
width: 100%;
|
||
}
|
||
|
||
.btn:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 6px 20px rgba(238, 82, 83, 0.35);
|
||
}
|
||
|
||
.btn:active {
|
||
transform: translateY(0);
|
||
}
|
||
|
||
.btn-secondary {
|
||
background: linear-gradient(135deg, #555 0%, #333 100%);
|
||
}
|
||
|
||
.btn:disabled {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
transform: none !important;
|
||
}
|
||
|
||
.loading {
|
||
display: none;
|
||
text-align: center;
|
||
margin-top: 14px;
|
||
color: #888;
|
||
font-size: 0.9em;
|
||
}
|
||
|
||
.hidden {
|
||
display: none !important;
|
||
}
|
||
|
||
/* Session controls row */
|
||
.session-controls {
|
||
display: flex;
|
||
gap: 10px;
|
||
margin-bottom: 18px;
|
||
}
|
||
.session-controls .btn {
|
||
padding: 8px 14px;
|
||
font-size: 0.75em;
|
||
}
|
||
|
||
/* Section category */
|
||
.category {
|
||
margin-bottom: 14px;
|
||
}
|
||
.category-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 6px 10px;
|
||
margin-bottom: 8px;
|
||
font-size: 0.75em;
|
||
font-weight: 700;
|
||
text-transform: uppercase;
|
||
letter-spacing: 1.5px;
|
||
color: rgba(255,255,255,0.5);
|
||
border-bottom: 1px solid rgba(255,255,255,0.08);
|
||
cursor: pointer;
|
||
user-select: none;
|
||
}
|
||
.category-header .arrow {
|
||
font-size: 0.7em;
|
||
transition: transform 0.2s ease;
|
||
}
|
||
.category-header .arrow.collapsed {
|
||
transform: rotate(-90deg);
|
||
}
|
||
.category-body {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||
gap: 8px;
|
||
}
|
||
.category-body.collapsed {
|
||
display: none;
|
||
}
|
||
|
||
/* Divider */
|
||
.divider {
|
||
border: none;
|
||
border-top: 1px solid rgba(255,255,255,0.08);
|
||
margin: 16px 0;
|
||
}
|
||
|
||
/* Responsive */
|
||
@media (max-width: 600px) {
|
||
.container { padding: 14px 12px; }
|
||
h1 { font-size: 1.2em; }
|
||
.category-body { grid-template-columns: 1fr 1fr; }
|
||
.btn { font-size: 0.72em; padding: 7px 10px; }
|
||
.session-controls { flex-direction: column; }
|
||
}
|
||
@media (max-width: 400px) {
|
||
.category-body { grid-template-columns: 1fr; }
|
||
}
|
||
|
||
/* Color variants – reused via class */
|
||
.btn-yellow { background: linear-gradient(135deg, #feca57, #ff9f43); }
|
||
.btn-pink { background: linear-gradient(135deg, #ff9ff3, #f368e0); }
|
||
.btn-purple { background: linear-gradient(135deg, #e056fd, #be2edd); }
|
||
.btn-blue { background: linear-gradient(135deg, #54a0ff, #2e86de); }
|
||
.btn-green { background: linear-gradient(135deg, #00b894, #00a381); }
|
||
.btn-lilac { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
|
||
.btn-rose { background: linear-gradient(135deg, #fd79a8, #e84393); }
|
||
.btn-orange { background: linear-gradient(135deg, #fdcb6e, #e17055); }
|
||
.btn-silver { background: linear-gradient(135deg, #dfe6e9, #b2bec3); color: #2d3436; }
|
||
.btn-cyan { background: linear-gradient(135deg, #81ecec, #00cec9); }
|
||
.btn-red { background: linear-gradient(135deg, #e84393, #c0392b); }
|
||
.btn-dark { background: linear-gradient(135deg, #2d3436, #636e72); }
|
||
.btn-blood { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
|
||
.btn-navy { background: linear-gradient(135deg, #2c3e50, #4a69bd); }
|
||
.btn-deepnavy{ background: linear-gradient(135deg, #1e3799, #0c2461); }
|
||
.btn-maroon { background: linear-gradient(135deg, #c0392b, #8e44ad); }
|
||
.btn-violet { background: linear-gradient(135deg, #8e44ad, #9b59b6); }
|
||
.btn-amber { background: linear-gradient(135deg, #e67e22, #d35400); }
|
||
.btn-indigo { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
|
||
.btn-crimson { background: linear-gradient(135deg, #e74c3c, #c0392b); }
|
||
|
||
/* Link-as-button */
|
||
.btn-link {
|
||
text-decoration: none;
|
||
display: flex;
|
||
}
|
||
|
||
/* IA (llama.cpp) panel */
|
||
.ia-panel {
|
||
background: rgba(0, 0, 0, 0.35);
|
||
border-radius: 12px;
|
||
padding: 14px;
|
||
margin-bottom: 18px;
|
||
border: 1px solid rgba(84, 160, 255, 0.25);
|
||
}
|
||
.ia-status {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
font-size: 0.75em;
|
||
margin-bottom: 10px;
|
||
color: #888;
|
||
}
|
||
.ia-status .dot {
|
||
width: 9px;
|
||
height: 9px;
|
||
border-radius: 50%;
|
||
background: #555;
|
||
display: inline-block;
|
||
}
|
||
.ia-status.online .dot {
|
||
background: #2ed573;
|
||
box-shadow: 0 0 8px #2ed573;
|
||
}
|
||
.ia-status.offline .dot {
|
||
background: #ff4757;
|
||
}
|
||
.ia-chat {
|
||
max-height: 420px;
|
||
overflow-y: auto;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 8px;
|
||
margin-bottom: 10px;
|
||
padding: 4px;
|
||
}
|
||
.ia-msg {
|
||
padding: 8px 12px;
|
||
border-radius: 10px;
|
||
font-size: 0.9em;
|
||
line-height: 1.4;
|
||
white-space: pre-wrap;
|
||
word-wrap: break-word;
|
||
max-width: 85%;
|
||
}
|
||
.ia-msg.user {
|
||
align-self: flex-end;
|
||
background: linear-gradient(135deg, #54a0ff, #2e86de);
|
||
}
|
||
.ia-msg.assistant {
|
||
align-self: flex-start;
|
||
background: rgba(255, 255, 255, 0.08);
|
||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||
}
|
||
.ia-input-row {
|
||
display: flex;
|
||
gap: 8px;
|
||
}
|
||
.ia-input-row input {
|
||
flex: 1;
|
||
padding: 10px 12px;
|
||
border-radius: 8px;
|
||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||
background: rgba(0, 0, 0, 0.4);
|
||
color: #fff;
|
||
font-size: 0.9em;
|
||
outline: none;
|
||
}
|
||
.ia-input-row input:focus {
|
||
border-color: #54a0ff;
|
||
}
|
||
.ia-input-row button {
|
||
padding: 10px 16px;
|
||
}
|
||
.btn-ia {
|
||
background: linear-gradient(135deg, #00b894, #00cec9);
|
||
}
|
||
.btn-ia.active {
|
||
background: linear-gradient(135deg, #e17055, #d63031);
|
||
}
|
||
.btn-ia.active-auto {
|
||
background: linear-gradient(135deg, #e17055, #d63031);
|
||
animation: pulse-auto 2s infinite;
|
||
}
|
||
@keyframes pulse-auto {
|
||
0% { box-shadow: 0 0 5px rgba(225, 112, 85, 0.4); }
|
||
50% { box-shadow: 0 0 20px rgba(225, 112, 85, 0.8); }
|
||
100% { box-shadow: 0 0 5px rgba(225, 112, 85, 0.4); }
|
||
}
|
||
|
||
/* IA Config Panel */
|
||
.ia-config-panel {
|
||
background: rgba(0, 0, 0, 0.45);
|
||
border-radius: 10px;
|
||
padding: 12px;
|
||
margin-top: 10px;
|
||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||
font-size: 0.85em;
|
||
}
|
||
.ia-config-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 8px;
|
||
gap: 10px;
|
||
}
|
||
.ia-config-row label {
|
||
color: #ccc;
|
||
flex: 1;
|
||
}
|
||
.ia-config-row input {
|
||
width: 70px;
|
||
background: rgba(255, 255, 255, 0.05);
|
||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||
color: #fff;
|
||
padding: 3px 6px;
|
||
border-radius: 4px;
|
||
text-align: center;
|
||
}
|
||
.ia-config-row input[type="range"] {
|
||
flex: 2;
|
||
width: auto;
|
||
}
|
||
.ia-config-panel select {
|
||
background: rgba(255, 255, 255, 0.05);
|
||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||
color: #fff;
|
||
padding: 4px 6px;
|
||
border-radius: 4px;
|
||
flex: 2;
|
||
outline: none;
|
||
}
|
||
.ia-config-panel select option {
|
||
background: #1a1a2e;
|
||
color: #fff;
|
||
}
|
||
/* Wider inputs for the OpenRouter API key / model fields. */
|
||
.ia-config-row input.cfg-wide {
|
||
flex: 2;
|
||
width: auto;
|
||
text-align: left;
|
||
}
|
||
.ia-config-hint {
|
||
font-size: 0.78em;
|
||
color: #888;
|
||
margin: 4px 0 8px;
|
||
line-height: 1.3;
|
||
}
|
||
.ia-config-subhead {
|
||
margin: 10px 0 8px;
|
||
font-weight: bold;
|
||
color: #54a0ff;
|
||
border-bottom: 1px solid rgba(84, 160, 255, 0.2);
|
||
padding-bottom: 4px;
|
||
}
|
||
.key-status-ok { color: #2ed573; font-size: 0.8em; }
|
||
.key-status-no { color: #ff4757; font-size: 0.8em; }
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<h1>🔥 Sistema do Mestre 🔥</h1>
|
||
|
||
<div class="order-container">
|
||
<div class="order-text" id="order-text">Clique em "Iniciar Sessão" para começar...</div>
|
||
<div class="timestamp" id="timestamp"></div>
|
||
</div>
|
||
|
||
<div id="sessionStart" class="hidden"></div>
|
||
|
||
<div id="sessionActive">
|
||
<div class="session-controls">
|
||
<button class="btn" onclick="proximaOrdem()" style="flex:2;">▶ PRÓXIMA ORDEM</button>
|
||
<button class="btn btn-secondary" onclick="encerrarSessao()" id="btn-encerrar" style="flex:1;">⏹ ENCERRAR</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- IA (llama.cpp) -->
|
||
<div class="ia-panel hidden" id="iaPanel">
|
||
<div class="ia-status" id="iaStatus">
|
||
<span class="dot"></span>
|
||
<span id="iaStatusText">Verificando conexão com o modelo...</span>
|
||
</div>
|
||
<div class="ia-chat" id="iaChat"></div>
|
||
<div class="ia-input-row">
|
||
<input type="text" id="iaInput" placeholder="Escreva para o Mestre..." autocomplete="off">
|
||
<button class="btn btn-ia" id="iaSendBtn" onclick="enviarMensagemIA()">Enviar</button>
|
||
<button class="btn btn-secondary" onclick="limparChatIA()" title="Limpar conversa">🧹</button>
|
||
</div>
|
||
<div class="ia-config-panel">
|
||
<div class="ia-config-subhead">⚙️ Provedor de IA</div>
|
||
<div class="ia-config-row">
|
||
<label title="Qual motor de IA usar">Provedor:</label>
|
||
<select id="cfg-provedor" onchange="toggleProvedorCampos()">
|
||
<option value="llamacpp">llama.cpp (local)</option>
|
||
<option value="openrouter">OpenRouter (nuvem)</option>
|
||
<option value="zai">z.ai (nuvem)</option>
|
||
<option value="stepfun">StepFun (nuvem)</option>
|
||
</select>
|
||
</div>
|
||
<div id="llamacppCampos" class="hidden">
|
||
<div class="ia-config-row">
|
||
<label title="URL do servidor llama.cpp local">URL do servidor:</label>
|
||
<input type="text" id="cfg-llamacpp-url" class="cfg-wide" placeholder="http://localhost:8080" autocomplete="off">
|
||
</div>
|
||
<div class="ia-config-hint">
|
||
Inicie com: llama-server -m modelo.gguf --port 8080
|
||
</div>
|
||
</div>
|
||
<div id="openrouterCampos" class="hidden">
|
||
<div class="ia-config-row">
|
||
<label title="Chave de API do OpenRouter">API Key:</label>
|
||
<input type="password" id="cfg-openrouter-key" class="cfg-wide" placeholder="sk-or-..." autocomplete="off">
|
||
<span id="cfg-openrouter-key-status"></span>
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="Identificador do modelo no OpenRouter">Modelo:</label>
|
||
<input type="text" id="cfg-openrouter-model" class="cfg-wide" placeholder="meta-llama/llama-3.1-8b-instruct" autocomplete="off">
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="URL base da API do OpenRouter">URL base:</label>
|
||
<input type="text" id="cfg-openrouter-url" class="cfg-wide" placeholder="https://openrouter.ai/api/v1" autocomplete="off">
|
||
</div>
|
||
<div class="ia-config-hint">
|
||
Crie sua chave em openrouter.ai/keys.<br>
|
||
Modelos em openrouter.ai/models (ex.: google/gemini-2.0-flash-exp:free).
|
||
</div>
|
||
</div>
|
||
<div id="zaiCampos" class="hidden">
|
||
<div class="ia-config-row">
|
||
<label title="Chave de API do z.ai">API Key:</label>
|
||
<input type="password" id="cfg-zai-key" class="cfg-wide" placeholder="sua-chave-zai" autocomplete="off">
|
||
<span id="cfg-zai-key-status"></span>
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="Identificador do modelo no z.ai">Modelo:</label>
|
||
<input type="text" id="cfg-zai-model" class="cfg-wide" placeholder="glm-4.6" autocomplete="off" list="zai-modelos-lista">
|
||
<datalist id="zai-modelos-lista">
|
||
<option value="glm-5">
|
||
<option value="glm-4.6">
|
||
<option value="glm-4.5">
|
||
<option value="glm-4-plus">
|
||
</datalist>
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="URL base da API do z.ai">URL base:</label>
|
||
<input type="text" id="cfg-zai-url" class="cfg-wide" placeholder="https://api.z.ai/api/paas/v4" autocomplete="off">
|
||
</div>
|
||
<div class="ia-config-hint">
|
||
Crie sua chave em z.ai/manage-apikey/apikey-list.<br>
|
||
Modelos: glm-5, glm-4.6, glm-4.5, glm-4-plus (ou digite outro).
|
||
</div>
|
||
</div>
|
||
<div id="stepfunCampos" class="hidden">
|
||
<div class="ia-config-row">
|
||
<label title="Chave de API da StepFun">API Key:</label>
|
||
<input type="password" id="cfg-stepfun-key" class="cfg-wide" placeholder="sk-..." autocomplete="off">
|
||
<span id="cfg-stepfun-key-status"></span>
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="Identificador do modelo na StepFun">Modelo:</label>
|
||
<input type="text" id="cfg-stepfun-model" class="cfg-wide" placeholder="step-3.7-flash" autocomplete="off">
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="URL base da API da StepFun">URL base:</label>
|
||
<input type="text" id="cfg-stepfun-url" class="cfg-wide" placeholder="https://api.stepfun.ai/step_plan/v1" autocomplete="off">
|
||
</div>
|
||
<div class="ia-config-hint">
|
||
Crie sua chave em platform.stepfun.com.<br>
|
||
Modelo sugerido: step-3.7-flash.
|
||
</div>
|
||
</div>
|
||
<div class="ia-config-subhead">⚙️ Parâmetros de Inferência</div>
|
||
<div class="ia-config-row">
|
||
<label title="Criatividade (0.1 a 2.0)">Temperatura:</label>
|
||
<input type="range" id="cfg-temp" min="0.1" max="2.0" step="0.05" value="0.7" oninput="updateCfgVal('temp')">
|
||
<input type="number" id="cfg-temp-val" value="0.7" step="0.05" style="width: 50px;" onchange="syncCfgRange('temp')">
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="Tamanho máximo da resposta">Max Tokens:</label>
|
||
<input type="range" id="cfg-tokens" min="64" max="4096" step="64" value="1024" oninput="updateCfgVal('tokens')">
|
||
<input type="number" id="cfg-tokens-val" value="1024" style="width: 60px;" onchange="syncCfgRange('tokens')">
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="Top-P (Nucleus sampling)">Top-P:</label>
|
||
<input type="range" id="cfg-topp" min="0.1" max="1.0" step="0.05" value="0.9" oninput="updateCfgVal('topp')">
|
||
<input type="number" id="cfg-topp-val" value="0.9" step="0.05" style="width: 50px;" onchange="syncCfgRange('topp')">
|
||
</div>
|
||
<div class="ia-config-row">
|
||
<label title="Penalidade de repetição">Rep. Penalty:</label>
|
||
<input type="range" id="cfg-penalty" min="1.0" max="1.5" step="0.05" value="1.1" oninput="updateCfgVal('penalty')">
|
||
<input type="number" id="cfg-penalty-val" value="1.1" step="0.05" style="width: 50px;" onchange="syncCfgRange('penalty')">
|
||
</div>
|
||
<button class="btn btn-blue" onclick="salvarConfigIA()" style="margin-top: 5px; font-size: 0.65em; padding: 4px;">Aplicar Parâmetros</button>
|
||
</div>
|
||
</div>
|
||
|
||
<hr class="divider">
|
||
|
||
<!-- IA (llama.cpp) -->
|
||
<div class="category">
|
||
<div class="category-header" onclick="toggleCategory(this)">
|
||
<span class="arrow">▼</span> 🤖 IA (MODELO)
|
||
</div>
|
||
<div class="category-body">
|
||
<button class="btn btn-ia" id="btnToggleIA" onclick="toggleIA()">🤖 ATIVAR IA</button>
|
||
<button class="btn btn-blue" onclick="iaOrdem()">🎲 ORDEM DA IA</button>
|
||
<button class="btn btn-cyan" onclick="iaOrdemSentadoTrabalhando()">💻 SENTADO TRABALHANDO</button>
|
||
<button class="btn btn-ia" id="btnConversar" onclick="conversarIA()" title="Abre um bate-papo onde a IA conversa com você (namorada, mestre, amigo...) e instiga a conversa sem parar">💬 CONVERSAR</button>
|
||
<button class="btn btn-lilac" id="btnConversarCenario" onclick="conversarCenarioIA()" title="Sorteia um Cenário Completo e inicia um chat com a IA usando o cenário como contexto">🎪 CONVERSAR NO CENÁRIO</button>
|
||
<button class="btn btn-ia" id="btnRevisaoCron" onclick="toggleRevisaoCron()" title="Quando ativado, a IA analisa e reescreve cada ordem agendada pelo Cron antes de enviar ao Telegram">🧠 IA REVISA O CRON</button>
|
||
<button class="btn btn-ia" id="btnAutoChat" onclick="toggleAutoChat()" title="A cada 5 minutos a IA envia automaticamente uma conversa/ordem pelo chat do sistema, mesmo sem sua interação">⏱️ IA AUTO (5min)</button>
|
||
<button class="btn btn-ia" id="btnOrdensAmigos" onclick="toggleOrdensAmigos()" title="A cada 5 minutos a IA gera uma ordem e envia automaticamente para dois amigos no Telegram (AMIGO1 + AMIGO2 do .env)">📲 ORDENS P/ 2 AMIGOS (5min)</button>
|
||
<button class="btn btn-ia" id="btnOrdens3Amigos" onclick="toggleOrdens3Amigos()" title="A cada 5 minutos a IA gera uma ordem e envia automaticamente para três amigos no Telegram (AMIGO1 + AMIGO2 + AMIGO3 do .env)">📲 ORDENS P/ 3 AMIGOS (5min)</button>
|
||
<button class="btn btn-ia" id="btnOrdensIA3" onclick="toggleOrdensIA3()" title="Cancela todos os Cron Jobs e a cada 10 minutos a IA gera 1 ordem focada em pau, bunda, cú, plug, edging, ruined — puxar o pau pra trás, sentado no PC mostrando o cuzinho, enfiar dedo(s), fazer xixi com dedo enfiado — sem gozar, sem chão, sem cama — e envia para o Telegram">🤖 ORDENS DA IA 3 (10min)</button>
|
||
<button class="btn btn-ia" onclick="iaOrdem4()" title="A IA cria UMA ordem EXTREMA de exposição/humilhação. Nu, em casa ou na rua, risco de ser visto, sem pudor. Linguagem vulgar e explícita">🔥 ORDEM EXTREMA (IA 4)</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Ações Especiais / Curinga -->
|
||
<div class="category">
|
||
<div class="category-header" onclick="toggleCategory(this)">
|
||
<span class="arrow">▼</span> ⚡ Ações Especiais
|
||
</div>
|
||
<div class="category-body">
|
||
<button class="btn btn-yellow" onclick="ordemAleatoria()">🎲 ALEATÓRIO DO MESTRE</button>
|
||
<button class="btn btn-green" onclick="ordemMegaAleatorio()">🎲 MEGA ALEATÓRIO</button>
|
||
<button class="btn btn-lilac" onclick="ordemCenarioCompleto()">🎪 CENÁRIO COMPLETO</button>
|
||
<button class="btn btn-cyan" onclick="iaOrdemCenarioCompleto()">🤖 CENÁRIO COMPLETO (IA)</button>
|
||
<button class="btn btn-purple" onclick="ordemMasturbacaoGozo()">💦 MAST. E GOZO INDIV.</button>
|
||
<button class="btn btn-pink" onclick="ordemTomandoGozoIndividual()">🥛 TOMANDO GOZO INDIV.</button>
|
||
<button class="btn btn-blue" onclick="ordemFacaSemGozar()">🚫 FAÇA SEM GOZAR</button>
|
||
<button class="btn btn-navy" onclick="ordemPlug()">🔌 ORDENS DE PLUG</button>
|
||
<button class="btn btn-cyan" onclick="ordemEdging()">🎯 EDGING</button>
|
||
<button class="btn btn-blood" onclick="ordemRuinedOrgasm()">💋 RUINED ORGASM</button>
|
||
<button class="btn btn-pink" onclick="ordemGozarImaginacao()">💦 GOZAR COM IMAGINAÇÃO</button>
|
||
<button class="btn btn-amber" onclick="ordemAleatorio2()">🎲 ALEATÓRIO 2</button>
|
||
<button class="btn btn-orange" onclick="ordemDesafioRapido()">⚡ DESAFIO RÁPIDO</button>
|
||
<button class="btn btn-purple" onclick="ordemJogoVerdade()">🎭 JOGO DA VERDADE</button>
|
||
<button class="btn btn-blue" onclick="ordemTesteObediencia()">🧪 TESTE DE OBEDIÊNCIA</button>
|
||
<button class="btn btn-crimson" onclick="ordemRoletaCastigo()">🎰 ROLETA DO CASTIGO</button>
|
||
<button class="btn btn-indigo" onclick="ordemMissaoSecreta()">🕵️ MISSÃO SECRETA</button>
|
||
<button class="btn btn-cyan" onclick="ordemDesafioTempo()">⏱️ DESAFIO DO TEMPO</button>
|
||
<button class="btn btn-amber" onclick="ordemPlugFixoMedio()">🔌 PLUG FIXO MÉDIO</button>
|
||
<button class="btn btn-cyan" onclick="iaOrdemPlugFixoMedio()">🤖 PLUG FIXO MÉDIO (IA)</button>
|
||
<button class="btn btn-silver" onclick="ordemApenasPelado()">👤 APENAS PELADO</button>
|
||
<button class="btn btn-red" onclick="ordemPicante()">🔥 ORDENS PICANTES</button>
|
||
<button class="btn btn-violet" onclick="ordemPlugProstata()">⚡ PLUG DE PRÓSTATA</button>
|
||
<button class="btn btn-blood" onclick="ordemPlugSuperGrosso()">🔴 PLUG SUPER GROSSO (4.5cm)</button>
|
||
<button class="btn btn-orange" onclick="ordemMasturbadorOvo()">🥚 MASTURBADOR OVO</button>
|
||
<button class="btn btn-navy" onclick="ordemPlugParede()">🔥 PLUG NA PAREDE</button>
|
||
<button class="btn btn-blood" onclick="ordemPlugSuperGrossoFestinha()">🎉 PLUG FESTINHA</button>
|
||
<button class="btn btn-pink" onclick="ordemEsposaAmigasAmigos()">🎪 ESPOSA, AMIGAS & AMIGOS</button>
|
||
<button class="btn btn-blood" onclick="ordemGozoControlado()">🎯 GOZO CONTROLADO</button>
|
||
<button class="btn btn-maroon" onclick="ordemCastigo()">🌙 CASTIGO & DISCIPLINA</button>
|
||
<button class="btn btn-crimson" onclick="ordemFantasias()">🎭 FANTASIAS & ROLEPLAY</button>
|
||
<button class="btn btn-cyan" onclick="ordemSensorial()">🌡️ BRINCADEIRAS SENSORIAIS</button>
|
||
<button class="btn btn-green" onclick="ordemAlongamentoGinastica()">🤸 ALONGAMENTO & GINÁSTICA</button>
|
||
<button class="btn btn-cyan" onclick="ordemConsulta()">🩺 FANTASIA DA CONSULTA</button>
|
||
<button class="btn btn-blood" onclick="ordemConsultaExposicao()">🩺 CONSULTA & EXPOSIÇÃO</button>
|
||
<button class="btn btn-rose" onclick="ordemEsposaVisita()">💕 MINHA ESPOSA RECEBE VISITA</button>
|
||
<button class="btn btn-orange" onclick="ordemSentadoCadeira()">🪑 SENTADO NA CADEIRA</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Papéis / Posições -->
|
||
<div class="category">
|
||
<div class="category-header" onclick="toggleCategory(this)">
|
||
<span class="arrow">▼</span> 🎭 Papéis & Posições
|
||
</div>
|
||
<div class="category-body">
|
||
<button class="btn btn-lilac" onclick="ordemSendoPassivo()">🔮 SENDO PASSIVO</button>
|
||
<button class="btn btn-rose" onclick="ordemSendoAtivo()">⚔️ SENDO ATIVO</button>
|
||
<button class="btn btn-orange" onclick="ordemCasalHomemMulher()">👫 CASAL HOMEM & MULHER</button>
|
||
<button class="btn btn-green" onclick="ordemTrioBi()">3️⃣ TRIO BI</button>
|
||
<button class="btn btn-amber" id="btnDuplaAtivoPassivoGold" onclick="toggleDuplaAtivoPassivoGold()" title="A cada 5 minutos o Mestre envia 1 nova ordem para o Telegram comandando o Ativo e o Passivo">👑 DUPLA ATV/PAS GOLD (5min)</button>
|
||
<button class="btn btn-rose" id="btnMulherAtiva" onclick="toggleMulherAtiva()" title="A cada 5 minutos o Mestre envia 1 nova ordem para o Telegram comandando a Mulher Ativa e o passivo">💋 MULHER ATIVA (5min)</button>
|
||
<button class="btn btn-indigo" id="btnSozinhoCama" onclick="toggleSozinhoCama()" title="Cancela todos os Cron Jobs e envia 1 ordem a cada 5 minutos para o Telegram para voce executar sozinho, pelado, deitado na cama">🛏️ DEITADO NA CAMA (5min)</button>
|
||
<button class="btn btn-green" id="btnAlongamentoRelaxamento" onclick="toggleAlongamentoRelaxamento()" title="Cancela todos os Cron Jobs e a cada 55 minutos o Mestre envia 1 ordem picante de alongamento/relaxamento para o Telegram, para voce dar uma pausa na programacao e cuidar do corpo">🧘 ALONGAMENTO (55min)</button>
|
||
<button class="btn btn-orange" id="btnSentadoCadeiraCron" onclick="toggleSentadoCadeiraCron()" title="Cancela todos os Cron Jobs e a cada 15 minutos o Mestre envia 1 ordem para voce executar sentado na cadeira, trabalhando">🪑 CRON SENTADO (15min)</button>
|
||
<button class="btn btn-amber" id="btnPlugFixoMedio" onclick="togglePlugFixoMedio()" title="Cancela todos os Cron Jobs e a cada 5 minutos o Mestre envia 1 nova ordem para voce usar o plug fixo medio — enfiou, nao sai">🔌 PLUG FIXO MÉDIO (5min)</button>
|
||
<button class="btn btn-orange" id="btnPiruSemGozar" onclick="togglePiruSemGozar()" title="A cada 5 minutos o Mestre envia 1 nova ordem de estímulo peniano SEM GOZAR para o Telegram">🍆 PIRU SEM GOZAR (5min)</button>
|
||
<button class="btn btn-dark" id="btnPiru" onclick="togglePiru()" title="Cancela todos os Cron Jobs e a cada 5 minutos o Mestre envia 1 ordem picante para trabalhar o pau — punheta, ovo elástico, alisar a cabeça, gozar, edging, piscar o cú">🍆 PIRU (5min)</button>
|
||
<button class="btn btn-crimson" id="btnPiruContinuo" onclick="togglePiruContinuo()" title="Cancela todos os Cron Jobs e a cada 2 minutos o Mestre envia 1 ordem picante para trabalhar o pau intensamente — 30 minutos de fogo contino, depois pausa automática">🔥 PIRU CONTÍNUO (2min)</button>
|
||
<button class="btn btn-pink" id="btnSuaVezMestre" onclick="toggleSuaVezMestre()" title="Cancela todos os Cron Jobs e a cada 5 minutos o sistema envia 1 ordem de role-reversal onde VOCÊ dá ordens ao Mestre — prove sua submissão mandando">💋 SUA VEZ MESTRE (5min)</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Rotinas & Afazeres -->
|
||
<div class="category">
|
||
<div class="category-header" onclick="toggleCategory(this)">
|
||
<span class="arrow">▼</span> 🏠 Rotinas & Afazeres
|
||
</div>
|
||
<div class="category-body">
|
||
<button class="btn btn-green" onclick="ordemTrabalhoDomestico()">🏠 TRAB. DOMÉSTICOS</button>
|
||
<button class="btn btn-cyan" onclick="ordemRotina()">🌅 ROTINA DOMÉSTICA</button>
|
||
<button class="btn btn-dark" onclick="ordemRotinaCompleta()">📋 ROTINA COMPLETA</button>
|
||
<button class="btn btn-cyan" onclick="ordemEstudos()">📚 ESTUDOS AUTO-DITADAS</button>
|
||
<button class="btn btn-silver" onclick="ordemHomeOffice()">💻 HOME OFFICE</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Exposição & Erótico -->
|
||
<div class="category">
|
||
<div class="category-header" onclick="toggleCategory(this)">
|
||
<span class="arrow">▼</span> 🔥 Exposição & Erótico
|
||
</div>
|
||
<div class="category-body">
|
||
<button class="btn btn-blood" onclick="ordemExibirBundaCu()">🍑 EXIBIR BUNDA E CÚ</button>
|
||
<button class="btn btn-pink" onclick="ordemEsposaBrincaMarido()">💕 ESPOSA BRINCA</button>
|
||
<button class="btn btn-orange" onclick="ordemExposicaoPublica()">📸 EXPOSIÇÃO PÚBLICA</button>
|
||
<button class="btn btn-blood" onclick="ordemExposicaoExtrema()">🔥 EXPOSIÇÃO EXTREMA</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Links Externos -->
|
||
<div class="category">
|
||
<div class="category-header" onclick="toggleCategory(this)">
|
||
<span class="arrow">▼</span> 🌐 Links & Ferramentas
|
||
</div>
|
||
<div class="category-body">
|
||
<a href="/gerar_prompts_imagens" target="_blank" class="btn-link">
|
||
<button class="btn btn-indigo">🎨 GERAR PROMPTS (100)</button>
|
||
</a>
|
||
<a href="/contos" target="_blank" class="btn-link">
|
||
<button class="btn btn-crimson">📖 CONTOS ERÓTICOS (305)</button>
|
||
</a>
|
||
<a href="/logs_ordens" target="_blank" class="btn-link">
|
||
<button class="btn btn-dark">📋 LOGS DAS ORDENS</button>
|
||
</a>
|
||
<a href="/logs_contos" target="_blank" class="btn-link">
|
||
<button class="btn btn-dark">📋 LOGS DOS CONTOS</button>
|
||
</a>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Cron Jobs Control -->
|
||
<div class="category">
|
||
<div class="category-header" onclick="toggleCategory(this)">
|
||
<span class="arrow">▼</span> ⏰ Controle de Cron Jobs
|
||
</div>
|
||
<div class="category-body">
|
||
<button class="btn btn-red" onclick="pararTodosCron()">⏹️ PARAR TODOS OS CRON</button>
|
||
<button class="btn btn-green" onclick="iniciarTodosCron()">▶️ ATIVAR TODOS OS CRON</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="loading" id="loading">Carregando ordem...</div>
|
||
</div>
|
||
|
||
<script>
|
||
function toggleCategory(header) {
|
||
const body = header.nextElementSibling;
|
||
const arrow = header.querySelector('.arrow');
|
||
body.classList.toggle('collapsed');
|
||
arrow.classList.toggle('collapsed');
|
||
}
|
||
|
||
let sessaoAtiva = true;
|
||
|
||
// ---- IA (llama.cpp) state ----
|
||
let iaAtiva = false;
|
||
// Persona ativa no chat: 'mestre' (padrão) ou 'conversa' (companhia)
|
||
let personaChat = 'mestre';
|
||
|
||
function toggleProvedorCampos() {
|
||
const provedor = document.getElementById('cfg-provedor').value;
|
||
const camposLL = document.getElementById('llamacppCampos');
|
||
const camposOR = document.getElementById('openrouterCampos');
|
||
const camposZai = document.getElementById('zaiCampos');
|
||
const camposStepFun = document.getElementById('stepfunCampos');
|
||
camposLL.classList.toggle('hidden', provedor !== 'llamacpp');
|
||
camposOR.classList.toggle('hidden', provedor !== 'openrouter');
|
||
camposZai.classList.toggle('hidden', provedor !== 'zai');
|
||
camposStepFun.classList.toggle('hidden', provedor !== 'stepfun');
|
||
}
|
||
|
||
function popularFormProvedor(data) {
|
||
const sel = document.getElementById('cfg-provedor');
|
||
if (sel && data.provedor) {
|
||
sel.value = data.provedor;
|
||
toggleProvedorCampos();
|
||
}
|
||
const modeloEl = document.getElementById('cfg-openrouter-model');
|
||
if (modeloEl && data.modelo && !modeloEl.value) {
|
||
modeloEl.value = data.modelo;
|
||
}
|
||
const keyStatus = document.getElementById('cfg-openrouter-key-status');
|
||
if (keyStatus) {
|
||
keyStatus.className = data.api_key_definida ? 'key-status-ok' : 'key-status-no';
|
||
keyStatus.textContent = data.api_key_definida ? '✓ definida' : '✗ não definida';
|
||
}
|
||
const zaiModeloEl = document.getElementById('cfg-zai-model');
|
||
if (zaiModeloEl && data.zai_modelo && !zaiModeloEl.value) {
|
||
zaiModeloEl.value = data.zai_modelo;
|
||
}
|
||
const zaiKeyStatus = document.getElementById('cfg-zai-key-status');
|
||
if (zaiKeyStatus) {
|
||
zaiKeyStatus.className = data.zai_api_key_definida ? 'key-status-ok' : 'key-status-no';
|
||
zaiKeyStatus.textContent = data.zai_api_key_definida ? '✓ definida' : '✗ não definida';
|
||
}
|
||
const stepfunModeloEl = document.getElementById('cfg-stepfun-model');
|
||
if (stepfunModeloEl && data.stepfun_modelo && !stepfunModeloEl.value) {
|
||
stepfunModeloEl.value = data.stepfun_modelo;
|
||
}
|
||
const stepfunKeyStatus = document.getElementById('cfg-stepfun-key-status');
|
||
if (stepfunKeyStatus) {
|
||
stepfunKeyStatus.className = data.stepfun_api_key_definida ? 'key-status-ok' : 'key-status-no';
|
||
stepfunKeyStatus.textContent = data.stepfun_api_key_definida ? '✓ definida' : '✗ não definida';
|
||
}
|
||
const llamacppUrlEl = document.getElementById('cfg-llamacpp-url');
|
||
if (llamacppUrlEl && data.llamacpp_base_url && !llamacppUrlEl.value) {
|
||
llamacppUrlEl.value = data.llamacpp_base_url;
|
||
}
|
||
const openrouterUrlEl = document.getElementById('cfg-openrouter-url');
|
||
if (openrouterUrlEl && data.openrouter_base_url && !openrouterUrlEl.value) {
|
||
openrouterUrlEl.value = data.openrouter_base_url;
|
||
}
|
||
const zaiUrlEl = document.getElementById('cfg-zai-url');
|
||
if (zaiUrlEl && data.zai_base_url && !zaiUrlEl.value) {
|
||
zaiUrlEl.value = data.zai_base_url;
|
||
}
|
||
const stepfunUrlEl = document.getElementById('cfg-stepfun-url');
|
||
if (stepfunUrlEl && data.stepfun_base_url && !stepfunUrlEl.value) {
|
||
stepfunUrlEl.value = data.stepfun_base_url;
|
||
}
|
||
}
|
||
|
||
function verificarStatusIA() {
|
||
const statusEl = document.getElementById('iaStatus');
|
||
const textEl = document.getElementById('iaStatusText');
|
||
fetch('/ia_status')
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
popularFormProvedor(data);
|
||
if (data.disponivel) {
|
||
statusEl.classList.add('online');
|
||
statusEl.classList.remove('offline');
|
||
if (data.provedor === 'openrouter') {
|
||
textEl.textContent = `OpenRouter online (${data.modelo}). O Mestre está pronto.`;
|
||
} else if (data.provedor === 'zai') {
|
||
textEl.textContent = `z.ai online (${data.zai_modelo}). O Mestre está pronto.`;
|
||
} else if (data.provedor === 'stepfun') {
|
||
textEl.textContent = `StepFun online (${data.stepfun_modelo}). O Mestre está pronto.`;
|
||
} else {
|
||
textEl.textContent = 'Modelo local online. O Mestre está pronto.';
|
||
}
|
||
} else {
|
||
statusEl.classList.add('offline');
|
||
statusEl.classList.remove('online');
|
||
if (data.provedor === 'openrouter') {
|
||
textEl.textContent = data.api_key_definida
|
||
? 'OpenRouter offline. Verifique a API key e o modelo.'
|
||
: 'OpenRouter: configure a API key e o modelo.';
|
||
} else if (data.provedor === 'zai') {
|
||
textEl.textContent = data.zai_api_key_definida
|
||
? 'z.ai offline. Verifique a API key e o modelo.'
|
||
: 'z.ai: configure a API key e o modelo.';
|
||
} else if (data.provedor === 'stepfun') {
|
||
textEl.textContent = data.stepfun_api_key_definida
|
||
? 'StepFun offline. Verifique a API key e o modelo.'
|
||
: 'StepFun: configure a API key e o modelo.';
|
||
} else {
|
||
textEl.textContent = 'Modelo local offline. Inicie o llama-server na porta 8080.';
|
||
}
|
||
}
|
||
})
|
||
.catch(() => {
|
||
statusEl.classList.add('offline');
|
||
textEl.textContent = 'Não foi possível verificar o modelo.';
|
||
});
|
||
}
|
||
|
||
function toggleIA() {
|
||
iaAtiva = !iaAtiva;
|
||
const panel = document.getElementById('iaPanel');
|
||
const btn = document.getElementById('btnToggleIA');
|
||
if (iaAtiva) {
|
||
personaChat = 'mestre';
|
||
panel.classList.remove('hidden');
|
||
btn.classList.add('active');
|
||
btn.textContent = '🤖 DESATIVAR IA';
|
||
verificarStatusIA();
|
||
} else {
|
||
panel.classList.add('hidden');
|
||
btn.classList.remove('active');
|
||
btn.textContent = '🤖 ATIVAR IA';
|
||
// Also stop auto-chat if it's running
|
||
if (autoChatInterval) {
|
||
pararAutoChat();
|
||
const btnAuto = document.getElementById('btnAutoChat');
|
||
btnAuto.classList.remove('active-auto');
|
||
btnAuto.textContent = '⏱️ IA AUTO (5min)';
|
||
}
|
||
}
|
||
}
|
||
|
||
// Abre o chat em modo "conversa": a IA fala primeiro e instiga.
|
||
function conversarIA() {
|
||
personaChat = 'conversa';
|
||
iaAtiva = true;
|
||
const panel = document.getElementById('iaPanel');
|
||
const btn = document.getElementById('btnToggleIA');
|
||
panel.classList.remove('hidden');
|
||
btn.classList.add('active');
|
||
btn.textContent = '🤖 IA ATIVA (CONVERSA)';
|
||
verificarStatusIA();
|
||
// Inicia uma conversa nova: limpa o histórico e pede para a IA começar.
|
||
fetch('/ia_limpar_chat', { method: 'POST' })
|
||
.then(() => {
|
||
document.getElementById('iaChat').innerHTML = '';
|
||
iniciarConversaIA();
|
||
});
|
||
}
|
||
|
||
// Abre o chat com um Cenário Completo sorteado como contexto.
|
||
function conversarCenarioIA() {
|
||
personaChat = 'conversa';
|
||
iaAtiva = true;
|
||
const panel = document.getElementById('iaPanel');
|
||
const btn = document.getElementById('btnToggleIA');
|
||
panel.classList.remove('hidden');
|
||
btn.classList.add('active');
|
||
btn.textContent = '🤖 IA ATIVA (CENÁRIO)';
|
||
verificarStatusIA();
|
||
// Limpa o histórico e inicia uma conversa nova com cenário.
|
||
fetch('/ia_limpar_chat', { method: 'POST' })
|
||
.then(() => {
|
||
document.getElementById('iaChat').innerHTML = '';
|
||
const placeholder = adicionarMsgIA('Sorteando cenário e iniciando conversa...', 'assistant');
|
||
fetch('/ia_conversar_cenario', { method: 'POST' })
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
placeholder.remove();
|
||
if (data.erro) {
|
||
adicionarMsgIA('⚠️ ' + data.erro, 'assistant');
|
||
} else {
|
||
// Mostra o cenário sorteado como mensagem do sistema
|
||
const cenarioDiv = document.createElement('div');
|
||
cenarioDiv.style.cssText = 'background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 10px; margin-bottom: 8px; font-size: 0.8em; color: #aaa; white-space: pre-wrap;';
|
||
cenarioDiv.textContent = '🎪 CENÁRIO SORTEADO:\n' + data.cenario;
|
||
document.getElementById('iaChat').appendChild(cenarioDiv);
|
||
adicionarMsgIA(data.resposta, 'assistant');
|
||
}
|
||
})
|
||
.catch(() => {
|
||
placeholder.remove();
|
||
adicionarMsgIA('⚠️ Erro de conexão com a IA.', 'assistant');
|
||
});
|
||
});
|
||
}
|
||
|
||
function iniciarConversaIA() {
|
||
const placeholder = adicionarMsgIA('Iniciando a conversa...', 'assistant');
|
||
fetch('/ia_conversar_inicio', { method: 'POST' })
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
placeholder.remove();
|
||
if (data.erro) {
|
||
adicionarMsgIA('⚠️ ' + data.erro, 'assistant');
|
||
} else {
|
||
adicionarMsgIA(data.resposta, 'assistant');
|
||
}
|
||
})
|
||
.catch(() => {
|
||
placeholder.remove();
|
||
adicionarMsgIA('⚠️ Erro de conexão com a IA.', 'assistant');
|
||
});
|
||
}
|
||
|
||
function adicionarMsgIA(texto, classe) {
|
||
const chat = document.getElementById('iaChat');
|
||
const div = document.createElement('div');
|
||
div.className = 'ia-msg ' + classe;
|
||
div.textContent = texto;
|
||
chat.appendChild(div);
|
||
chat.scrollTop = chat.scrollHeight;
|
||
return div;
|
||
}
|
||
|
||
function iaOrdem() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ia_ordem')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🤖 ORDEM DA IA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem da IA. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function iaOrdemSentadoTrabalhando() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ia_ordem_sentado_trabalhando')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
if (data.erro) {
|
||
orderText.innerHTML = 'Erro: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💻 SENTADO TRABALHANDO`;
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💻 SENTADO TRABALHANDO`;
|
||
if (data.enviados && data.enviados.length > 0) {
|
||
timestamp.innerHTML += ` | 📲 Enviada ao Telegram`;
|
||
} else if (data.erro) {
|
||
timestamp.innerHTML += ` | ⚠️ ${data.erro}`;
|
||
}
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function iaOrdemPlugFixoMedio() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ia_ordem_plug_fixo_medio')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
if (data.erro) {
|
||
orderText.innerHTML = 'Erro: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔌 PLUG FIXO MÉDIO (IA)`;
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔌 PLUG FIXO MÉDIO (IA)`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function iaOrdem4() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ia_ordem_4')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔥 ORDEM EXTREMA (IA 4)`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem extrema. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemMegaAleatorio() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_mega_aleatorio')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎲 MEGA ALEATÓRIO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemCenarioCompleto() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_cenario_completo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎪 CENÁRIO COMPLETO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter cenário. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function iaOrdemCenarioCompleto() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ia_ordem_cenario_completo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
if (data.erro) {
|
||
orderText.innerHTML = 'Erro: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎪 CENÁRIO COMPLETO (IA)`;
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎪 CENÁRIO COMPLETO (IA)`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter cenário. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemSentadoCadeira() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_sentado_cadeira')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🪑 SENTADO NA CADEIRA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function enviarMensagemIA() {
|
||
const input = document.getElementById('iaInput');
|
||
const btn = document.getElementById('iaSendBtn');
|
||
const texto = input.value.trim();
|
||
if (!texto) return;
|
||
|
||
adicionarMsgIA(texto, 'user');
|
||
input.value = '';
|
||
btn.disabled = true;
|
||
btn.textContent = '...';
|
||
|
||
const placeholder = adicionarMsgIA(
|
||
personaChat === 'conversa' ? 'Pensando...' : 'O Mestre está pensando...',
|
||
'assistant'
|
||
);
|
||
|
||
fetch('/ia_chat', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
body: JSON.stringify({ mensagem: texto, persona: personaChat })
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
placeholder.remove();
|
||
if (data.erro) {
|
||
adicionarMsgIA('⚠️ ' + data.erro, 'assistant');
|
||
} else {
|
||
adicionarMsgIA(data.resposta, 'assistant');
|
||
}
|
||
})
|
||
.catch(error => {
|
||
placeholder.remove();
|
||
adicionarMsgIA('⚠️ Erro de conexão com a IA.', 'assistant');
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
btn.disabled = false;
|
||
btn.textContent = 'Enviar';
|
||
});
|
||
}
|
||
|
||
function limparChatIA() {
|
||
fetch('/ia_limpar_chat', { method: 'POST' })
|
||
.then(() => {
|
||
document.getElementById('iaChat').innerHTML = '';
|
||
});
|
||
}
|
||
|
||
function updateCfgVal(id) {
|
||
document.getElementById(`cfg-${id}-val`).value = document.getElementById(`cfg-${id}`).value;
|
||
}
|
||
|
||
function syncCfgRange(id) {
|
||
document.getElementById(`cfg-${id}`).value = document.getElementById(`cfg-${id}-val`).value;
|
||
}
|
||
|
||
function salvarConfigIA() {
|
||
const params = {
|
||
provedor: document.getElementById('cfg-provedor').value,
|
||
temperature: parseFloat(document.getElementById('cfg-temp-val').value),
|
||
max_tokens: parseInt(document.getElementById('cfg-tokens-val').value),
|
||
top_p: parseFloat(document.getElementById('cfg-topp-val').value),
|
||
repeat_penalty: parseFloat(document.getElementById('cfg-penalty-val').value)
|
||
};
|
||
// Only send credentials when filled, so an empty key never wipes
|
||
// an already-configured one on the server.
|
||
const apiKey = document.getElementById('cfg-openrouter-key').value.trim();
|
||
const modelo = document.getElementById('cfg-openrouter-model').value.trim();
|
||
if (apiKey) params.openrouter_api_key = apiKey;
|
||
if (modelo !== '') params.openrouter_model = modelo;
|
||
|
||
const zaiApiKey = document.getElementById('cfg-zai-key').value.trim();
|
||
const zaiModelo = document.getElementById('cfg-zai-model').value.trim();
|
||
if (zaiApiKey) params.zai_api_key = zaiApiKey;
|
||
if (zaiModelo !== '') params.zai_model = zaiModelo;
|
||
|
||
const stepfunApiKey = document.getElementById('cfg-stepfun-key').value.trim();
|
||
const stepfunModelo = document.getElementById('cfg-stepfun-model').value.trim();
|
||
if (stepfunApiKey) params.stepfun_api_key = stepfunApiKey;
|
||
if (stepfunModelo !== '') params.stepfun_model = stepfunModelo;
|
||
|
||
const llamacppUrl = document.getElementById('cfg-llamacpp-url').value.trim();
|
||
if (llamacppUrl) params.llamacpp_base_url = llamacppUrl;
|
||
const openrouterUrl = document.getElementById('cfg-openrouter-url').value.trim();
|
||
if (openrouterUrl) params.openrouter_base_url = openrouterUrl;
|
||
const zaiUrl = document.getElementById('cfg-zai-url').value.trim();
|
||
if (zaiUrl) params.zai_base_url = zaiUrl;
|
||
const stepfunUrl = document.getElementById('cfg-stepfun-url').value.trim();
|
||
if (stepfunUrl) params.stepfun_base_url = stepfunUrl;
|
||
|
||
fetch('/ia_configurar', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
body: JSON.stringify(params)
|
||
})
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
if (data.status === 'ok') {
|
||
alert('Configurações aplicadas com sucesso!');
|
||
// Don't keep the typed key in the DOM after saving.
|
||
document.getElementById('cfg-openrouter-key').value = '';
|
||
document.getElementById('cfg-zai-key').value = '';
|
||
document.getElementById('cfg-stepfun-key').value = '';
|
||
if (data.config) popularFormProvedor(data.config);
|
||
verificarStatusIA();
|
||
}
|
||
})
|
||
.catch(err => {
|
||
console.error('Erro ao salvar config:', err);
|
||
alert('Erro ao salvar configurações.');
|
||
});
|
||
}
|
||
|
||
// ---- IA revisa o Cron (reescreve ordens agendadas antes do envio) ----
|
||
function atualizarBotaoRevisaoCron(ativo) {
|
||
const btn = document.getElementById('btnRevisaoCron');
|
||
if (!btn) return;
|
||
if (ativo) {
|
||
btn.classList.add('active');
|
||
btn.textContent = '🧠 IA REVISA O CRON: ON';
|
||
} else {
|
||
btn.classList.remove('active');
|
||
btn.textContent = '🧠 IA REVISA O CRON';
|
||
}
|
||
}
|
||
|
||
function carregarEstadoRevisaoCron() {
|
||
fetch('/ia_revisar_cron')
|
||
.then(r => r.json())
|
||
.then(data => atualizarBotaoRevisaoCron(data.ativo))
|
||
.catch(() => {});
|
||
}
|
||
|
||
function toggleRevisaoCron() {
|
||
fetch('/ia_revisar_cron', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
body: JSON.stringify({})
|
||
})
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
atualizarBotaoRevisaoCron(data.ativo);
|
||
alert(data.ativo
|
||
? '✅ A IA agora analisa e reescreve cada ordem do Cron antes de enviar ao Telegram.'
|
||
: '⏹ A IA não vai mais revisar as ordens do Cron.');
|
||
})
|
||
.catch(err => {
|
||
console.error('Erro ao alternar revisão de cron:', err);
|
||
alert('Erro ao alternar a revisão de cron.');
|
||
});
|
||
}
|
||
|
||
// ---- IA Auto Chat (5 minutos) ----
|
||
let autoChatInterval = null;
|
||
const AUTO_CHAT_INTERVAL_MS = 5 * 60 * 1000; // 5 minutos
|
||
|
||
function toggleAutoChat() {
|
||
const btn = document.getElementById('btnAutoChat');
|
||
if (autoChatInterval) {
|
||
pararAutoChat();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '⏱️ IA AUTO (5min)';
|
||
} else {
|
||
// Activate IA panel if not already active
|
||
if (!iaAtiva) {
|
||
iaAtiva = true;
|
||
const panel = document.getElementById('iaPanel');
|
||
const btnIA = document.getElementById('btnToggleIA');
|
||
panel.classList.remove('hidden');
|
||
btnIA.classList.add('active');
|
||
btnIA.textContent = '🤖 IA ATIVA';
|
||
verificarStatusIA();
|
||
}
|
||
// Usa persona 'mestre' para que a IA fale como o Mestre dominador
|
||
personaChat = 'mestre';
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '⏱️ IA AUTO: ON';
|
||
// Send the first automatic message immediately
|
||
enviarAutoChat();
|
||
// Then set the 5-minute interval
|
||
autoChatInterval = setInterval(enviarAutoChat, AUTO_CHAT_INTERVAL_MS);
|
||
}
|
||
}
|
||
|
||
function pararAutoChat() {
|
||
if (autoChatInterval) {
|
||
clearInterval(autoChatInterval);
|
||
autoChatInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarAutoChat() {
|
||
const chat = document.getElementById('iaChat');
|
||
const placeholder = adicionarMsgIA('⏱️ Auto-chat: IA está pensando...', 'assistant');
|
||
|
||
fetch('/ia_auto_chat', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
placeholder.remove();
|
||
if (data.erro) {
|
||
adicionarMsgIA('⚠️ Auto-chat: ' + data.erro, 'assistant');
|
||
// If it fails, try again in 1 minute instead of 15
|
||
pararAutoChat();
|
||
autoChatInterval = setInterval(enviarAutoChat, 60 * 1000);
|
||
const btn = document.getElementById('btnAutoChat');
|
||
btn.textContent = '⏱️ IA AUTO: RETRY 1min';
|
||
} else {
|
||
adicionarMsgIA(data.resposta, 'assistant');
|
||
}
|
||
})
|
||
.catch(error => {
|
||
placeholder.remove();
|
||
adicionarMsgIA('⚠️ Erro de conexão no auto-chat.', 'assistant');
|
||
console.error('Auto-chat error:', error);
|
||
});
|
||
}
|
||
|
||
// ---- IA Ordens para Amigos (5 minutos -> Telegram) ----
|
||
let ordensAmigosInterval = null;
|
||
const ORDENS_AMIGOS_INTERVAL_MS = 5 * 60 * 1000; // 5 minutos
|
||
|
||
function toggleOrdensAmigos() {
|
||
const btn = document.getElementById('btnOrdensAmigos');
|
||
if (ordensAmigosInterval) {
|
||
pararOrdensAmigos();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '📲 ORDENS P/ AMIGOS (5min)';
|
||
} else {
|
||
// Activate IA panel if not already active
|
||
if (!iaAtiva) {
|
||
iaAtiva = true;
|
||
const panel = document.getElementById('iaPanel');
|
||
const btnIA = document.getElementById('btnToggleIA');
|
||
panel.classList.remove('hidden');
|
||
btnIA.classList.add('active');
|
||
btnIA.textContent = '🤖 IA ATIVA';
|
||
verificarStatusIA();
|
||
}
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '📲 ORDENS P/ AMIGOS: ON';
|
||
// Send the first order immediately
|
||
enviarOrdemAmigos();
|
||
// Then set the 5-minute interval
|
||
ordensAmigosInterval = setInterval(enviarOrdemAmigos, ORDENS_AMIGOS_INTERVAL_MS);
|
||
}
|
||
}
|
||
|
||
function pararOrdensAmigos() {
|
||
if (ordensAmigosInterval) {
|
||
clearInterval(ordensAmigosInterval);
|
||
ordensAmigosInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarOrdemAmigos() {
|
||
const placeholder = adicionarMsgIA('📲 Gerando ordem para os amigos...', 'assistant');
|
||
|
||
fetch('/ia_ordem_amigos', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
placeholder.remove();
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
adicionarMsgIA('⚠️ Ordens p/ amigos: ' + data.erro, 'assistant');
|
||
// Retry in 1 minute on failure (e.g. IA offline / IDs not set)
|
||
pararOrdensAmigos();
|
||
ordensAmigosInterval = setInterval(enviarOrdemAmigos, 60 * 1000);
|
||
const btn = document.getElementById('btnOrdensAmigos');
|
||
btn.textContent = '📲 ORDENS P/ AMIGOS: RETRY 1min';
|
||
} else {
|
||
let msg = data.ordem || '';
|
||
if (enviados.length > 0) {
|
||
msg += `\n\n📲 Enviada para ${enviados.length} amigo(s) no Telegram.`;
|
||
} else if (data.erro) {
|
||
msg += `\n\n⚠️ ${data.erro}`;
|
||
}
|
||
adicionarMsgIA(msg, 'assistant');
|
||
}
|
||
})
|
||
.catch(error => {
|
||
placeholder.remove();
|
||
adicionarMsgIA('⚠️ Erro de conexão ao enviar ordem aos amigos.', 'assistant');
|
||
console.error('Ordens amigos error:', error);
|
||
});
|
||
}
|
||
|
||
// ---- IA Ordens para 3 Amigos (5 minutos -> Telegram) ----
|
||
let ordens3AmigosInterval = null;
|
||
|
||
function toggleOrdens3Amigos() {
|
||
const btn = document.getElementById('btnOrdens3Amigos');
|
||
if (ordens3AmigosInterval) {
|
||
pararOrdens3Amigos();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '📲 ORDENS P/ 3 AMIGOS (5min)';
|
||
} else {
|
||
// Activate IA panel if not already active
|
||
if (!iaAtiva) {
|
||
iaAtiva = true;
|
||
const panel = document.getElementById('iaPanel');
|
||
const btnIA = document.getElementById('btnToggleIA');
|
||
panel.classList.remove('hidden');
|
||
btnIA.classList.add('active');
|
||
btnIA.textContent = '🤖 IA ATIVA';
|
||
verificarStatusIA();
|
||
}
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '📲 ORDENS P/ 3 AMIGOS: ON';
|
||
// Send the first order immediately
|
||
enviarOrdem3Amigos();
|
||
// Then set the 5-minute interval
|
||
ordens3AmigosInterval = setInterval(enviarOrdem3Amigos, ORDENS_AMIGOS_INTERVAL_MS);
|
||
}
|
||
}
|
||
|
||
function pararOrdens3Amigos() {
|
||
if (ordens3AmigosInterval) {
|
||
clearInterval(ordens3AmigosInterval);
|
||
ordens3AmigosInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarOrdem3Amigos() {
|
||
const placeholder = adicionarMsgIA('📲 Gerando ordem para os 3 amigos...', 'assistant');
|
||
|
||
fetch('/ia_ordem_amigos3', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
placeholder.remove();
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
adicionarMsgIA('⚠️ Ordens p/ 3 amigos: ' + data.erro, 'assistant');
|
||
// Retry in 1 minute on failure (e.g. IA offline / IDs not set)
|
||
pararOrdens3Amigos();
|
||
ordens3AmigosInterval = setInterval(enviarOrdem3Amigos, 60 * 1000);
|
||
const btn = document.getElementById('btnOrdens3Amigos');
|
||
btn.textContent = '📲 ORDENS P/ 3 AMIGOS: RETRY 1min';
|
||
} else {
|
||
let msg = data.ordem || '';
|
||
if (enviados.length > 0) {
|
||
msg += `\n\n📲 Enviada para ${enviados.length} amigo(s) no Telegram.`;
|
||
} else if (data.erro) {
|
||
msg += `\n\n⚠️ ${data.erro}`;
|
||
}
|
||
adicionarMsgIA(msg, 'assistant');
|
||
}
|
||
})
|
||
.catch(error => {
|
||
placeholder.remove();
|
||
adicionarMsgIA('⚠️ Erro de conexão ao enviar ordem aos 3 amigos.', 'assistant');
|
||
console.error('Ordens 3 amigos error:', error);
|
||
});
|
||
}
|
||
|
||
// ---- Controle de Cron Jobs (parar/iniciar todos) ----
|
||
function pararTodosCron() {
|
||
if (!confirm('Tem certeza que deseja PARAR TODOS os Cron Jobs do sistema Jogo?')) {
|
||
return;
|
||
}
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
alert('⏹️ Cron Jobs parados:\n' + (data.message || 'Nenhum processo encontrado.'));
|
||
})
|
||
.catch(err => {
|
||
console.error('Erro ao parar cron jobs:', err);
|
||
alert('Erro ao parar os cron jobs.');
|
||
});
|
||
}
|
||
|
||
function iniciarTodosCron() {
|
||
fetch('/cron_iniciar_todos')
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
alert('▶️ Cron Jobs iniciados:\n' + (data.message || 'Nenhum processo iniciado.'));
|
||
})
|
||
.catch(err => {
|
||
console.error('Erro ao iniciar cron jobs:', err);
|
||
alert('Erro ao iniciar os cron jobs.');
|
||
});
|
||
}
|
||
|
||
// Allow pressing Enter to send the chat message.
|
||
document.addEventListener('DOMContentLoaded', function () {
|
||
const iaInput = document.getElementById('iaInput');
|
||
if (iaInput) {
|
||
iaInput.addEventListener('keydown', function (e) {
|
||
if (e.key === 'Enter') {
|
||
e.preventDefault();
|
||
enviarMensagemIA();
|
||
}
|
||
});
|
||
}
|
||
// Carrega o estado salvo do botão "IA revisa o Cron".
|
||
carregarEstadoRevisaoCron();
|
||
});
|
||
|
||
function iniciarSessao(modo) {
|
||
fetch('/iniciar_sessao', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
body: JSON.stringify({ modo: 'sozinho' })
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
sessaoAtiva = true;
|
||
});
|
||
}
|
||
|
||
function proximaOrdem() {
|
||
if (!sessaoAtiva) return;
|
||
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/proxima_ordem')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}]`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function encerrarSessao() {
|
||
fetch('/encerrar_sessao', { method: 'POST' })
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
sessaoAtiva = false;
|
||
document.getElementById('sessionActive').classList.add('hidden');
|
||
document.getElementById('sessionStart').classList.remove('hidden');
|
||
document.getElementById('order-text').textContent = 'Clique em "Iniciar Sessão" para começar...';
|
||
});
|
||
}
|
||
|
||
function ordemMasturbacaoGozo() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_masturbacao_gozo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | ⚠️ GOZAR É OBRIGATÓRIO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemTomandoGozoIndividual() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_tomando_gozo_individual')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🥛 TOME O PRÓPRIO GOZO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemAleatoria() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_aleatoria')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎲 ALEATÓRIO DO MESTRE`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemFacaSemGozar() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_faca_sem_gozar')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🚫 GOZAR É PROIBIDO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemPiruSemGozar() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_piru_sem_gozar')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🍆 PIRU SEM GOZAR`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemTrabalhoDomestico() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_trabalho_domestico')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🏠 TRABALHO DOMÉSTICO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemRotinaCompleta() {
|
||
const o = document.getElementById('order-text');
|
||
const t = document.getElementById('timestamp');
|
||
const l = document.getElementById('loading');
|
||
l.style.display = 'block'; o.style.opacity = '0.5';
|
||
fetch('/ordem_rotina_completa')
|
||
.then(r => r.json())
|
||
.then(d => { o.innerHTML = d.ordem; t.innerHTML = '[' + d.timestamp + '] | 📋 ROTINA COMPLETA'; })
|
||
.catch(e => { o.innerHTML = 'Erro.'; })
|
||
.finally(() => { l.style.display = 'none'; o.style.opacity = '1'; });
|
||
}
|
||
|
||
function ordemRotina() {
|
||
const o = document.getElementById('order-text');
|
||
const t = document.getElementById('timestamp');
|
||
const l = document.getElementById('loading');
|
||
l.style.display = 'block'; o.style.opacity = '0.5';
|
||
fetch('/ordem_rotina')
|
||
.then(r => r.json())
|
||
.then(d => { o.innerHTML = d.ordem; t.innerHTML = '[' + d.timestamp + '] | 🌅 ROTINA DIÁRIA'; })
|
||
.catch(e => { o.innerHTML = 'Erro.'; })
|
||
.finally(() => { l.style.display = 'none'; o.style.opacity = '1'; });
|
||
}
|
||
|
||
function ordemTrioBi() {
|
||
const o = document.getElementById('order-text');
|
||
const t = document.getElementById('timestamp');
|
||
const l = document.getElementById('loading');
|
||
l.style.display = 'block';
|
||
o.style.opacity = '0.5';
|
||
fetch('/ordem_trio_bi')
|
||
.then(r => r.json())
|
||
.then(d => { o.innerHTML = d.ordem; t.innerHTML = '[' + d.timestamp + '] | 3️⃣ TRIO BI'; })
|
||
.catch(e => { o.innerHTML = 'Erro.'; console.error(e); })
|
||
.finally(() => { l.style.display = 'none'; o.style.opacity = '1'; });
|
||
}
|
||
|
||
function ordemEstudos() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
fetch('/ordem_estudos')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 📚 ESTUDOS AUTO-DITADAS`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemHomeOffice() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
fetch('/ordem_home_office')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💻 HOME OFFICE`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemCasalHomemMulher() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_casal_homem_mulher')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 👫 CASAL HOMEM & MULHER`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemSendoAtivo() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_sendo_ativo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | ⚔️ SENDO ATIVO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obterm ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemSendoPassivo() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_sendo_passivo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔮 SENDO PASSIVO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemExibirBundaCu() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_exibir_bunda_cu')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🍑 EXIBIR BUNDA E CÚ`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemEsposaBrincaMarido() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_esposa_brinca_marido')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💕 ESPOSA BRINCA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemExposicaoPublica() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_exposicao_publica')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 📸 EXPOSIÇÃO PÚBLICA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemExposicaoExtrema() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_exposicao_extrema')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔥 EXPOSIÇÃO EXTREMA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemTrabalhoForcado() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_trabalho_forcado')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💪 TRABALHO FORÇADO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemHumilhacaoPublica() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_humilhacao_publica')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 😈 HUMILHAÇÃO PÚBLICA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemCastigoCorporal() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_castigo_corporal')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔨 CASTIGO CORPORAL`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemServicoSexual() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_servico_sexual')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 👄 SERVIÇO SEXUAL`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemObedienciaExtrema() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_obediencia_extrema')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🧎 OBEDIÊNCIA EXTREMA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemPlug() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_plug')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔌 ORDEM DE PLUG`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemApenasPelado() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_apenas_pelado')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 👤 APENAS PELADO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemPlugFixoMedio() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_plug_fixo_medio')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔌 PLUG FIXO MÉDIO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemPicante() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_picante')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔥 ORDEM PICANTE`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemPlugProstata() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_plug_prostata')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | ⚡ PLUG DE PRÓSTATA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemPlugSuperGrosso() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_plug_super_grosso')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔥 PLUG SUPER GROSSO (4.5cm)`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemMasturbadorOvo() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_masturbador_ovo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🥚 MASTURBADOR OVO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemPlugParede() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_plug_parede')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔥 PLUG NA PAREDE`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemPlugSuperGrossoFestinha() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_plug_super_grosso_festinha')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎉 PLUG FESTINHA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemEsposaAmigasAmigos() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_esposa_amigas_amigos')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎪 ESPOSA, AMIGAS & AMIGOS`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemGozoControlado() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_gozo_controlado')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎯 GOZO CONTROLADO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemEdging() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_edging')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎯 EDGING`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemRuinedOrgasm() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_ruined_orgasm')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💋 RUINED ORGASM`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemGozarImaginacao() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_gozar_imaginacao')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💦 GOZAR COM IMAGINAÇÃO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemAleatorio2() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_aleatorio2')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎲 ALEATÓRIO 2`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemDesafioRapido() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_desafio_rapido')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | ⚡ DESAFIO RÁPIDO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter desafio. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemJogoVerdade() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_jogo_verdade')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎭 JOGO DA VERDADE`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter jogo da verdade. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemTesteObediencia() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_teste_obediencia')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
if (data.erro) {
|
||
orderText.innerHTML = 'Erro: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🧪 TESTE DE OBEDIÊNCIA`;
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🧪 TESTE DE OBEDIÊNCIA`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter teste de obediência. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemRoletaCastigo() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_roleta_castigo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
if (data.erro) {
|
||
orderText.innerHTML = 'Erro: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎰 ROLETA DO CASTIGO`;
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎰 ROLETA DO CASTIGO`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao girar a roleta. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemMissaoSecreta() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_missao_secreta')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🕵️ MISSÃO SECRETA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter missão secreta. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemDesafioTempo() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_desafio_tempo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | ⏱️ DESAFIO DO TEMPO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter desafio do tempo. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemCastigo() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_castigo')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🌙 CASTIGO & DISCIPLINA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemFantasias() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_fantasias')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🎭 FANTASIAS & ROLEPLAY`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemSensorial() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_sensorial')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🌡️ BRINCADEIRAS SENSORIAIS`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemAlongamentoGinastica() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_alongamento_ginastica')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🤸 ALONGAMENTO & GINÁSTICA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemConsulta() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_consulta')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🩺 FANTASIA DA CONSULTA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemConsultaExposicao() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_consulta_exposicao')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🩺 FANTASIA DA CONSULTA E EXPOSIÇÃO`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
function ordemEsposaVisita() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ordem_esposa_visita')
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
orderText.innerHTML = data.ordem;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💕 MINHA ESPOSA RECEBE VISITA`;
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- DUPLA ATV/PAS GOLD (5 minutos -> Telegram) ----
|
||
let duplaAtivoPassivoGoldInterval = null;
|
||
const DUPLA_ATIVO_PASSIVO_GOLD_MS = 5 * 60 * 1000; // 5 minutos
|
||
|
||
function toggleDuplaAtivoPassivoGold() {
|
||
const btn = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (duplaAtivoPassivoGoldInterval) {
|
||
pararDuplaAtivoPassivoGold();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
} else {
|
||
// Para outros toggles de Telegram para evitar duplicacao
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '👑 DUPLA ATV/PAS GOLD: ON';
|
||
// Send the first order immediately
|
||
enviarDuplaAtivoPassivoGold();
|
||
// Then set the 5-minute interval
|
||
duplaAtivoPassivoGoldInterval = setInterval(enviarDuplaAtivoPassivoGold, DUPLA_ATIVO_PASSIVO_GOLD_MS);
|
||
}
|
||
}
|
||
|
||
function pararDuplaAtivoPassivoGold() {
|
||
if (duplaAtivoPassivoGoldInterval) {
|
||
clearInterval(duplaAtivoPassivoGoldInterval);
|
||
duplaAtivoPassivoGoldInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarDuplaAtivoPassivoGold() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/dupla_ativo_passivo_gold_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ DUPLA ATV/PAS GOLD: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 👑 DUPLA ATV/PAS GOLD`;
|
||
// Retry in 1 minute on failure (e.g. Telegram not configured)
|
||
pararDuplaAtivoPassivoGold();
|
||
duplaAtivoPassivoGoldInterval = setInterval(enviarDuplaAtivoPassivoGold, 60 * 1000);
|
||
const btn = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
btn.textContent = '👑 DUPLA ATV/PAS GOLD: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
let extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 👑 DUPLA ATV/PAS GOLD${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('DUPLA ATV/PAS GOLD error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- Mulher Ativa (5 minutos -> Telegram) ----
|
||
let mulherAtivaInterval = null;
|
||
const MULHER_ATIVA_MS = 5 * 60 * 1000; // 5 minutos
|
||
|
||
function toggleMulherAtiva() {
|
||
const btn = document.getElementById('btnMulherAtiva');
|
||
if (mulherAtivaInterval) {
|
||
pararMulherAtiva();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '💋 MULHER ATIVA (5min)';
|
||
} else {
|
||
// Para outros toggles de Telegram para evitar duplicacao
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '💋 MULHER ATIVA: ON';
|
||
// Send the first order immediately
|
||
enviarMulherAtiva();
|
||
// Then set the 5-minute interval
|
||
mulherAtivaInterval = setInterval(enviarMulherAtiva, MULHER_ATIVA_MS);
|
||
}
|
||
}
|
||
|
||
function pararMulherAtiva() {
|
||
if (mulherAtivaInterval) {
|
||
clearInterval(mulherAtivaInterval);
|
||
mulherAtivaInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarMulherAtiva() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/mulher_ativa_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ Mulher Ativa: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💋 MULHER ATIVA`;
|
||
// Retry in 1 minute on failure (e.g. Telegram not configured)
|
||
pararMulherAtiva();
|
||
mulherAtivaInterval = setInterval(enviarMulherAtiva, 60 * 1000);
|
||
const btn = document.getElementById('btnMulherAtiva');
|
||
btn.textContent = '💋 MULHER ATIVA: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
let extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💋 MULHER ATIVA${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Mulher Ativa error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- DEITADO NA CAMA (5 minutos -> Telegram) ----
|
||
// Ao ativar: cancela TODOS os Cron Jobs e outros toggles, deixando
|
||
// somente este botao enviando ordens a cada 5 minutos.
|
||
let sozinhoCamaInterval = null;
|
||
const SOZINHO_CAMA_MS = 5 * 60 * 1000; // 5 minutos
|
||
|
||
function toggleSozinhoCama() {
|
||
const btn = document.getElementById('btnSozinhoCama');
|
||
if (sozinhoCamaInterval) {
|
||
pararSozinhoCama();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🛏️ DEITADO NA CAMA (5min)';
|
||
} else {
|
||
// 1) Cancela TODOS os Cron Jobs do sistema
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
// 2) Para outros toggles de Telegram para evitar duplicacao
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '🛏️ DEITADO NA CAMA: ON';
|
||
// Send the first order immediately
|
||
enviarSozinhoCama();
|
||
// Then set the 5-minute interval
|
||
sozinhoCamaInterval = setInterval(enviarSozinhoCama, SOZINHO_CAMA_MS);
|
||
}
|
||
}
|
||
|
||
function pararSozinhoCama() {
|
||
if (sozinhoCamaInterval) {
|
||
clearInterval(sozinhoCamaInterval);
|
||
sozinhoCamaInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarSozinhoCama() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/sozinho_cama_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ DEITADO NA CAMA: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🛏️ DEITADO NA CAMA`;
|
||
// Retry in 1 minute on failure (e.g. Telegram not configured)
|
||
pararSozinhoCama();
|
||
sozinhoCamaInterval = setInterval(enviarSozinhoCama, 60 * 1000);
|
||
const btn = document.getElementById('btnSozinhoCama');
|
||
btn.textContent = '🛏️ DEITADO NA CAMA: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
let extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🛏️ DEITADO NA CAMA${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('DEITADO NA CAMA error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- Alongamento & Relaxamento (55 minutos -> Telegram) ----
|
||
// Pausa picante do programador. Ao ativar: cancela TODOS os Cron Jobs
|
||
// e outros toggles, deixando somente este botao enviando uma ordem
|
||
// picante de alongamento/relaxamento a cada 55 minutos.
|
||
let alongamentoRelaxamentoInterval = null;
|
||
const ALONGAMENTO_RELAXAMENTO_MS = 55 * 60 * 1000; // 55 minutos
|
||
|
||
function toggleAlongamentoRelaxamento() {
|
||
const btn = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (alongamentoRelaxamentoInterval) {
|
||
pararAlongamentoRelaxamento();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🧘 ALONGAMENTO (55min)';
|
||
} else {
|
||
// 1) Cancela TODOS os Cron Jobs do sistema
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
// 2) Para outros toggles de Telegram para evitar duplicacao
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSozinhoCama === 'function') {
|
||
pararSozinhoCama();
|
||
const btnCama = document.getElementById('btnSozinhoCama');
|
||
if (btnCama) {
|
||
btnCama.classList.remove('active-auto');
|
||
btnCama.textContent = '🛏️ DEITADO NA CAMA (5min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '🧘 ALONGAMENTO & RELAXAMENTO: ON';
|
||
// Send the first order immediately
|
||
enviarAlongamentoRelaxamento();
|
||
// Then set the 55-minute interval
|
||
alongamentoRelaxamentoInterval = setInterval(enviarAlongamentoRelaxamento, ALONGAMENTO_RELAXAMENTO_MS);
|
||
}
|
||
}
|
||
|
||
function pararAlongamentoRelaxamento() {
|
||
if (alongamentoRelaxamentoInterval) {
|
||
clearInterval(alongamentoRelaxamentoInterval);
|
||
alongamentoRelaxamentoInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarAlongamentoRelaxamento() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/alongamento_relaxamento_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ Alongamento & Relaxamento: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🧘 ALONGAMENTO & RELAXAMENTO`;
|
||
// Retry in 1 minute on failure (e.g. Telegram not configured)
|
||
pararAlongamentoRelaxamento();
|
||
alongamentoRelaxamentoInterval = setInterval(enviarAlongamentoRelaxamento, 60 * 1000);
|
||
const btn = document.getElementById('btnAlongamentoRelaxamento');
|
||
btn.textContent = '🧘 ALONGAMENTO & RELAXAMENTO: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
let extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🧘 ALONGAMENTO & RELAXAMENTO${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Alongamento & Relaxamento error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
// ---- CRON Sentado na Cadeira (15 minutos -> Telegram) ----
|
||
let sentadoCadeiraInterval = null;
|
||
const SENTADO_CADEIRA_MS = 15 * 60 * 1000; // 15 minutos
|
||
|
||
function toggleSentadoCadeiraCron() {
|
||
const btn = document.getElementById('btnSentadoCadeiraCron');
|
||
if (sentadoCadeiraInterval) {
|
||
pararSentadoCadeiraCron();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🪑 CRON SENTADO (15min)';
|
||
} else {
|
||
// 1) Cancela TODOS os Cron Jobs do sistema
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
// 2) Para outros toggles de Telegram para evitar duplicacao
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSozinhoCama === 'function') {
|
||
pararSozinhoCama();
|
||
const btnCama = document.getElementById('btnSozinhoCama');
|
||
if (btnCama) {
|
||
btnCama.classList.remove('active-auto');
|
||
btnCama.textContent = '🛏️ DEITADO NA CAMA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '🪑 CRON SENTADO: ON';
|
||
// Send the first order immediately
|
||
enviarSentadoCadeira();
|
||
// Then set the 15-minute interval
|
||
sentadoCadeiraInterval = setInterval(enviarSentadoCadeira, SENTADO_CADEIRA_MS);
|
||
}
|
||
}
|
||
|
||
function pararSentadoCadeiraCron() {
|
||
if (sentadoCadeiraInterval) {
|
||
clearInterval(sentadoCadeiraInterval);
|
||
sentadoCadeiraInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarSentadoCadeira() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/sentado_cadeira_cron_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ CRON Sentado: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🪑 CRON SENTADO`;
|
||
// Retry in 1 minute on failure (e.g. Telegram not configured)
|
||
pararSentadoCadeiraCron();
|
||
sentadoCadeiraInterval = setInterval(enviarSentadoCadeira, 60 * 1000);
|
||
const btn = document.getElementById('btnSentadoCadeiraCron');
|
||
btn.textContent = '🪑 CRON SENTADO: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
let extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🪑 CRON SENTADO${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('CRON Sentado error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- Plug Fixo Médio (5 minutos -> Telegram) ----
|
||
let plugFixoMedioInterval = null;
|
||
const PLUG_FIXO_MEDIO_MS = 5 * 60 * 1000; // 5 minutos
|
||
|
||
function togglePlugFixoMedio() {
|
||
const btn = document.getElementById('btnPlugFixoMedio');
|
||
if (plugFixoMedioInterval) {
|
||
pararPlugFixoMedio();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🔌 PLUG FIXO MÉDIO (5min)';
|
||
} else {
|
||
// 1) Cancela TODOS os Cron Jobs do sistema
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
// 2) Para outros toggles de Telegram para evitar duplicacao
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSozinhoCama === 'function') {
|
||
pararSozinhoCama();
|
||
const btnCama = document.getElementById('btnSozinhoCama');
|
||
if (btnCama) {
|
||
btnCama.classList.remove('active-auto');
|
||
btnCama.textContent = '🛏️ DEITADO NA CAMA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSentadoCadeiraCron === 'function') {
|
||
pararSentadoCadeiraCron();
|
||
const btnSC = document.getElementById('btnSentadoCadeiraCron');
|
||
if (btnSC) {
|
||
btnSC.classList.remove('active-auto');
|
||
btnSC.textContent = '🪑 CRON SENTADO (15min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '🔌 PLUG FIXO MÉDIO: ON';
|
||
// Send the first order immediately
|
||
enviarPlugFixoMedio();
|
||
// Then set the 15-minute interval
|
||
plugFixoMedioInterval = setInterval(enviarPlugFixoMedio, PLUG_FIXO_MEDIO_MS);
|
||
}
|
||
}
|
||
|
||
function pararPlugFixoMedio() {
|
||
if (plugFixoMedioInterval) {
|
||
clearInterval(plugFixoMedioInterval);
|
||
plugFixoMedioInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarPlugFixoMedio() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/plug_fixo_medio_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ Plug Fixo Médio: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔌 PLUG FIXO MÉDIO`;
|
||
// Retry in 1 minute on failure (e.g. Telegram not configured)
|
||
pararPlugFixoMedio();
|
||
plugFixoMedioInterval = setInterval(enviarPlugFixoMedio, 60 * 1000);
|
||
const btn = document.getElementById('btnPlugFixoMedio');
|
||
btn.textContent = '🔌 PLUG FIXO MÉDIO: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
let extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔌 PLUG FIXO MÉDIO${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Plug Fixo Médio error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- PIRU CONTÍNUO (2 minutos -> Telegram, pausa automática após 30 min) ----
|
||
let piruContinuoInterval = null;
|
||
let piruContinuoStartTime = null;
|
||
const PIRU_CONTINUO_MS = 2 * 60 * 1000; // 2 minutos
|
||
const PIRU_CONTINUO_MAX_MS = 30 * 60 * 1000; // 30 minutos
|
||
|
||
function togglePiruContinuo() {
|
||
const btn = document.getElementById('btnPiruContinuo');
|
||
if (piruContinuoInterval) {
|
||
pararPiruContinuo();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🔥 PIRU CONTÍNUO (2min)';
|
||
} else {
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
// Pausar todos os outros botões ativos
|
||
if (typeof pararPiru === 'function') {
|
||
pararPiru();
|
||
const btnP = document.getElementById('btnPiru');
|
||
if (btnP) {
|
||
btnP.classList.remove('active-auto');
|
||
btnP.textContent = '🍆 PIRU (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPiruSemGozar === 'function') {
|
||
pararPiruSemGozar();
|
||
const btnPSG = document.getElementById('btnPiruSemGozar');
|
||
if (btnPSG) {
|
||
btnPSG.classList.remove('active-auto');
|
||
btnPSG.textContent = '🍆 PIRU SEM GOZAR (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararOrdensIA3 === 'function') {
|
||
pararOrdensIA3();
|
||
const btnIA3 = document.getElementById('btnOrdensIA3');
|
||
if (btnIA3) {
|
||
btnIA3.classList.remove('active-auto');
|
||
btnIA3.textContent = '🤖 ORDENS DA IA 3 (10min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSozinhoCama === 'function') {
|
||
pararSozinhoCama();
|
||
const btnCama = document.getElementById('btnSozinhoCama');
|
||
if (btnCama) {
|
||
btnCama.classList.remove('active-auto');
|
||
btnCama.textContent = '🛏️ DEITADO NA CAMA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSentadoCadeiraCron === 'function') {
|
||
pararSentadoCadeiraCron();
|
||
const btnSC = document.getElementById('btnSentadoCadeiraCron');
|
||
if (btnSC) {
|
||
btnSC.classList.remove('active-auto');
|
||
btnSC.textContent = '🪑 CRON SENTADO (15min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPlugFixoMedio === 'function') {
|
||
pararPlugFixoMedio();
|
||
const btnPFM = document.getElementById('btnPlugFixoMedio');
|
||
if (btnPFM) {
|
||
btnPFM.classList.remove('active-auto');
|
||
btnPFM.textContent = '🔌 PLUG FIXO MÉDIO (5min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '🔥 PIRU: ON';
|
||
piruContinuoStartTime = Date.now();
|
||
enviarPiruContinuo();
|
||
piruContinuoInterval = setInterval(enviarPiruContinuo, PIRU_CONTINUO_MS);
|
||
}
|
||
}
|
||
|
||
function pararPiruContinuo() {
|
||
if (piruContinuoInterval) {
|
||
clearInterval(piruContinuoInterval);
|
||
piruContinuoInterval = null;
|
||
}
|
||
piruContinuoStartTime = null;
|
||
}
|
||
|
||
function enviarPiruContinuo() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
// Verificar se atingiu 30 minutos — pausa automática
|
||
if (piruContinuoStartTime && (Date.now() - piruContinuoStartTime >= PIRU_CONTINUO_MAX_MS)) {
|
||
const btn = document.getElementById('btnPiruContinuo');
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🔥 PIRU CONTÍNUO (2min)';
|
||
orderText.innerHTML = '🔥 PIRU CONTÍNUO: 30 minutos de fogo atingidos. Pausa automática. Pausa de 30 minutos recomendada. Clique novamente para retomar.';
|
||
timestamp.innerHTML = `[${new Date().toLocaleTimeString()}] | 🔥 PIRU CONTÍNUO: PAUSA AUTOMÁTICA`;
|
||
pararPiruContinuo();
|
||
return;
|
||
}
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/piru_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ Piru Contínuo: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔥 PIRU CONTÍNUO`;
|
||
pararPiruContinuo();
|
||
} else {
|
||
let tempoRestante = '';
|
||
if (piruContinuoStartTime) {
|
||
const elapsed = Math.floor((Date.now() - piruContinuoStartTime) / 1000);
|
||
const remaining = Math.max(0, 30 * 60 - elapsed);
|
||
const mins = Math.floor(remaining / 60);
|
||
const secs = remaining % 60;
|
||
tempoRestante = ` | ⏱️ ${mins}m${secs}s até pausa`;
|
||
}
|
||
orderText.innerHTML = data.ordem;
|
||
const extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🔥 PIRU CONTÍNUO${extra}${tempoRestante}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Piru Contínuo error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- PIRU (5 minutos -> Telegram) ----
|
||
let piruInterval = null;
|
||
const PIRU_MS = 5 * 60 * 1000; // 5 minutos
|
||
|
||
function togglePiru() {
|
||
const btn = document.getElementById('btnPiru');
|
||
if (piruInterval) {
|
||
pararPiru();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🍆 PIRU (5min)';
|
||
} else {
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
if (typeof pararPiruSemGozar === 'function') {
|
||
pararPiruSemGozar();
|
||
const btnPSG = document.getElementById('btnPiruSemGozar');
|
||
if (btnPSG) {
|
||
btnPSG.classList.remove('active-auto');
|
||
btnPSG.textContent = '🍆 PIRU SEM GOZAR (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSozinhoCama === 'function') {
|
||
pararSozinhoCama();
|
||
const btnCama = document.getElementById('btnSozinhoCama');
|
||
if (btnCama) {
|
||
btnCama.classList.remove('active-auto');
|
||
btnCama.textContent = '🛏️ DEITADO NA CAMA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSentadoCadeiraCron === 'function') {
|
||
pararSentadoCadeiraCron();
|
||
const btnSC = document.getElementById('btnSentadoCadeiraCron');
|
||
if (btnSC) {
|
||
btnSC.classList.remove('active-auto');
|
||
btnSC.textContent = '🪑 CRON SENTADO (15min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPlugFixoMedio === 'function') {
|
||
pararPlugFixoMedio();
|
||
const btnPFM = document.getElementById('btnPlugFixoMedio');
|
||
if (btnPFM) {
|
||
btnPFM.classList.remove('active-auto');
|
||
btnPFM.textContent = '🔌 PLUG FIXO MÉDIO (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararOrdensIA3 === 'function') {
|
||
pararOrdensIA3();
|
||
const btnIA3 = document.getElementById('btnOrdensIA3');
|
||
if (btnIA3) {
|
||
btnIA3.classList.remove('active-auto');
|
||
btnIA3.textContent = '🤖 ORDENS DA IA 3 (10min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '🍆 PIRU: ON';
|
||
enviarPiru();
|
||
piruInterval = setInterval(enviarPiru, PIRU_MS);
|
||
}
|
||
}
|
||
|
||
function pararPiru() {
|
||
if (piruInterval) {
|
||
clearInterval(piruInterval);
|
||
piruInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarPiru() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/piru_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ Piru: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🍆 PIRU`;
|
||
pararPiru();
|
||
piruInterval = setInterval(enviarPiru, 60 * 1000);
|
||
const btn = document.getElementById('btnPiru');
|
||
btn.textContent = '🍆 PIRU: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
let extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🍆 PIRU${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Piru error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- PIRU SEM GOZAR (5 minutos -> Telegram) ----
|
||
let piruSemGozarInterval = null;
|
||
const PIRU_SEM_GOZAR_MS = 5 * 60 * 1000;
|
||
|
||
function togglePiruSemGozar() {
|
||
const btn = document.getElementById('btnPiruSemGozar');
|
||
if (piruSemGozarInterval) {
|
||
pararPiruSemGozar();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🍆 PIRU SEM GOZAR (5min)';
|
||
} else {
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
if (typeof pararPiru === 'function') {
|
||
pararPiru();
|
||
const btnP = document.getElementById('btnPiru');
|
||
if (btnP) {
|
||
btnP.classList.remove('active-auto');
|
||
btnP.textContent = '🍆 PIRU (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPiruContinuo === 'function') {
|
||
pararPiruContinuo();
|
||
const btnPC = document.getElementById('btnPiruContinuo');
|
||
if (btnPC) {
|
||
btnPC.classList.remove('active-auto');
|
||
btnPC.textContent = '🔥 PIRU CONTÍNUO (2min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSozinhoCama === 'function') {
|
||
pararSozinhoCama();
|
||
const btnCama = document.getElementById('btnSozinhoCama');
|
||
if (btnCama) {
|
||
btnCama.classList.remove('active-auto');
|
||
btnCama.textContent = '🛏️ DEITADO NA CAMA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSentadoCadeiraCron === 'function') {
|
||
pararSentadoCadeiraCron();
|
||
const btnSC = document.getElementById('btnSentadoCadeiraCron');
|
||
if (btnSC) {
|
||
btnSC.classList.remove('active-auto');
|
||
btnSC.textContent = '🪑 CRON SENTADO (15min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPlugFixoMedio === 'function') {
|
||
pararPlugFixoMedio();
|
||
const btnPFM = document.getElementById('btnPlugFixoMedio');
|
||
if (btnPFM) {
|
||
btnPFM.classList.remove('active-auto');
|
||
btnPFM.textContent = '🔌 PLUG FIXO MÉDIO (5min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '🍆 PIRU SEM GOZAR: ON';
|
||
enviarPiruSemGozar();
|
||
piruSemGozarInterval = setInterval(enviarPiruSemGozar, PIRU_SEM_GOZAR_MS);
|
||
}
|
||
}
|
||
|
||
function pararPiruSemGozar() {
|
||
if (piruSemGozarInterval) {
|
||
clearInterval(piruSemGozarInterval);
|
||
piruSemGozarInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarPiruSemGozar() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/piru_sem_gozar_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ Piru Sem Gozar: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🍆 PIRU SEM GOZAR`;
|
||
pararPiruSemGozar();
|
||
piruSemGozarInterval = setInterval(enviarPiruSemGozar, 60 * 1000);
|
||
const btn = document.getElementById('btnPiruSemGozar');
|
||
btn.textContent = '🍆 PIRU SEM GOZAR: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
const extra = enviados.length > 0
|
||
? ` | 📤 Telegram OK (${enviados.join(', ')})`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🍆 PIRU SEM GOZAR${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Piru Sem Gozar error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- ORDENS DA IA 3 (10 minutos -> Telegram) ----
|
||
let ordensIA3Interval = null;
|
||
const ORDENS_IA_3_MS = 10 * 60 * 1000;
|
||
|
||
function toggleOrdensIA3() {
|
||
const btn = document.getElementById('btnOrdensIA3');
|
||
if (ordensIA3Interval) {
|
||
pararOrdensIA3();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '🤖 ORDENS DA IA 3 (10min)';
|
||
} else {
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
if (typeof pararPiru === 'function') {
|
||
pararPiru();
|
||
const btnP = document.getElementById('btnPiru');
|
||
if (btnP) {
|
||
btnP.classList.remove('active-auto');
|
||
btnP.textContent = '🍆 PIRU (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPiruSemGozar === 'function') {
|
||
pararPiruSemGozar();
|
||
const btnPSG = document.getElementById('btnPiruSemGozar');
|
||
if (btnPSG) {
|
||
btnPSG.classList.remove('active-auto');
|
||
btnPSG.textContent = '🍆 PIRU SEM GOZAR (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPiruContinuo === 'function') {
|
||
pararPiruContinuo();
|
||
const btnPC = document.getElementById('btnPiruContinuo');
|
||
if (btnPC) {
|
||
btnPC.classList.remove('active-auto');
|
||
btnPC.textContent = '🔥 PIRU CONTÍNUO (2min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATIVO/PASSIVO GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSozinhoCama === 'function') {
|
||
pararSozinhoCama();
|
||
const btnCama = document.getElementById('btnSozinhoCama');
|
||
if (btnCama) {
|
||
btnCama.classList.remove('active-auto');
|
||
btnCama.textContent = '🛏️ SOZINHO DEITADO NA CAMA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSentadoCadeiraCron === 'function') {
|
||
pararSentadoCadeiraCron();
|
||
const btnSC = document.getElementById('btnSentadoCadeiraCron');
|
||
if (btnSC) {
|
||
btnSC.classList.remove('active-auto');
|
||
btnSC.textContent = '🪑 CRON SENTADO (15min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPlugFixoMedio === 'function') {
|
||
pararPlugFixoMedio();
|
||
const btnPFM = document.getElementById('btnPlugFixoMedio');
|
||
if (btnPFM) {
|
||
btnPFM.classList.remove('active-auto');
|
||
btnPFM.textContent = '🔌 PLUG FIXO MÉDIO (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSuaVezMestre === 'function') {
|
||
pararSuaVezMestre();
|
||
const btnSV = document.getElementById('btnSuaVezMestre');
|
||
if (btnSV) {
|
||
btnSV.classList.remove('active-auto');
|
||
btnSV.textContent = '💋 SUA VEZ MESTRE (5min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '🤖 ORDENS DA IA 3: ON';
|
||
enviarOrdemIA3();
|
||
ordensIA3Interval = setInterval(enviarOrdemIA3, ORDENS_IA_3_MS);
|
||
}
|
||
}
|
||
|
||
function pararOrdensIA3() {
|
||
if (ordensIA3Interval) {
|
||
clearInterval(ordensIA3Interval);
|
||
ordensIA3Interval = null;
|
||
}
|
||
}
|
||
|
||
function enviarOrdemIA3() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/ia_ordem_3_telegram', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ IA3: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🤖 ORDENS DA IA 3`;
|
||
pararOrdensIA3();
|
||
ordensIA3Interval = setInterval(enviarOrdemIA3, ORDENS_IA_3_MS);
|
||
const btn = document.getElementById('btnOrdensIA3');
|
||
btn.textContent = '🤖 ORDENS DA IA 3: RETRY 10min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
const extra = enviados.length > 0
|
||
? ` | 📤 Telegram OK (${enviados.join(', ')})`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 🤖 ORDENS DA IA 3${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem da IA 3. Tente novamente.';
|
||
console.error('IA3 error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
|
||
// ---- SUA VEZ MESTRE (role-reversal, 5 minutos -> Telegram) ----
|
||
let suaVezMestreInterval = null;
|
||
const SUA_VEZ_MESTRE_MS = 5 * 60 * 1000;
|
||
|
||
function toggleSuaVezMestre() {
|
||
const btn = document.getElementById('btnSuaVezMestre');
|
||
if (suaVezMestreInterval) {
|
||
pararSuaVezMestre();
|
||
btn.classList.remove('active-auto');
|
||
btn.textContent = '💋 SUA VEZ MESTRE (5min)';
|
||
} else {
|
||
fetch('/cron_parar_todos')
|
||
.then(r => r.json())
|
||
.then(d => console.log('Cron Jobs cancelados:', d.message || ''))
|
||
.catch(err => console.error('Erro ao parar cron jobs:', err));
|
||
|
||
if (typeof pararPiru === 'function') {
|
||
pararPiru();
|
||
const btnP = document.getElementById('btnPiru');
|
||
if (btnP) {
|
||
btnP.classList.remove('active-auto');
|
||
btnP.textContent = '🍆 PIRU (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPiruSemGozar === 'function') {
|
||
pararPiruSemGozar();
|
||
const btnPSG = document.getElementById('btnPiruSemGozar');
|
||
if (btnPSG) {
|
||
btnPSG.classList.remove('active-auto');
|
||
btnPSG.textContent = '🍆 PIRU SEM GOZAR (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPiruContinuo === 'function') {
|
||
pararPiruContinuo();
|
||
const btnPC = document.getElementById('btnPiruContinuo');
|
||
if (btnPC) {
|
||
btnPC.classList.remove('active-auto');
|
||
btnPC.textContent = '🔥 PIRU CONTÍNUO (2min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararDuplaAtivoPassivoGold === 'function') {
|
||
pararDuplaAtivoPassivoGold();
|
||
const btnGold = document.getElementById('btnDuplaAtivoPassivoGold');
|
||
if (btnGold) {
|
||
btnGold.classList.remove('active-auto');
|
||
btnGold.textContent = '👑 DUPLA ATV/PAS GOLD (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararMulherAtiva === 'function') {
|
||
pararMulherAtiva();
|
||
const btnMulher = document.getElementById('btnMulherAtiva');
|
||
if (btnMulher) {
|
||
btnMulher.classList.remove('active-auto');
|
||
btnMulher.textContent = '💋 MULHER ATIVA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSozinhoCama === 'function') {
|
||
pararSozinhoCama();
|
||
const btnCama = document.getElementById('btnSozinhoCama');
|
||
if (btnCama) {
|
||
btnCama.classList.remove('active-auto');
|
||
btnCama.textContent = '🛏️ DEITADO NA CAMA (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararAlongamentoRelaxamento === 'function') {
|
||
pararAlongamentoRelaxamento();
|
||
const btnAR = document.getElementById('btnAlongamentoRelaxamento');
|
||
if (btnAR) {
|
||
btnAR.classList.remove('active-auto');
|
||
btnAR.textContent = '🧘 ALONGAMENTO (55min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararSentadoCadeiraCron === 'function') {
|
||
pararSentadoCadeiraCron();
|
||
const btnSC = document.getElementById('btnSentadoCadeiraCron');
|
||
if (btnSC) {
|
||
btnSC.classList.remove('active-auto');
|
||
btnSC.textContent = '🪑 CRON SENTADO (15min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararPlugFixoMedio === 'function') {
|
||
pararPlugFixoMedio();
|
||
const btnPFM = document.getElementById('btnPlugFixoMedio');
|
||
if (btnPFM) {
|
||
btnPFM.classList.remove('active-auto');
|
||
btnPFM.textContent = '🔌 PLUG FIXO MÉDIO (5min)';
|
||
}
|
||
}
|
||
|
||
if (typeof pararOrdensIA3 === 'function') {
|
||
pararOrdensIA3();
|
||
const btnIA3 = document.getElementById('btnOrdensIA3');
|
||
if (btnIA3) {
|
||
btnIA3.classList.remove('active-auto');
|
||
btnIA3.textContent = '🤖 ORDENS DA IA 3 (10min)';
|
||
}
|
||
}
|
||
|
||
btn.classList.add('active-auto');
|
||
btn.textContent = '💋 SUA VEZ: ON';
|
||
enviarSuaVezMestre();
|
||
suaVezMestreInterval = setInterval(enviarSuaVezMestre, SUA_VEZ_MESTRE_MS);
|
||
}
|
||
}
|
||
|
||
function pararSuaVezMestre() {
|
||
if (suaVezMestreInterval) {
|
||
clearInterval(suaVezMestreInterval);
|
||
suaVezMestreInterval = null;
|
||
}
|
||
}
|
||
|
||
function enviarSuaVezMestre() {
|
||
const orderText = document.getElementById('order-text');
|
||
const timestamp = document.getElementById('timestamp');
|
||
const loading = document.getElementById('loading');
|
||
|
||
loading.style.display = 'block';
|
||
orderText.style.opacity = '0.5';
|
||
|
||
fetch('/sua_vez_mestre', {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json' },
|
||
})
|
||
.then(response => response.json())
|
||
.then(data => {
|
||
const enviados = data.enviados || [];
|
||
if (data.erro && enviados.length === 0) {
|
||
orderText.innerHTML = '⚠️ Sua Vez Mestre: ' + data.erro;
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💋 SUA VEZ MESTRE`;
|
||
pararSuaVezMestre();
|
||
suaVezMestreInterval = setInterval(enviarSuaVezMestre, 60 * 1000);
|
||
const btn = document.getElementById('btnSuaVezMestre');
|
||
btn.textContent = '💋 SUA VEZ: RETRY 1min';
|
||
} else {
|
||
orderText.innerHTML = data.ordem;
|
||
const extra = enviados.length > 0
|
||
? ` | 📲 Enviada ao Telegram`
|
||
: (data.erro ? ` | ⚠️ ${data.erro}` : '');
|
||
timestamp.innerHTML = `[${data.timestamp}] | 💋 SUA VEZ MESTRE${extra}`;
|
||
}
|
||
})
|
||
.catch(error => {
|
||
orderText.innerHTML = 'Erro ao obter ordem. Tente novamente.';
|
||
console.error('Sua Vez Mestre error:', error);
|
||
})
|
||
.finally(() => {
|
||
loading.style.display = 'none';
|
||
orderText.style.opacity = '1';
|
||
});
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|