Posted 06 August 2013 - 05:23 AM
Hello,
I'm busy with a program that make it possible for people to chance settings in LightOS (It is still not released). But if I use this code I get the error message: "set:14: attempt to index ? (a nil value)" . So if I do ap = h.readLine() then it returns nil, but why? I thought that this would be okay. Can somebody help me with this? Thanks :D/>
I'm busy with a program that make it possible for people to chance settings in LightOS (It is still not released). But if I use this code I get the error message: "set:14: attempt to index ? (a nil value)" . So if I do ap = h.readLine() then it returns nil, but why? I thought that this would be okay. Can somebody help me with this? Thanks :D/>
acreenx, screeny = term.getSize()
painttools.fill(1, screenx, 1, screeny, 256)
if fs.exists(".lightos/system/config/bluescreen") == false then
local sFile = ".lightos/system/config/bluescreen"
h = fs.open(sFile, "w")
h.writeLine("false")
h.writeLine("true")
h.writeLine("true")
h.close()
end
while true do
local sFile = ".lightos/system/config/bluescreen"
h = fs.open("sFile", "r")
ap = h.readLine()
se = h.readLine()
er = h.readLine()
h.close()
term.setCursorPos(1,1)
print("Auto pastebin:"..ap)
print("Smiley:"..se)
print("Error report:"..er)
--Here comes some more code if the file thing works
end