Posted 23 March 2017 - 03:43 PM
Hello. I am trying to code an door lock for Tekkit classic and I cant just figure it out.
Its an username + password lock and I am trying to fix an master password.
Any ideas on what I should do? And can I improve something?
Its an username + password lock and I am trying to fix an master password.
Spoiler
local tUsers = { Zippcast = "Admin", Bodomo = "BroCo", Celyph = "password"}
master = TigerMeister
password = Tigernr2
function clear()
term.clear()
term.setCursorPos(1,1)
write("TigerMeister Security INC v2 ")
term.setCursorPos(1,2)
end
clear()
write("Username: ")
user = read()
clear()
write("Password: ")
pass = read("*")
if master == password then
sleep(1)
write("Terminal now unlocked, please save when done.")
else
if tUsers[user] == pass then
sleep(1)
write("Welcome "..user.."!")
rs.setOutput("left",true)
sleep(3)
rs.setOutput("left",false)
os.shutdown
end
else
write("Wrong Username or Password!")
sleep(5)
os.shutdown()
end
Any ideas on what I should do? And can I improve something?