1
0
mirror of https://github.com/LDDestroier/CC/ synced 2025-02-07 14:40:03 +00:00

Update cubedig.lua

This commit is contained in:
LDDestroier 2019-04-24 22:44:45 -04:00 committed by GitHub
parent 98fa79a9e9
commit d4ad8243d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,11 +94,27 @@ local printData = function()
print("Fuel: " .. turtle.getFuelLevel())
end
local UDdig = function(left, check, right)
dig( 0 )
if check > left then
dig( -1 )
end
if check < right then
dig ( 1 )
end
end
local doTurn = true
for y = 1, math.abs(dy) do
if dy > 1 then
move( "up" )
elseif dy < 1 then
move( "down" )
end
for y = (math.abs(dy) > 1 and 2 or 1), math.abs(dy) do
if y % 3 == 1 then
for x = 1, dx do
for z = 1, dz do
dig( 0 )
UDdig(dy / math.abs(dy), y * (dy / math.abs(dy)), dy)
move( "forward" )
printData()
end
@ -108,6 +124,7 @@ for y = 1, math.abs(dy) do
doTurn = not doTurn
end
end
end
if y ~= math.abs(dy) then
if dy > 0 then
dig( 1 )