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)
|
function answer(message, id)
|
||||||
sleep(0.1)
|
sleep(0.1)
|
||||||
rednet.send(id, message, "received")
|
rednet.send(id, message, "received")
|
||||||
|
sleep(0.1)
|
||||||
if(message == "init") then
|
if(message == "init") then
|
||||||
tree:readConfig(path)
|
tree:readConfig(path)
|
||||||
tree:autoHome()
|
tree:autoHome()
|
||||||
@ -24,6 +25,13 @@ function answer(message, id)
|
|||||||
elseif(message == "cutTree") then
|
elseif(message == "cutTree") then
|
||||||
tree:cutTree()
|
tree:cutTree()
|
||||||
rednet.send(id, "cut finished", "confirm")
|
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
|
end
|
||||||
rednet.send(id, "could not resolve message", "error")
|
rednet.send(id, "could not resolve message", "error")
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user