Tutorial/Easy Passworded Door

This will be a very fast and simple tutorial of how to make a passworded door. Make sure to have some understanding in lua before adding the security line

os.pullEvent = os.pullEventRaw

at the top of your program. Let's get going.

-- Easy Passworded Door
-- Written by Brainless243
-- Posted to The Tekkit Wiki on 24/10/2012

term.clear()
term.setCursorPos(1, 1) -- Those commands will just clear the screen

print("Simple Password Door v. 1.0")
write("Enter password: ")
input = read() -- This is the input the user makes

password = "Tekkit" -- This is the correct password, and can be anything.

if input == password then -- If the input is equal to the password then...
print("Password was correct!")
rs.setOutput("left", true)
sleep(3)
rs.setOutput("left", false)
else -- If input isnt equal to password then...
print("Password was incorrect")
sleep(3)
os.reboot()
end



And there we have it.

If you want the password to be hidden while typing, change

input = read()

to

input = read("*")

Presto.


Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Need wiki hosting?

Do you need a wiki for your Minecraft mod/gaming wiki? We'll host it for free! Contact us.

Other wikis

Indie-game wikis
Powered by Indie Wikis