Posted 03 January 2013 - 06:43 AM
hi there i realy new to programing and i made my first tunneling program i did this becase i got sick of diging 100 blocks around lava to retrive my turtle =P
this is my program so far, sorry if it messy codeing but i am new =P
"
print ("How Long?")
digdig = io.read()
x = 0
y = tonumber(digdig)
while x < y do
while not turtle.forward() do
turtle.dig()
end
while turtle.detectUp() do
turtle.digUp()
end
x = x + 1
end
x = 1
turtle.turnLeft()
while not turtle.forward() do
turtle.dig()
end
turtle.turnLeft()
while turtle.detectUp() do
turtle.digUp()
end
while x < y do
while not turtle.forward() do
turtle.dig()
end
while turtle.detectUp() do
turtle.digUp()
end
x = x + 1
end
turtle.turnLeft()
turtle.turnLeft()
print("All Done")
"
and i tryign to figer out how to get it to place a tourch every 5 blocks, i know thats over kill but i like tourchs =P
all i can think of is somethign like
if x == 5 or 10 or 15 then
turtle.select(1)
turtle.placeUp()
end
but ofc thats going to limit the program to 15 blocks (that bit of codes probs wrong i know you can do somthign like that)
also i think my io.read bit could be smaller i think its
y = tonumber(oi.read())
this is my program so far, sorry if it messy codeing but i am new =P
"
print ("How Long?")
digdig = io.read()
x = 0
y = tonumber(digdig)
while x < y do
while not turtle.forward() do
turtle.dig()
end
while turtle.detectUp() do
turtle.digUp()
end
x = x + 1
end
x = 1
turtle.turnLeft()
while not turtle.forward() do
turtle.dig()
end
turtle.turnLeft()
while turtle.detectUp() do
turtle.digUp()
end
while x < y do
while not turtle.forward() do
turtle.dig()
end
while turtle.detectUp() do
turtle.digUp()
end
x = x + 1
end
turtle.turnLeft()
turtle.turnLeft()
print("All Done")
"
and i tryign to figer out how to get it to place a tourch every 5 blocks, i know thats over kill but i like tourchs =P
all i can think of is somethign like
if x == 5 or 10 or 15 then
turtle.select(1)
turtle.placeUp()
end
but ofc thats going to limit the program to 15 blocks (that bit of codes probs wrong i know you can do somthign like that)
also i think my io.read bit could be smaller i think its
y = tonumber(oi.read())