Posted 16 February 2013 - 11:52 AM
Hey!
Im trying to make a Crashlog that displays a cool designed screen right before the crash. but. when i've made a "save Crash log" button and i clicked on it it shows me this:
Test:35: attempt to index ? (a nil value)
I think im wrong in the fs api, but im not sure.. i dont remember the fs api that much.
Thanks in advance!
Im trying to make a Crashlog that displays a cool designed screen right before the crash. but. when i've made a "save Crash log" button and i clicked on it it shows me this:
Test:35: attempt to index ? (a nil value)
I think im wrong in the fs api, but im not sure.. i dont remember the fs api that much.
Spoiler
local events = {os.pullEvent()}
if events[1] == "mouse_click" then
if events[3] >= 17 and events[3] <= 34 and events[4] == 17 then
term.clear()
term.setBackgroundColor(colors.gray)
term.clear()
term.setCursorPos(1,1)
fLNum = ("cLogs/crashlog001")
if not fs.exists(fLNum) then
local _rTime = textutils.formatTime(os.time()) -- gets the current time.
sCLg = fs.open(fLNum, "w") -- Line 34
sCLg.writeLine("-- Error report saved, ".._rTime) -- line 35 this line is the error?
sCLg.writeLine(" ")
sCLg.writeLine("================================")
sCLg.writeLine(err)
sCLg.writeLine("================================")
sCLg.close()
write("Crash log has been saved to: \n\n/crashlogs/"..filenum)
end
end
end
Thanks in advance!