This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
vyse's profile picture

username/password registry login.

Started by vyse, 06 October 2014 - 08:24 PM
vyse #1
Posted 06 October 2014 - 10:24 PM
Hello computercrafters,

Today i am showing you a registry login program knowing that many many people have done this i tried my best to make it different.
I am really new to computercraft in fact like not even a week. But i have almost spent 48 hours into learning how to program, for some
reason i find i interesting. anyways to the program.

So first thing that will happen it will ask you to make a username.
[attachment=1901:2014-10-06_17.00.56.png]
Then a password.
[attachment=1902:2014-10-06_17.01.06.png]
And last time what color you wish to have as your Background.
[attachment=1903:2014-10-06_17.01.26.png]
After you are done registering it will say "new registry saved!"

Then it will go on and continue with the main part of the program.
[attachment=1905:2014-10-06_17.01.43.png]
The username and password.


so that is basically it for this program

things you can do to this program, one you can add on and have it be a lock for your main startup program or for your operating system( up to you).

List of what my goal is.
1.make a registry file 100%
2.have the option to select what you want your background color to be 100%
3.have it become hack proof 75% (tip: instead of running os.reboot() i would suggest do shell.run("startup") what this does is runs the computers startup and not the disks)
4.Effects 30%
5.multiple user logins 0% (i'm only able to have one right now i haven't tested having multiple yet).




People that gave me advice:
KingofGamesYami (helped me understand how to choose a background color)
Dragon53535 (gave me advice in making the registry work)


About pastebin i would add it to pastebin but im not sure if it would be any use to anyone so please comment if you want there to be a pastebin of it.

Also if you have any tips or idea just anything that might help make the program even better let me know i would love to add more to it!
Edited on 06 October 2014 - 09:10 PM
Anavrins #2
Posted 06 October 2014 - 10:42 PM
3.have it become hack proof 75% (tip: instead of running os.reboot() i would suggest do shell.run("startup") what this does is runs the computers startup and not the disks)
You've got to be kidding me.

You're effectively running "startup" inside of "startup" inside of "startup" etc…
This will crash after 256 attempts due to a stack overflow.
I don't understand why most people think this is remotely better than a even simpler "while" loop…
Edited on 06 October 2014 - 08:48 PM
vyse #3
Posted 06 October 2014 - 11:08 PM
I understand your point, that will crash it IF someone has the time to run the program 256 times.
I'm not sure if this helps but what i did is have term.clear() then shell.run("startup") this probably has no effect on how many times the program can be ran before it crashes.
and with hacking the only way to do so is to have a disk in the disk drive before turning on the computer thats the only way i have found to be hackable.
Anavrins #4
Posted 06 October 2014 - 11:48 PM
I find it completely practicable to do 256 attempt.
It indeed won't help using term.clear for the same reason you stated.
An attacker can hold Ctrl+R to reboot the computer and boot the disk if they wanted, solution is to not put a disk drive beside the computer.
A "while true do" loop, and a "break" to exit out of it is pretty much the optimal thing to do.
vyse #5
Posted 06 October 2014 - 11:52 PM
Hmm so for instance in stead of reloading the program you would make it so they have to try again in the loop system until they get it correct. Correct?
Edited on 06 October 2014 - 09:56 PM
Anavrins #6
Posted 07 October 2014 - 12:52 AM
Yes, something like this.

local password = "yourpassword"
while true do
  term.clear()
  term.setCursorPos(1,1)
  local input = read("*")
  if input == password then
	print("Access granted")
	os.sleep(1)
	break --// This will immediately end the loop
  else
	print("Access Denied")
	os.sleep(1)
	--// Will resume back at the start of the loop
  end
end
--// Will resume here after 'break'
--// No need for shell.run("shell"), the script will end and automatically fall back to the shell.
By using the while loop, you won't be running the program inside itself multiple time, you won't need slow and unnecessary reboot.
It won't protect you from startup disks, nothing will, just don't put a drive beside your computer.
Edited on 06 October 2014 - 11:01 PM
theoriginalbit #7
Posted 08 November 2014 - 08:26 AM
Locked. When you have code to show, or code that you wish to post, please report this thread to the moderators so it may be unlocked.