The 'backup' script will not work correctly, on line 12 you compare the input of the user to the variable 'y'
The variable 'y' is not defined and thus the 'else' clause will always be executed, regardless of the user's input. To compare if the key they stuck (followed by enter) was the letter 'y', I propose:
local yn = read():lower()
if yn == "y" then
print("YES")
else
print("NO")
end
Next, bios.lua… technically not a BIOS but whatever. problems:
line 12 will not work for the same reason as described above. With an exception, you are doing tonumber(read()) which makes
absolutely no sense. You aren't treating the input as a number as you are trying to detect if they typed 'y', which is a string, not a number!
Similarly, line 42 will fail causing 'your choice was unknown' to be printed… for ever.
Testing is important!Right, let's move onto 'boot'. This one is… interesting
Firstly, line 9. This makes little sense, fs.open() will open a file. The first argument is the path to open which at this moment is a random number between 1 and 100…
what. Either you have files 1-100 sitting on your computer or this is mistake.
also you never close the line 9 fs.open or the line 15 fs.open…
these should be closed.
I simply cannot make any sense from this boot file, on lines 22 and 23 in your else clause you write to the file the entered usernames and password (registration maybe??), but you are using 'tonumber' which will return nil if there username or password isn't just a string of number… which it likely won't be.
I got annoyed at the lack of indentation after this and gave up. I feel that before attempting a so called 'Secure user based operating system' you should actually get familiar with Lua. It is very difficult to make an OS, nevermind a 'user based' one which is also secure.
Apologies if I came across aggressively, I do not intend to. Good luck fixing!