Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print("<Waiting for input>")
- local curPos = 1
- local curPass = ""
- input = ""
- while true do
- local event, param = os.pullEventRaw()
- if event == "char" and curPos < 20 then
- term.setCursorPos(curPos, 2)
- print(param)
- curPos = curPos + 1
- curPass = curPass .. param
- end
- if event == "key" and param == 14 and curPos ~= 0 then
- curPos = curPos - 1
- term.setCursorPos(curPos, 2)
- print(" ")
- curPass = string.sub(curPass, 1, string.len(curPass) - 1)
- end
- if event == "key" and param == 28 then
- input = curPass
- break
- end
- end
- term.setCursorPos(1, 3)
- print("You have entered " .. input)
- if input == "catamorphism" then
- print("Welcome home.")
- redstone.setOutput("back", true)
- sleep(10)
- redstone.setOutput("back", false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement