Posted 22 March 2013 - 11:25 AM
Hello :D/> i made an excavate program(NOT DONE!) to dig out a specified area but on the for loop on rown 39 i keep getting an error.
NOTE: I FIXED IT :D/>
Please help D;
NOTE: I FIXED IT :D/>
size=0
deep=0
function getInfo()
term.clear()
term.setCursorPos(1,1)
print("What size?")
size=read()
if size<= 4 then
print("Please use a number greater than 4")
getInfo()
end
size = math.ceil(size)
if size % 2 == 1 then
print("Please use a number divisible by 2")
getInfo()
end
term.clear()
term.setCursorPos(1,1)
print("How deep?")
deep=read()
end
getInfo()
term.clear()
term.setCursorPos(1,1)
print("Excavating a "..size.." x "..size.." x "..deep.." area.")
temp=read()
function refuel()
if turtle.getFuelLevel()< 50 then
turtle.select(1)
while turtle.refuel() == false do
print("I am out o fuel! Feed it in slot 1 and press enter")
temp = read()
end
end
end
function forw(times)
for 1, times do
turtle.dig()
refuel()
turtle.forward()
end
end
function left(times)
for 1, times do
turtle.turnLeft()
refuel()
end
end
function right(times)
for 1, times do
turtle.turnRight()
refuel()
end
end
for 1, size/2 - 1 do
forw(size-1)
left(1)
forw(1)
left(1)
end
Please help D;