Posted 16 September 2013 - 02:46 AM
Title: Mining program not working… need help I'm pretty new to computer craft and I'm also quite new to coding, but I tried to write a program anyway. What is meant to happen is that the turtle is supposed to dig a 2x2 tunnel for 100 blocks, then place a chest (in slot 1 of the turtle) down and empty all of the loot into the chest. Here's the program:
This is a weird problem, because line 45 is: turtle.digUp(). I haven't managed to find any other problems because I don't
know how to fix this one.
If anyone can see a problem in my code, either by looking at it on this post, or opening it in a turtle and figuring out the problem, please respond with a suggestion or a new code to do the same thing I want done.
Thanks in advance! WRKAQARG, away!
function there()
for i=1,10,1 do
turtle.dig()
turtle.forward()
turtle.digUp()
end
end
function mineBack()
for i=1,99,1 do
turtle.dig()
turtle.forward()
turtle.digUp()
end
end
function back()
if true then
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.turnRight()
if true do
mineBack()
end
end
end
while turtle.getItemCount(1) > 0 do
there()
back()
turtle.dig()
turtle.select(1)
turtle.forward()
turtle.digUp()
turtle.back()
turtle.place()
for i=2,16,1 do
turtle.drop()
end
turtle.turnRight()
for i=1,3,1 do
turtle.dig()
turtle.forward() --#This is line 45
turtle.digUp()
end
turtle.turnRight()
end
The problem it's giving me is: bios:337: [string "Mine"]:45:'=' expectedThis is a weird problem, because line 45 is: turtle.digUp(). I haven't managed to find any other problems because I don't
know how to fix this one.
If anyone can see a problem in my code, either by looking at it on this post, or opening it in a turtle and figuring out the problem, please respond with a suggestion or a new code to do the same thing I want done.
Thanks in advance! WRKAQARG, away!
Edited by