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
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