254 posts
Location
In front of my PC
Posted 18 May 2016 - 11:42 PM
For some reason, when I run my program, I get this error:
sys:961: attempt to call nil
It's on a settings.load call:
settings.load("system/.settings")
There is nothing disabling the settings API, and the file does exist. It's really frustrating, and it's making me wanna quit.
I can't really just post the code here as it would just spoil everything, but I could PM it or send parts of it.
Edited on 22 May 2016 - 01:23 AM
3057 posts
Location
United States of America
Posted 18 May 2016 - 11:55 PM
The problematic line is probably not that one. Sometimes lua errors are off by one or two lines. To really help you, I do need the full code. If you PM me the code I can help, but it would be most helpful if you can post it here.
2427 posts
Location
UK
Posted 19 May 2016 - 12:02 AM
a debug trick that some people use is to get your program to output to the screen (or a file) to record it's progress, you then know that the error is caused between the last debug message written and the next one which was not written
254 posts
Location
In front of my PC
Posted 19 May 2016 - 01:21 AM
This is the piece of code it happens in:
local users = getusers()
if #users == 0 then
newuser()
selectusr(getusers()[1], {["logscreen"] = logscreen, ["lockscreenrunning"] = lockscreenrunning})
else
settings.load("system/.settings")
selectusr(settings.get("lastuser", users[1]), {["logscreen"] = logscreen, ["lockscreenrunning"] = lockscreenrunning})
end
Edited on 18 May 2016 - 11:23 PM
7083 posts
Location
Tasmania (AU)
Posted 19 May 2016 - 01:58 AM
Full script, please.
254 posts
Location
In front of my PC
Posted 19 May 2016 - 04:44 PM
It's _really_ long, but ok
Should I send the whole built program or just the file it happened in?
Edited on 19 May 2016 - 02:53 PM
1080 posts
Location
In the Matrix
Posted 19 May 2016 - 05:17 PM
Upload the files to a paste site like
Pastebin and give us the links, tell us what file it occured in, and we should be able to see most of the issue.
254 posts
Location
In front of my PC
Posted 22 May 2016 - 03:20 AM
Edited on 22 May 2016 - 01:20 AM
7083 posts
Location
Tasmania (AU)
Posted 22 May 2016 - 03:47 AM
Line 4:
os.loadAPI("settings")
What's the content of this file?
818 posts
Location
Wherever you want me to be
Posted 22 May 2016 - 04:23 AM
Make sure that you're not making any typos, it might be the reason it's not working
254 posts
Location
In front of my PC
Posted 22 May 2016 - 05:29 AM
Line 4:
os.loadAPI("settings")
What's the content of this file?
It was just a failed attempt at making this work, probably the settings API wasn't loaded so I tried to load it manually. It gives the same error if I remove that.
7083 posts
Location
Tasmania (AU)
Posted 22 May 2016 - 06:14 AM
What do you get if you stick this directly before line 210?:
for key, value in pairs(settings) do print(key) end
254 posts
Location
In front of my PC
Posted 22 May 2016 - 06:56 AM
Weird, I get the full instruction set, including load
I put a read() after it, and when I press enter it gives the same error
EDIT:
Actually, I'm an idiot. Found the problem.
Edited on 22 May 2016 - 04:57 AM