Posted 24 September 2013 - 12:55 PM
Hello, I have got a little problem on my code.
I am currently making an operating system for the regular old computers, since I just don't like the new ones.
I have a problem in my menu code;
My code:
It's a menu code, or it's supposed to be. I remember when I played Tekkit I made a menu code of some sorts, and tried to make it here.
Note, the code does look a little bit empty because I have tried making an operating system before and I would get this problem,
so I just did a little menu (or whatever it is) on what I remembered to see if it was just a bug.
The problem:
Normally, on a old menu, you'd be asked what selection you wish to use, like, Shutdown and Programs.
So here I have those two, but when you put in 1 or 2, it says Invalid Selection!
When it should normally do the action.
Sorry if it's a stupid mistake I did on my side, I'm a noob at coding :P/>
I did try and remake my menu from Tekkit, but I don't think it's successful.
If you can fix it, I will probably put credit to helping me on my operating system.
I am currently making an operating system for the regular old computers, since I just don't like the new ones.
I have a problem in my menu code;
My code:
print("1. Programs")
print("2. Shutdown")
write("Selection: ")
input = read()
if input == one then
shell.run("programs")
end
if input == 2 then
os.shutdown()
else
print("Invalid selection!")
sleep(1)
os.reboot()
end
It's a menu code, or it's supposed to be. I remember when I played Tekkit I made a menu code of some sorts, and tried to make it here.
Note, the code does look a little bit empty because I have tried making an operating system before and I would get this problem,
so I just did a little menu (or whatever it is) on what I remembered to see if it was just a bug.
The problem:
Normally, on a old menu, you'd be asked what selection you wish to use, like, Shutdown and Programs.
So here I have those two, but when you put in 1 or 2, it says Invalid Selection!
When it should normally do the action.
Sorry if it's a stupid mistake I did on my side, I'm a noob at coding :P/>
I did try and remake my menu from Tekkit, but I don't think it's successful.
If you can fix it, I will probably put credit to helping me on my operating system.