This commit is contained in:
2026-04-20 19:40:33 +03:00
parent 3c658dc0a8
commit c34fbb6ab4
2 changed files with 9 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Grepolis Remote Control // @name Grepolis Remote Control
// @namespace http://tampermonkey.net/ // @namespace http://tampermonkey.net/
// @version 1.9 // @version 2.0
// @description Polls grepo.haunter-pets.top for remote commands and executes them in-game // @description Polls grepo.haunter-pets.top for remote commands and executes them in-game
// @author Dimitrios // @author Dimitrios
// @match https://*.grepolis.com/game/* // @match https://*.grepolis.com/game/*
@@ -110,7 +110,8 @@
build_time: buildDataRaw[k].building_time || '', build_time: buildDataRaw[k].building_time || '',
can_upgrade: !!buildDataRaw[k].can_upgrade, can_upgrade: !!buildDataRaw[k].can_upgrade,
enough_resources: !!buildDataRaw[k].enough_resources, enough_resources: !!buildDataRaw[k].enough_resources,
missing_dependencies: buildDataRaw[k].missing_dependencies || [] missing_dependencies: buildDataRaw[k].missing_dependencies || [],
has_max_level: !!buildDataRaw[k].has_max_level
}; };
} }
} catch (e) { } catch (e) {
@@ -248,10 +249,10 @@
const res = town.resources(); const res = town.resources();
const { resources_for, population_for } = buildData; const { resources_for, population_for } = buildData;
if (town.getAvailablePopulation?.() < population_for) { if (town.getAvailablePopulation?.() < population_for) {
return { ok: false, msg: `Not enough population for ${building_id}` }; return { ok: false, requeue: true, msg: `Not enough population for ${building_id}` };
} }
if (res.wood < resources_for.wood || res.stone < resources_for.stone || res.iron < resources_for.iron) { if (res.wood < resources_for.wood || res.stone < resources_for.stone || res.iron < resources_for.iron) {
return { ok: false, msg: `Not enough resources for ${building_id}` }; return { ok: false, requeue: true, msg: `Not enough resources for ${building_id}` };
} }
} }
} catch (e) { } catch (e) {

View File

@@ -43,7 +43,10 @@ window.renderBuildingDropdown = function() {
const option = document.createElement('option'); const option = document.createElement('option');
option.value = key; option.value = key;
if (isLocked) { if (data.has_max_level) {
option.textContent = `${text} — (Μέγιστο Επίπεδο)`;
option.style.color = '#33aa33';
} else if (isLocked) {
option.textContent = `${text} — 🔒 Κλειδωμένο (Προϋποθέσεις)`; option.textContent = `${text} — 🔒 Κλειδωμένο (Προϋποθέσεις)`;
option.style.color = '#ff4444'; // Red as requested option.style.color = '#ff4444'; // Red as requested
} else if (data.can_upgrade === true) { } else if (data.can_upgrade === true) {