Posted 18 January 2014 - 02:18 AM
Oh, oh late night writing. Anyways. I made this bit of code to clear out a platform 1 thick, with the specified length and width. The problem is, though, when I make the width an odd number, the turtle ends on the opposte end of where it started. It's stupposed to end up on the right-most block (width) on the same side it started on.
local tArgs = {...}
x=0
if tArgs ~=2 then
l=tonumber(tArgs[1])
w=tonumber(tArgs[2])
for i=1,w do
for i=1,l do
turtle.dig()
turtle.forward()
end
if x%2==0 then
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
elseif x%2==1 then
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
end
x=x+1
if x==w then
abort()
end
end
else
abort()
end