From 7e8e495ee2e5245316f657af4adb1295f2e8daf9 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 8 Jan 2023 18:19:16 +0000 Subject: [PATCH] Update 'Turtle/Wheat.lua' --- Turtle/Wheat.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Turtle/Wheat.lua b/Turtle/Wheat.lua index 6831013..3e25212 100644 --- a/Turtle/Wheat.lua +++ b/Turtle/Wheat.lua @@ -134,4 +134,28 @@ function Wheat:createMatrix() end end end +end + +function Wheat:clearInv(goBack) + if (goBack == nil) then goBack = true end + if(goBack == true) then + goBack = {self.x, self.y, self.z, self.dir} + end + if (self:isInInv("seed", true)) then + self:moveTo("seedChest") + self:dropItemsDown("seed", false) + end + if (self:isInInv("coal", false)) then + self:moveTo("coalChest") + self:dropItemsDown("coal", false) + end + if (self:isInvEmpty(true) == false) then + self:moveTo("outputChest") + self:dropItemsDown("any", false) + end + + if (goBack ~= false) then + self:log("moving to goBack") + self:moveTo(goBack) + end end \ No newline at end of file