Posted 28 July 2013 - 12:10 PM
Hello there,
I've been developing a code to print information from a file to a screen. I originally was using functions causing it to error out after about half an hour, I have just changed the code to not have functions in it and now after about 30 mins of run time the programs errors out saying 'startup:12: attempt to index ? (a nil value)' or something similar. But this dose not happen instantly like I said before. I don't know what to do. (Note the file is saved on a disk so that may be moved out of the drive to 'reset' it. That is why I have the first if statement.
Code:
while true do
if fs.exists("disk/Tasks") then
m.clear()
term.setCursorPos(1,1)
term.redirect(m)
f = fs.open("disk/Tasks", "r")
print(f.readAll())
sleep(5)
else
print("Disk not found checking again in 5 Seconds.")
sleep(5)
end
end
I've been developing a code to print information from a file to a screen. I originally was using functions causing it to error out after about half an hour, I have just changed the code to not have functions in it and now after about 30 mins of run time the programs errors out saying 'startup:12: attempt to index ? (a nil value)' or something similar. But this dose not happen instantly like I said before. I don't know what to do. (Note the file is saved on a disk so that may be moved out of the drive to 'reset' it. That is why I have the first if statement.
Code:
Spoiler
m = peripheral.wrap("right")while true do
if fs.exists("disk/Tasks") then
m.clear()
term.setCursorPos(1,1)
term.redirect(m)
f = fs.open("disk/Tasks", "r")
print(f.readAll())
sleep(5)
else
print("Disk not found checking again in 5 Seconds.")
sleep(5)
end
end