Update 'turtle/woodDaemon.lua'
This commit is contained in:
parent
0e3fc3182c
commit
c7b811bcad
@ -12,6 +12,7 @@ local tree = Wood:new()
|
||||
function answer(message, id)
|
||||
sleep(0.1)
|
||||
rednet.send(id, message, "received")
|
||||
sleep(0.1)
|
||||
if(message == "init") then
|
||||
tree:readConfig(path)
|
||||
tree:autoHome()
|
||||
@ -24,6 +25,13 @@ function answer(message, id)
|
||||
elseif(message == "cutTree") then
|
||||
tree:cutTree()
|
||||
rednet.send(id, "cut finished", "confirm")
|
||||
elseif(message == "sort") then
|
||||
local hasMore = tree:sort()
|
||||
if hasMore then
|
||||
rednet.send(id, "sort finished, more in chest", "confirm")
|
||||
else
|
||||
rednet.send(id, "sort finished, chest empty", "confirm")
|
||||
end
|
||||
end
|
||||
rednet.send(id, "could not resolve message", "error")
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user