This commit is contained in:
Julian Brammer 2024-06-23 19:41:06 +02:00
parent d62226bafb
commit fdee19b4db

View File

@ -58,7 +58,7 @@ end
local function forward() local function forward()
if turtle.forward() then if turtle.forward() then
pos = getPos() pos = getPos()
sleep(1) sleep(0.2)
if pos["r"] == 0 then if pos["r"] == 0 then
pos["z"] = pos["z"] + 1 pos["z"] = pos["z"] + 1
elseif pos["r"] == 1 then elseif pos["r"] == 1 then
@ -73,7 +73,7 @@ local function forward()
end end
local function back() local function back()
sleep(1) sleep(0.2)
if turtle.back() then if turtle.back() then
if pos["r"] == 0 then if pos["r"] == 0 then
pos["z"] = pos["z"] - 1 pos["z"] = pos["z"] - 1
@ -89,7 +89,7 @@ local function back()
end end
local function up() local function up()
sleep(1) sleep(0.2)
if turtle.up() then if turtle.up() then
pos["y"] = pos["y"] + 1 pos["y"] = pos["y"] + 1
savePos() savePos()
@ -97,7 +97,7 @@ local function up()
end end
local function down() local function down()
sleep(1) sleep(0.2)
if turtle.down() then if turtle.down() then
pos["y"] = pos["y"] - 1 pos["y"] = pos["y"] - 1
savePos() savePos()
@ -105,7 +105,7 @@ local function down()
end end
local function left() local function left()
sleep(1) sleep(0.2)
if turtle.turnLeft() then if turtle.turnLeft() then
pos["r"] = (pos["r"]-1) % 4 pos["r"] = (pos["r"]-1) % 4
savePos() savePos()
@ -113,7 +113,7 @@ local function left()
end end
local function right() local function right()
sleep(1) sleep(0.2)
if turtle.turnRight() then if turtle.turnRight() then
pos["r"] = (pos["r"]+1) % 4 pos["r"] = (pos["r"]+1) % 4
savePos() savePos()