Posted 10 December 2016 - 12:45 AM
--mineShaft
--V0.1
--Prompt for area
print("Distance Forward: (Blank for 16)")
vGoalF = tonumber(read())
if vGoalF == nil then vGoalF = 16 end
print("Distance Right: (Blank for 16)")
vGoalR = tonumber(read())
if vGoalR == nil then vGoalR = 16 end
print(vGoalF*vGoalR*2.." total blocks will be destroyed.")
function forward()
vTravelF = 0
while vGoalF > vTravelF do
if turtle.forward() then vTravelF = vTravelF + 1
else turtle.dig() turtle.suck() turtle.forward()
vTravelF = vTravelF + 1
end
if turtle.up() then
else turtle.digUp() turtle.suckUp() turtle.up()
end
if turtle.forward() then vTravelF = vTravelF + 1
else turtle.dig() turtle.suck() turtle.forward()
vTravelF = vTravelF + 1
end
if turtle.down() then
else turtle.digDown() turtle.suckDown() turtle.down()
end
end
end --forward()
vTravelR = 0
while vGoalR > vTravelR do
forward()
vTravelR = (vTravelR + 1)
turtle.turnRight()
turtle.turnRight()
forward()
vTravelR = (vTravelR + 1)
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end
--
My lines
vTravelR = (vTravelR + 1)
used to be
vTravel = (vTravelR + 1)
and it was causing a logic error. Changing it to vTravelR caused the "multiple points" error.I'm relatively new to ComputerCraft, but I've done quite a bit of messing around on my own. I'm stumped on this, and I don't see anything wrong with it. Anyone able to shed some light on it?