fix 1
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user