From 118a692b3af8064f92448900aae4885af81ad659 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Fri, 7 May 2021 16:00:38 -0500 Subject: [PATCH] Added a move here action. --- minehost.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/minehost.lua b/minehost.lua index 87b2cc1..704cdfa 100644 --- a/minehost.lua +++ b/minehost.lua @@ -19,6 +19,8 @@ local HEADING = "heading" local QUARRYCHUNK = "quarry" local TASK = "task" local FAILED = "failed" +-- Constant local actions +local MOVEHERE = "movehere" -- Constant messsage types local LOG = "LOG" local REQUEST = "REQ" @@ -86,6 +88,10 @@ local function listenForCommands() sendDirective(LEADER, HEADING) elseif string.find(input, QUARRYCHUNK) == 1 then sendDirective(LEADER, input) + elseif string.find(input, MOVEHERE) == 1 then + local x,y,z = gps.locate() + y = y + 1 + sendDirective(LEADER, MOVETO, x, y, z) end end end