I notice that on line 5 (of the installer), you use shell.run to get a pastebin file:
shell.run("pastebin get 2wxQPtuv Xeon/System/installationbackground")
Yet on line 11, you define a function to retrieve pastebin files. Why can't you just define that function earlier, use it on line 5 and be consistent with your code?
Then on line 19 you define this continue button function:
local function continuebutton()
term.setTextColor(colors.black)
term.setBackgroundColor(colors.white)
term.setCursorPos(35,15)
print("Continue")
local event, button, x, y = os.pullEvent("mouse_click")
if y == 15 and x < 43 and x > 34 and button == 1 then
continued = 1
end
end
Which then uses ugly global variables to inform the program that it has been clicked. It also doesn't appear to work if you click something other than the button the first time, forcing you to do something like this:
while true do
continuebutton()
if continued == 1 then
continued = 0
....
While if you would just write your code better, you could do something like this:
local function continuebutton()
term.setTextColor(colors.black)
term.setBackgroundColor(colors.white)
term.setCursorPos(35,15)
print("Continue")
while true do
local event, button, x, y = os.pullEvent("mouse_click")
if y == 15 and x < 43 and x > 34 and button == 1 then
return true
end
end
end
....
continuebutton()
-- Note the lack of any control statements or loops, it's already handled for us by the function.
-- And this function could still be a lot better.
....
I have to go, but there seems to be a lot of inconsistencies and bad coding in general just in the installer. I hope for your sake there isn't as much in the actual operating system, or it will really come back to bite you when you try to update and change your code some day.
UPDATE: Took a quick look at your startup file. Lines 5-31 and 43-83 really need to be shortened to a for loop. You also seem to have confused the period and the comma halfway through writing out lines 43-83 manually, which looks like it could cause an error (can't test it right now though). You wouldn't have silly mistakes like this in your code if you used a loop instead of manually writing everything out.
UPDATE 2: Don't even get me started on the system file, almost everything in there is hard coded and impossible to change without rewriting the code or making ugly changes to it. You seriously need to go learn more and get more familiar with Lua and learning how to modularize your programs before you make an operating system.