Posted 23 April 2013 - 02:13 PM
I've made this code:http://pastebin.com/4w2zjgit, but I can't seem to get it to work. The error message that keeps appearing is: 'end' expected (to close 'function' at line 10)
function subir() -- moves up 10 times
if redstuone.getInput("right", true) then
sleep(5)
length=10
for i=1,length,1 do
turtle.up()
end
end
end
function descer() -- moves down 10 times
if redstone.getInput("left",true) then
sleep(5) --gives enough time for you to get on
length=10
for i=1,length,1 do
turtle.down()
end --closes loop
end -- closes if
end --closes function you missed this
function subir() -- moves up 10 times
if redstuone.getInput("right", true) then
sleep(5)
length=10
for i=1,length,1 do
turtle.up()
end - closes loop
end - closes if
end - closes function you missed this too
while true do --infinite loop to check
descer()
subir()
end