From 71d24820ed17a5a903c2aa2653e12b2d6ab977c4 Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Tue, 12 Sep 2023 14:11:57 -0400 Subject: [PATCH] Fixed bugs --- router.lua | 4 ++++ station.lua | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/router.lua b/router.lua index f36f60a..7b9be03 100644 --- a/router.lua +++ b/router.lua @@ -131,6 +131,7 @@ local function handleNearbyStation() end -- Either wait for the user to choose a route, or go away from the -- station transponder. + local routeChosen = false parallel.waitForAny( function () while true do @@ -141,6 +142,7 @@ local function handleNearbyStation() elseif y > 1 and y - 1 <= #routes then local selectedRoute = routes[y-1] os.queueEvent("rail_route_selected", selectedRoute) + routeChosen = true return end end @@ -148,6 +150,8 @@ local function handleNearbyStation() end, function () waitForNoStation(name) end ) + -- Quit our main loop if the user has chosen a route. + if routeChosen then return end end end end diff --git a/station.lua b/station.lua index a1e2512..8b3cd36 100644 --- a/station.lua +++ b/station.lua @@ -4,7 +4,8 @@ particular route to another station. You should add a "station_config.tbl" file containing: { - name = "Station name", + name = "stationname", + displayName = "Station Name", range = 8, routes = { {name = "First", path = {"A", "B", "C"}}, @@ -50,6 +51,7 @@ local config = readConfig() term.clear() term.setCursorPos(1, 1) print("Running station transponder for \""..config.name.."\".") +print(" Display Name: "..config.displayName) print(" Range: "..config.range.." blocks") print(" Routes:") for i, route in pairs(config.routes) do