Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component=require("component")
- local r=component.redstone
- local gpu=component.gpu
- local term=require("term")
- local text=require("text")
- ---- config section
- local password="I agree"
- local delay=1 --time the door stays open
- local side=5 --side of the door, test this
- -----
- local wrong=false
- while true do
- term.clear()
- gpu.set(1,1,"UCIS Rocket Control Centre")
- gpu.set(1,3,"Please enter password")
- if wrong then
- gpu.set(1,1,"UCIS Rocket Control Centre")
- gpu.set(1,3,"Please enter password")
- wrong=false
- end
- input = text.trim(term.read(nil, false, nil, "*"))
- if input==password then
- r.setOutput(side,15) -- check if this is the correct function
- os.sleep(delay)
- r.setOutput(side,0) -- same here
- else
- wrong=true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement