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

Turtle.select(1) not working

Started by Plasma_Energy, 08 December 2014 - 10:03 PM
Plasma_Energy #1
Posted 08 December 2014 - 11:03 PM
Hi there!
I am a new programmer of turtles and I've done some code lines and there is this annoying message that pop off everytime I want to run the code:

bios:366: [string "tunnel"]:36: ´=´ expected

(which is the line where I wrote turtle.select(1))
And here is the code lines that I verified without finding the error:


function dig()

turtle.dig()

turtle.forward()

turtle.digDown()

end

function walk()
if turtle.detect() then
turtle.dig()

turtle.attack()
else

turtle.forward()
end
end

local run = 0

term.write("Lenght (max = 200): ")
run = read()


for i = 0, run do

dig()

j = turtle.getItemCount(16)

k = turtle.getItemCount()

l = k - j
h = l / 2
g = h / 10
if g == 1 then
turtle.select(16)
turtle.placeDown()
for i = 1, run do
if turtle.detectUp then
turtle.up
turtle.select(1)
turtle.drop()
for i = 0, run do
turtle.forward
else
turtle.back()
end
end
end
end


turtle.turnRight()
turtle.turnRight()

for i = 0, run do
walk()
end

turtle.digUp()
turtle.up()
end

P.S. my version is 1.6
Lyqyd #2
Posted 08 December 2014 - 11:25 PM
This error is covered under the Common Errors section of the Read This Before Asking Questions sticky post; you've forgotten the parentheses on the previous line. Change it to turtle.up().
Dragon53535 #3
Posted 09 December 2014 - 12:10 AM
This error is covered under the Common Errors section of the Read This Before Asking Questions sticky post; you've forgotten the parentheses on the previous line. Change it to turtle.up().
And the turtle.forward a few lines town down…

I'm getting real tired of my fingers messing up and typing the wrong words…
Edited on 08 December 2014 - 11:11 PM