Added a move here action.

This commit is contained in:
Harrison Deng 2021-05-07 16:00:38 -05:00
parent 1bdc320818
commit 118a692b3a

View File

@ -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