Update lib

This commit is contained in:
Kai Vogelgesang 2020-07-07 00:58:47 +02:00
parent 4afa3e68d1
commit 5ac9658c3a

View File

@ -21,6 +21,10 @@ state = (function ()
})
end)()
if state.x == nil or state.y == nil or state.z == nil or state.o == nil then
print("[WARNING] position is not set")
end
--[[
orientation:
0 = South (+z)
@ -45,7 +49,7 @@ return {
fwd = move(turtle.forward, function()
if state.o == 1 or state.o == 3 then
state.x = state.x + ((state.o == 1) and -1 or 1)
else
elseif state.o == 0 or state.o == 2 then
state.z = state.z + ((state.o == 2) and -1 or 1)
end
end),
@ -53,7 +57,7 @@ return {
back = move(turtle.back, function()
if state.o == 1 or state.o == 3 then
state.x = state.x + ((state.o == 1 and 1 or -1))
else
elseif state.o == 0 or state.o == 2 then
state.z = state.z + ((state.o == 2) and 1 or -1)
end
end),