←  Programs

ComputerCraft | Programmable Computers for Minecraft

»

Password Program

MeLike2D's Photo MeLike2D 29 Dec 2017

Password Program

This is my first Program So be easy on me

https://pastebin.com/eQLpZMf9

pastebin get eQLpZMf9 startup



os.pullEvent = os.pullEventRaw

while true do
  
	term.clear()
	term.setTextColor(colors.red)
	term.setCursorPos(3,2)
	term.write("Password: ")
	local password = read("#")
  
	if password == "password" then
		  term.clear()
		  print("Hello Player!")
		  redstone.setOutput("right", true)
		  sleep(2)
		  redstone.setOutput("right", false)
		  os.shutdown()
	 else
		  term.clear()
		  term.setBackgroundColor(colors.white)
		  term.setTextColor(colors.black)
		  print("Wrong Password")
		  sleep(2)
		  print("Shutting Down")
		  sleep(2)
		  os.shutdown()
	   end	
end


Edited by MeLike2D, 30 December 2017 - 11:02 PM.
Quote