12 posts
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.
8543 posts
Posted 15 March 2015 - 01:08 AM
Moved to Ask a Pro.
12 posts
Posted 15 March 2015 - 01:23 AM
Moved to Ask a Pro.
thanks, sorry im quite new.
1023 posts
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
12 posts
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??
7083 posts
Location
Tasmania (AU)
Posted 15 March 2015 - 01:57 AM
12 posts
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..