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

Password Program

Started by SkyCrafter0, 03 December 2017 - 04:07 PM
SkyCrafter0 #1
Posted 03 December 2017 - 05:07 PM
The all new password system!
This is a new password system that is simple to use and configure, you can use it at startup or as an unlocking program!
Code
Spoiler


os.pullEvent = os.pullEventRaw
InsertMainPassword = passwordmain
InsertSecondaryPassword = passwordsecondary
InsertTertiaryPassword = passwordtertiary
InsertQuarternaryPassword = passwordquarternary
InsertQuinaryPassword = passwordquinary
while true do
		term.clear()
		term.setCursorPos(1,1)
		term.write("Password:")
		local password = read()
	  
		if password == "passwordmain" then
				shell.run("ID")
		elseif password == "passwordsecondary" then
				shell.run("ID")
		elseif password == "passwordtertiary" then
				shell.run("ID")
		elseif password == "passwordquarternary" then
				shell.run("ID")
		elseif password -- "passwordquinary" then
				shell.run("ID")
		else
				term.print("Incorrect.Rebooting")
				sleep(5)
				os.reboot
		end
end

Download
Spoilerpastebin get 8tQ1vyhh lockunlock
Howto start at startup
pastebin get uUSrzyyx startup
(you need both programs for startup)
Features
Spoiler
  • Five passwords, with expandability!
  • Cannot terminate
  • Can run ANY program when password entered
  • Can run ANY program when incorrect password entered
Please leave opnions in the comments, this is my second (public) script and a retake on my first script
CLNinja #2
Posted 03 December 2017 - 05:18 PM
You could literally just move lockunlock to startup instead of making another file.
LoganDark2 #3
Posted 20 January 2018 - 11:41 PM
Here's some things that could be improved! :P/>

Just by reading your code (I haven't even tested it, and I won't, there may be more):
  • the passwords you set in the file can't be used, in fact, the password "passwordmain" will always work
  • the password is readable while you're typing it
  • os.pullEvent is never restored after running the password lock
  • the password lock can never be stopped
  • it can only run a program named "ID"
  • it's simple enough someone could code it themselves, customized to their needs, if they really felt a need for it
If you're going to release a program on the forums, please put a little more effort into it. And test it first, I can see a syntax error in your code (although, you did catch it earlier and fix the pastebin).
Edited on 23 January 2018 - 11:49 AM