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

Basic Turtle Mining(Help)

Started by PublicSaix, 14 March 2015 - 11:58 PM
PublicSaix #1
Posted 15 March 2015 - 12:58 AM
1.) program - branch ( bios: 366: [string "branch"] :9: '='
expected

function digIt()
while turtle.detect() do
turtle.dig()
os.sleep(0.5)
end

turtle.forward()
while turtle.detectDown() or turtle.detectUp() do
turtle.digUp
turtle.digDown
end
end —————note this isnt the full prog just where the
error is located


2.) program - 3tunnel branch (bios :366: [strin "3tunnel"] :9: 'do' expected


function digIt()
while turtle.detect() do
turtle.dig()
os.sleep(0.5)
end

turtle.forward()
while turtle.detectDown() or turtle.detectUp() do
turtle.digUp()
turtle.digDown()
end
end ——————-again not this isnt the full
just where the error is location


Any help would be much appreciated - PublicSaix.
Lyqyd #2
Posted 15 March 2015 - 01:08 AM
Moved to Ask a Pro.
PublicSaix #3
Posted 15 March 2015 - 01:23 AM
Moved to Ask a Pro.
thanks, sorry im quite new.
valithor #4
Posted 15 March 2015 - 01:30 AM
You missed a few () when calling the functions turtle.digUp and turtle.digDown. Putting those there should fix your problem.

The solution

function digIt()
  while turtle.detect() do
	turtle.dig()
	os.sleep(0.5)
  end

  turtle.forward()
  while turtle.detectDown() or turtle.detectUp() do
	turtle.digUp() --here
	turtle.digDown() --and here
  end
end ---------------note this isnt the full prog just where the
error is located
Edited on 15 March 2015 - 12:31 AM
PublicSaix #5
Posted 15 March 2015 - 01:47 AM
You missed a few () when calling the functions turtle.digUp and turtle.digDown. Putting those there should fix your problem.

The solution

function digIt()
  while turtle.detect() do
	turtle.dig()
	os.sleep(0.5)
  end

  turtle.forward()
  while turtle.detectDown() or turtle.detectUp() do
	turtle.digUp() --here
	turtle.digDown() --and here
  end
end ---------------note this isnt the full prog just where the
error is located

everything works now except whenever i start it says branch length (of course) then i type in lets say 15
it will mine the block in front and then say "branch:7: attempt to call nil" —- now im no expert in lua so im not sure what most of the errors mean.

You missed a few () when calling the functions turtle.digUp and turtle.digDown. Putting those there should fix your problem.

The solution

function digIt()
  while turtle.detect() do
	turtle.dig()
	os.sleep(0.5)
  end

  turtle.forward()
  while turtle.detectDown() or turtle.detectUp() do
	turtle.digUp() --here
	turtle.digDown() --and here
  end
end ---------------note this isnt the full prog just where the
error is located
also is there a fix for the second program??
Bomb Bloke #6
Posted 15 March 2015 - 01:57 AM
now im no expert in lua so im not sure what most of the errors mean.

http://www.computercraft.info/forums2/index.php?/topic/14531-read-this-post-before-asking-questions/
PublicSaix #7
Posted 15 March 2015 - 02:14 AM
now im no expert in lua so im not sure what most of the errors mean.

http://www.computerc...king-questions/
thanks man i got it all figured out… i misspelled turtle.forward as turtle.foward..