daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local component=require("component")
  2. local r=component.redstone
  3. local gpu=component.gpu
  4. local term=require("term")
  5. local text=require("text")
  6.  
  7.  
  8. ---- config section
  9. local password="I agree"
  10. local delay=1 --time the door stays open
  11. local side=5 --side of the door, test this
  12. -----
  13.  
  14.  
  15. local wrong=false
  16.  
  17.  
  18. while true do
  19.   term.clear()
  20.   gpu.set(1,1,"UCIS Rocket Control Centre")
  21.   gpu.set(1,3,"Please enter password")
  22.   if wrong then
  23.     gpu.set(1,1,"UCIS Rocket Control Centre")
  24.     gpu.set(1,3,"Please enter password")
  25.     wrong=false
  26.   end
  27.   input = text.trim(term.read(nil, false, nil, "*"))
  28.   if input==password then
  29.      r.setOutput(side,15) -- check if this is the correct function
  30.      os.sleep(delay)
  31.      r.setOutput(side,0) -- same here
  32.   else
  33.      wrong=true
  34.   end
  35. end
RAW Paste Data
Top