fix for buildinds

This commit is contained in:
2026-04-29 22:05:57 +03:00
parent d952e7ca56
commit 1db8d744c8
4 changed files with 71 additions and 10 deletions

View File

@@ -833,8 +833,8 @@
return;
}
// Build queue, Recruit queue and Market queue are independent
const buildCmd = cmdData.build;
// Build queue: one command per town (all towns build in the same poll cycle)
const buildCmds = cmdData.builds || [];
const recruitCmd = cmdData.recruit;
const marketCmd = cmdData.market;
const researchCmd = cmdData.research;
@@ -873,8 +873,16 @@
reportResult(cmd.id, finalStatus, result.msg);
};
// Run sequentially — humans cannot perform 3 actions simultaneously!
await execute(buildCmd);
// Execute ALL town build commands (one per town, sequential with inter-town delay)
for (let i = 0; i < buildCmds.length; i++) {
await execute(buildCmds[i]);
if (i < buildCmds.length - 1) {
// Random gap between towns so it doesn't look like a macro
const gap = randInt(1500, 3000);
log(`Build: town done. Waiting ${gap}ms before next town...`);
await sleep(gap);
}
}
await execute(recruitCmd);
await execute(marketCmd);
await execute(researchCmd);