Posted 28 March 2013 - 06:28 AM
So this is my first attempt at making a program for my turtle. I plan on making a Cylinder but for now i'm starting with a circle for now until i get everything working but i'm stuck here I can't seem to figure out whats wrong. This is what I have got so far
Code
And a screen shot
Code
Spoiler
if turtle.getFuelLevel() < 1000 then
turtle.select(16)
turtle.refuel(64)
end
function AntiObstruct()
if turtle.detectDown() then
turtle.digDown()
end
end
function PlaceBlock()
turtle.placeDown()
turtle.forward()
end
function roundCorner()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
end
function BuildCylinder()
local BuildLength = 0
local getItem = tonumber(turtle.getItemCount(1))
if (getItem < 1) then
print("Place materials in slot 1 to start building.")
else
turtle.select(1)
end
if (BuildLength < 10) then
AntiObstruct()
PlaceBlock()
BuildLength = BuildLength + 1
else
roundCorner()
BuildLength = BuildLength - 10
end
if (BuildLength < 2) then
AntiObstruct()
PlaceBlock()
BuildLength = BuildLength + 1
else
roundCorner()
BuildLength = BuildLength - 2
end
if (BuildLength < 1) then
AntiObstruct()
PlaceBlock()
BuildLength = BuildLength + 1
else
roundCorner()
BuildLength = BuildLength - 1
end
if (BuildLength < 2) then
AntiObstruct()
PlaceBlock()
BuildLength = BuildLength + 1
else
roundCorner()
BuildLength = BuildLength - 2
end
if (BuildLength < 10) then
AntiObstruct()
PlaceBlock()
BuildLength = BuildLength + 1
else
roundCorner()
BuildLength = BuildLength - 10
end
end
term.clear()
BuildCylinder()
end
end
And a screen shot