Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function zacatek()
- if fs.exists("vari") then
- term.clear()
- kuna = fs.open("vari", "r")
- pas = kuna.readAll()
- kuna.close()
- kuna2 = fs.open("strana", "r")
- sig = kuna2.readAll()
- kuna2.close()
- jes()
- else
- pass()
- end
- end
- function jes()
- if pas == "" then
- pass()
- else
- open()
- end
- end
- function pass()
- term.setCursorPos(10, 10)
- print("PLEASE TYPE YOUR NEW PASSWORD")
- term.setCursorPos(20, 11)
- pas = read()
- kuna = fs.open("vari", "w")
- kuna.write(pas)
- kuna.close()
- term.clear()
- term.setCursorPos(10,10)
- print("PASSWORD SAVED")
- sleep(3)
- term.clear()
- term.setCursorPos(1, 10)
- print("PLEASE SELECT SIGNAL OUTPUT SIDE: LEFT RIGHT BACK TOP BOTTON")
- term.setCursorPos(20, 11)
- pos = read()
- if pos == "LEFT" then
- sig = "left"
- good()
- elseif pos == "RIGHT" then
- sig = "right"
- good()
- elseif pos == "TOP" then
- sig = "top"
- good()
- elseif pos == "BOTTON" then
- sig = "botton"
- good()
- elseif pos == "BACK" then
- sig = "back"
- good()
- else
- print("wrong input try again")
- sleep(3)
- pass()
- end
- end
- function good()
- term.clear()
- kuna2 = fs.open("strana", "w")
- kuna2.write(sig)
- kuna2.close()
- term.setCursorPos(10, 10)
- print("EVERYTHING SAVED HAVE A NICE DAY")
- sleep(3)
- open()
- end
- function open()
- term.clear()
- term.setCursorPos(10, 10)
- print("PLEASE ENTER THE PASSWORD: ")
- term.setCursorPos(20, 11)
- getpass = read()
- if getpass == pas then
- term.clear()
- term.setCursorPos(10, 10)
- print("ACESS GRANTED HAVE A NICE DAY")
- redstone.setOutput(sig, true)
- sleep(5)
- rs.setOutput(sig, false)
- open()
- else
- term.clear()
- term.setCursorPos(10, 10)
- print("PASSWORD INCORRECT TRY AGAIN")
- sleep(3)
- open()
- end
- end
- zacatek()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement