From 766f72171d7194fe2d94fd2a6de09ed8d5a1a743 Mon Sep 17 00:00:00 2001 From: Dominic Zimmer Date: Mon, 6 Jul 2020 00:58:42 +0200 Subject: [PATCH] Fix? --- dominic/canemine.lua | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/dominic/canemine.lua b/dominic/canemine.lua index 7de921b..f26b5b5 100644 --- a/dominic/canemine.lua +++ b/dominic/canemine.lua @@ -1,5 +1,5 @@ args = {...} -status = { +turtlestatus = { name = os.getComputerLabel(), id = os.getComputerID(), fuel = "", @@ -348,51 +348,51 @@ function emptyToBarrel() end function drawStatus() - print("Turtle ("..status["id"]..")") + print("Turtle ("..turtlestatus["id"]..")") print() - print(" \""..status["name"].."\"") + print(" \""..turtlestatus["name"].."\"") print() print() - if status["job"] then - print("Current job: "..tostring(status["job"])) + if turtlestatus["job"] then + print("Current job: "..tostring(turtlestatus["job"])) else print("Current job: ") end print() - if status["job"] then - print("Last job fuel consumption: "..tostring(status["fuel"])) + if turtlestatus["job"] then + print("Last job fuel consumption: "..tostring(turtlestatus["fuel"])) else print("Last job fuel consumption: ") end print() print("Status:") - print(" "..status["state"]) + print(" "..turtlestatus["state"]) print() print() end while true do - status["state"] = "Waiting for job..." + turtlestatus["state"] = "Waiting for job..." drawStatus() thejob = waitForJob() - --status["job"] = thejob - status["state"] = "Refueling..." + turtlestatus["job"] = thejob + turtlestatus["state"] = "Refueling..." drawStatus() doRefuel() fuel = turtle.getFuelLevel() - status["state"] = "Headed to the jobsite..." + turtlestatus["state"] = "Headed to the jobsite..." drawStatus() goToJob() x, z = ithSpot(thejob) digTo(x,z) - status["state"] = "Digging the Shaft..." + turtlestatus["state"] = "Digging the Shaft..." drawStatus() digShaft() - status["state"] = "Returning to the station..." + turtlestatus["state"] = "Returning to the station..." drawStatus() goToSpawn(x, z) path = math.floor(math.random() + 0.5) - status["state"] = "Unloading Inventory..." + turtlestatus["state"] = "Unloading Inventory..." drawStatus() goToBarrel(path) emptyToBarrel() @@ -400,12 +400,12 @@ while true do fuelconsumed = fuel - turtle.getFuelLevel() --print("I consumed "..tostring(fuelconsumed).." fuel") --print("Reporting Duty") - status["fuel"] = fuelconsumed - status["state"] = "Reporting duty..." + turtlestatus["fuel"] = fuelconsumed + turtlestatus["state"] = "Reporting duty..." drawStatus() reportDuty(thejob, fuelconsumed) - status["job"] = nil - status["state"] = "Going back in line..." + turtlestatus["job"] = nil + turtlestatus["state"] = "Going back in line..." drawStatus() enqueueTurtle() end