window:88: Expected Number
Here is my code:
local handle = fs.open(".settings/theme", "r")
theme = handle.readLine()
handle.close()
How can this be fixed?
window:88: Expected Number
local handle = fs.open(".settings/theme", "r")
theme = handle.readLine()
handle.close()
its too big to put hereHow about the rest of your code?
Well, isn't that unfortunate.its too big to put hereHow about the rest of your code?
term.setTextColor would be recieving something like this colors.red, that should workWell, isn't that unfortunate.its too big to put hereHow about the rest of your code?
You could put it on pastebin or something, but without your code, we can't really help you that much.
Though, I can tell you it's something about term.setTextColor receiving a non-number argument somewhere in your code, couldn't tell you where.
There's also another issue, if you're going to use .settings as a folder, you will break the CC1.77 settings api some way or the other.
While that *should* work, that isn't what's happening in your code based on the error. Please post your code to pastebin and post the link here. Without seeing your code all we can do is guess.term.setTextColor would be recieving something like this colors.red, that should work
i didWhile that *should* work, that isn't what's happening in your code based on the error. Please post your code to pastebin and post the link here. Without seeing your code all we can do is guess.term.setTextColor would be recieving something like this colors.red, that should work
i dont quite understand what you mean by string in some places and a table in others.You're setting the theme variable to a string in some places and a table in others. You should probably add some debug prints to determine exactly where the error is being thrown, though.
local theme = {}
Line 531 (string)
theme = read()
Line 537 (table)
theme = grayscaleTheme
Line 3298 (string)
theme = handle.readLine()
Line 3302 (table)
theme = grayscaleTheme
theme = textutils.unserialize(handle.readAll())
stored in the file isHe's not setting it, he's using GravityScore's and 1lann's code. More than likely, and I hope this is the case, the file he's reading is full of a serialized table, in which he could easily just use this line:theme = textutils.unserialize(handle.readAll())
defaultTheme
which refers to line 76.
handle.readLine()
it works, so why dosent handle.readLine()?ok, thanksA string in a file is just a string, it doesn't "refer to" anything else.