auto trade and auto bandit

This commit is contained in:
2026-05-01 01:54:09 +03:00
parent 2a73e46a7b
commit 2921dff257
6 changed files with 630 additions and 7 deletions

View File

@@ -28,8 +28,9 @@ async function pollAndExecute() {
return;
}
// Cache farm settings so autoFarmLoop can read them without an extra call
// Cache farm + bot settings so autonomous loops can read them without extra calls
lastKnownFarmSettings = cmdData.farm_settings || {};
lastKnownBotSettings = cmdData.bot_settings || {};
// Feature flags — default to all on if server doesn't send them (backward compatible)
const features = cmdData.enabled_features || ['farm', 'admin'];
@@ -190,12 +191,14 @@ async function autoFarmLoop() {
// so we check readyState and boot immediately in that case.
// ----------------------------------------------------------------
function boot() {
log('Grepolis Remote Control v4.1.0 (remote) loaded');
log('Grepolis Remote Control v4.2.0 (remote) loaded');
detectCaptcha();
setTimeout(pushState, 5000);
jitterLoop(pushState, 60000, 120000); // state sync every 1-2 min
jitterLoop(pollAndExecute, 8000, 18000); // command poll every 8-18 s
jitterLoop(autoFarmLoop, 60000, 120000); // auto-farm every 1-2 min (independent)
jitterLoop(pushState, 60000, 120000); // state sync every 12 min
jitterLoop(pollAndExecute, 8000, 18000); // command poll every 818 s
jitterLoop(autoFarmLoop, 60000, 120000); // auto-farm every 12 min
jitterLoop(autoBootcampLoop, 720000, 1320000); // bootcamp every 1222 min
jitterLoop(autoRuralTradeLoop, 1500000, 2700000); // rural trade every 2545 min
}
if (document.readyState === 'complete') {