Jump to content




Simple Mining Turtle /Need help/

turtle lua

  • You cannot reply to this topic
4 replies to this topic

#1 BlubiRub

  • New Members
  • 1 posts

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

#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

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.

#3 Exerro

  • Members
  • 801 posts

Posted 19 January 2015 - 05:15 PM

Line 29 missing parentheses.
Line 32 missing "do".

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 19 January 2015 - 06:07 PM

Moved to Ask a Pro.

#5 johnneijzen

  • Members
  • 40 posts
  • LocationPhilippines

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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users