From c34fbb6ab467fe6124d34fbcbfae3db7cc16acd7 Mon Sep 17 00:00:00 2001 From: haunter Date: Mon, 20 Apr 2026 19:40:33 +0300 Subject: [PATCH] fix 1 --- GrepolisRemoteControl.user.js | 9 +++++---- static/js/components/commandForm.js | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/GrepolisRemoteControl.user.js b/GrepolisRemoteControl.user.js index 95da23b..b8b7585 100644 --- a/GrepolisRemoteControl.user.js +++ b/GrepolisRemoteControl.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Grepolis Remote Control // @namespace http://tampermonkey.net/ -// @version 1.9 +// @version 2.0 // @description Polls grepo.haunter-pets.top for remote commands and executes them in-game // @author Dimitrios // @match https://*.grepolis.com/game/* @@ -110,7 +110,8 @@ build_time: buildDataRaw[k].building_time || '', can_upgrade: !!buildDataRaw[k].can_upgrade, 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) { @@ -248,10 +249,10 @@ const res = town.resources(); const { resources_for, population_for } = buildData; 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) { - return { ok: false, msg: `Not enough resources for ${building_id}` }; + return { ok: false, requeue: true, msg: `Not enough resources for ${building_id}` }; } } } catch (e) { diff --git a/static/js/components/commandForm.js b/static/js/components/commandForm.js index 787379b..620cd51 100644 --- a/static/js/components/commandForm.js +++ b/static/js/components/commandForm.js @@ -43,7 +43,10 @@ window.renderBuildingDropdown = function() { const option = document.createElement('option'); option.value = key; - if (isLocked) { + if (data.has_max_level) { + option.textContent = `${text} — (Μέγιστο Επίπεδο)`; + option.style.color = '#33aa33'; + } else if (isLocked) { option.textContent = `${text} — 🔒 Κλειδωμένο (Προϋποθέσεις)`; option.style.color = '#ff4444'; // Red as requested } else if (data.can_upgrade === true) {