From ba79ab2e5e02620a0cf8fc87ebaa16992cf8b558 Mon Sep 17 00:00:00 2001 From: Matt Wagner Date: Fri, 6 Aug 2021 11:37:24 -0700 Subject: [PATCH] Update planet triggers for recent planet AI change --- mfile | 2 +- src/triggers/galaxy-map/planets-line.lua | 4 ++-- src/triggers/galaxy-map/system-line.lua | 4 +++- src/triggers/galaxy-map/triggers.json | 14 +++++++------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/mfile b/mfile index eaa9d83..19de2a4 100644 --- a/mfile +++ b/mfile @@ -1,4 +1,4 @@ { "package": "lotj-ui", - "version": "v2.1.1" + "version": "v2.1.2" } \ No newline at end of file diff --git a/src/triggers/galaxy-map/planets-line.lua b/src/triggers/galaxy-map/planets-line.lua index cee6cff..5817378 100644 --- a/src/triggers/galaxy-map/planets-line.lua +++ b/src/triggers/galaxy-map/planets-line.lua @@ -13,10 +13,10 @@ end line = line:gsub("%(UFG%)", "") line = line:gsub(" +", ";") -local startIdx, _, planet, system, gov, support = line:find("([^;]+);([^;]+);([^;]+);([^;]+)") +local startIdx, _, planet, system, gov, support, military = line:find("([^;]+);([^;]+);([^;]+);([^;]+);([^;]+)") if not startIdx then gov = "None" - startIdx, _, planet, system, support = line:find("([^;]+);([^;]+);([^;]+)") + startIdx, _, planet, system, support, military = line:find("([^;]+);([^;]+);([^;]+);([^;]+)") end if not startIdx then echo("\n") diff --git a/src/triggers/galaxy-map/system-line.lua b/src/triggers/galaxy-map/system-line.lua index f90c9b4..bb09677 100644 --- a/src/triggers/galaxy-map/system-line.lua +++ b/src/triggers/galaxy-map/system-line.lua @@ -2,7 +2,9 @@ local systemName = matches[2]:match "^%s*(.-)%s*$" local xCoord = tonumber(matches[3]) local yCoord = tonumber(matches[4]) -lotj.galaxyMap.recordSystem(systemName, xCoord, yCoord) +if xCoord >= -100 and xCoord <= 100 and yCoord >= -100 and yCoord <= 100 then + lotj.galaxyMap.recordSystem(systemName, xCoord, yCoord) +end setTriggerStayOpen("gather-starsystems", 1) deleteLine() diff --git a/src/triggers/galaxy-map/triggers.json b/src/triggers/galaxy-map/triggers.json index 16ccc0d..815d112 100644 --- a/src/triggers/galaxy-map/triggers.json +++ b/src/triggers/galaxy-map/triggers.json @@ -9,7 +9,7 @@ "fireLength": 1, "patterns": [ { - "pattern": "Planet\\s+Starsystem\\s+Governed By\\s+Popular Support", + "pattern": "Planet\\s+Starsystem\\s+Governed By\\s+Opinion\\s+Military", "type": "regex" } ], @@ -36,8 +36,8 @@ "type": "substring" }, { - "pattern": "--Planet Data: -------------------------------", - "type": "substring" + "pattern": "--Planet Data: -+", + "type": "regex" } ], "children": [ @@ -84,8 +84,8 @@ "name": "planet-description-hdr", "patterns": [ { - "pattern": "--Planetary Information: ---------------------", - "type": "substring" + "pattern": "--General Details: -+", + "type": "regex" } ], "script": "gatherPlanetState.section = \"description\"" @@ -94,8 +94,8 @@ "name": "planet-resources-hdr", "patterns": [ { - "pattern": "--Planetary Resources: -----------------------", - "type": "substring" + "pattern": "--Planetary Resources: -+", + "type": "regex" } ], "script": "gatherPlanetState.section = \"resources-basic\""