Posted 03 August 2014 - 07:06 PM
i wrote this program to tunnel and create a strip shaft. worked perfectly until it didn't. i have torches in box one, chests in box 2, and gravel in box 3. i was working on a way to mine gravel with out it offsetting the turtle. now when i run the program it just says "For input string: "3x3" (3x3 is the name of the program)
function doubleTap()
turtle.select(3)
while turtle.detect() do
if turtle.compare()then
sleep(2)
end
turtle.dig()
end
end
————————————–
local x=100
local counter = 0
local w=0
——————————–
turtle.turnLeft()
doubleTap()
turtle.forward()
turtle.turnRight()
turtle.select(1)
while counter < x do
if turtle.getItemCount(2) < 2 then
print("refill me slave")
read()
end
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()3x3
————————
w=w+2
if w>30 then
w=0
turtle.select(2)
turtle.placeDown(1)
for i=4,16 do
turtle.select(i)
turtle.dropDown(64)
end
end
————————
turtle.turnRight()
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
———————–
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.select(1)
turtle.placeDown(1)
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnRight()
counter = counter+2
term.clear()
term.setCursorPos(1,1)
print("On "..counter.." out of "..x)
end
function doubleTap()
turtle.select(3)
while turtle.detect() do
if turtle.compare()then
sleep(2)
end
turtle.dig()
end
end
————————————–
local x=100
local counter = 0
local w=0
——————————–
turtle.turnLeft()
doubleTap()
turtle.forward()
turtle.turnRight()
turtle.select(1)
while counter < x do
if turtle.getItemCount(2) < 2 then
print("refill me slave")
read()
end
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()3x3
————————
w=w+2
if w>30 then
w=0
turtle.select(2)
turtle.placeDown(1)
for i=4,16 do
turtle.select(i)
turtle.dropDown(64)
end
end
————————
turtle.turnRight()
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
———————–
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.select(1)
turtle.placeDown(1)
doubleTap()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnRight()
counter = counter+2
term.clear()
term.setCursorPos(1,1)
print("On "..counter.." out of "..x)
end