From 308b6a7fe281296551e0dbdfa4abfecd0a211b7f Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Mon, 3 May 2021 15:44:31 -0500 Subject: [PATCH] Fixed nil value error when requesting status. --- mineleader.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mineleader.lua b/mineleader.lua index b9128e3..020d672 100644 --- a/mineleader.lua +++ b/mineleader.lua @@ -384,10 +384,10 @@ local function listen() fuel=turtle.getFuelLevel(), task=(task and task["name"] or "nothing") } - sendLog(STATUS, "Relative position: " .. textutils.serializeJSON(data["content"][1]["relative_position"]) .. - "\nPosition: " .. (data["content"][1]["position"]["coordinates"] and textutils.serialiseJSON(data["content"][1]["position"]) or "not positioned.") .. - "\nfuel: " .. tostring(data["content"][1]["fuel"]) .. - "\ncurrent task: " .. data["content"][1]["task"], status) + sendLog(STATUS, "Relative position: " .. textutils.serializeJSON(status["relative_position"]) .. + "\nPosition: " .. (status["position"]["coordinates"] and textutils.serialiseJSON(status["position"]) or "not positioned.") .. + "\nfuel: " .. tostring(status["fuel"]) .. + "\ncurrent task: " .. status["task"], status) elseif data["request"] == POSITION then locatePosition() elseif data["request"] == HEADING then