This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
BlubiRub's profile picture

Simple Mining Turtle /Need help/

Started by BlubiRub, 19 January 2015 - 04:11 AM
BlubiRub #1
Posted 19 January 2015 - 05:11 AM
Hello everybody

I'm pretty new in the ComputerCraft mod and jsut getting started. I watched some videos and guides before i started to write my first programm which shall simple stripmine for me. I dont realy know anyhow about how to fix the error, for me, the program seems fine. I would be pleasured if you could help my out!

Here the pastebin link for my program: http://pastebin.com/xHgkj1Ez
KingofGamesYami #2
Posted 19 January 2015 - 01:32 PM
Please post the error, as it includes valuable information such as the line number. I looked over you code quickly, nothing stood out as being blatantly wrong.
Exerro #3
Posted 19 January 2015 - 05:15 PM
Line 29 missing parentheses.
Line 32 missing "do".
Lyqyd #4
Posted 19 January 2015 - 06:07 PM
Moved to Ask a Pro.
johnneijzen #5
Posted 29 January 2015 - 01:48 PM
I have fixed 2 errors and change while to if just to make more compact


function mine()
    turtle.dig()
    os.sleep(0.5)
    if turtle.detect() then
	    turtle.dig()
	    os.sleep(0.5)
    end
    turtle.forward()
    turtle.digDown()
    turtle.digUp()
    os.sleep(0.5)
    if turtle.detectUp() then
	    turtle.digUp()
	    os.sleep(0.5)
    end
end

function chest()
    turtle.turnRight()
    turtle.forward()
    turtle.select(16)
    turtle.place()
    for k=1,15 do
	    turtle.select(k)
	    turtle.drop()
    end
    turtle.turnRight()
    turtle.turnRight()
    turtle.forward()
end

for j=1,3 do
    mine()
    turtle.turnRight()
    for i=1,10 do
	    mine()
    end
    for i=1,10 do
	    turtle.forward()
    end
    for i=1,10 do
	    mine()
    end
    for i=1,10 do
	    turtle.forward()
    end
    chest()
    turtle.forward()
end