This commit is contained in:
2026-04-21 19:25:36 +03:00
parent b0d933c1a0
commit c41eebac87

View File

@@ -1,7 +1,7 @@
// ==UserScript==
// @name Grepolis Remote Control
// @namespace http://tampermonkey.net/
// @version 2.5
// @version 2.6
// @description Polls grepo.haunter-pets.top for remote commands and executes them in-game
// @author Dimitrios
// @match https://*.grepolis.com/game/*
@@ -295,9 +295,19 @@
}
function detectCaptcha() {
const observer = new MutationObserver(() => {
const hasWindow = !!document.getElementById('hcaptcha_window');
if (hasWindow && !captchaActive) {
setInterval(() => {
const win = document.getElementById('hcaptcha_window');
let isVisible = false;
if (win) {
// Check if it's actually visible on screen (not display: none by the game)
const style = window.getComputedStyle(win);
if (style.display !== 'none' && style.visibility !== 'hidden') {
isVisible = true;
}
}
if (isVisible && !captchaActive) {
captchaActive = true;
paused = true;
const label = document.getElementById('grc_label');
@@ -306,14 +316,13 @@
if (btn) btn.style.filter = 'brightness(70%) sepia(100%) hue-rotate(300deg) saturate(1000%) contrast(0.8)';
log('⚠ CAPTCHA detected — bot paused, alerting server');
reportCaptcha(true);
} else if (!hasWindow && captchaActive) {
} else if (!isVisible && captchaActive) {
captchaActive = false;
// Don't auto-resume — let the user click the button manually
log('✅ Captcha resolved — alert cleared (bot remains paused)');
reportCaptcha(false);
}
});
observer.observe(document.body, { childList: true, subtree: false });
}, 1000);
}
// ----------------------------------------------------------------