Posted 24 November 2012 - 05:22 AM
Hello pros I have a little problem I can't solve. I have tried this in many ways but still can't get it working.
At start inside text file there is one number 0 and nothing else, but the turtle part never thinks that there is number 0 so when I start the program turtle just keeps flying up in the sky, but it should read function start() because the number inside the file is 0. I guess there is some kind of mistake I have made.
Btw, if I just type print(""..cord) then it will return 0 (or whatever number is inside text file) so I can't understand why print works but if doesn't.
At start inside text file there is one number 0 and nothing else, but the turtle part never thinks that there is number 0 so when I start the program turtle just keeps flying up in the sky, but it should read function start() because the number inside the file is 0. I guess there is some kind of mistake I have made.
Btw, if I just type print(""..cord) then it will return 0 (or whatever number is inside text file) so I can't understand why print works but if doesn't.
Spoiler
function check()
file = fs.open("Data/down","r")
data = {}
line = file.readLine()
table.insert(data,line)
file.close()
cord = data[1]
if cord == 0 then start() else [b]--{Here is the part where he should run start() instead of the code below}--[/b]
repeat [b]--{Here is the part which is looping and number never reaches 0}--[/b]
turtle.digUp()
turtle.up()
cord = cord-1
until cord == 0
end
end