XDemonic

Untitled

Jun 10th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local user = { "user1", "user2", "user3" }
  2. local component = require("component")
  3. local event = require("event")
  4. local Locked = true
  5. local os = require("os")
  6. local gpu = component.gpu
  7.  
  8. function Main()
  9.     gpu.setResolution(40, 20)
  10.     gpu.fill(1, 1, 40, 20, " ")
  11.     gpu.setForeground(0x00FF00)
  12.     gpu.set(16, 10, "LOCKED")
  13.     Listen()
  14. end
  15.  
  16. function Listen()
  17.     while true do
  18.     local _, Addr, X, Y, But, Name = event.pull("touch")
  19.         if (Name == "Jarverain") then
  20.             if (Locked == true) then
  21.                 gpu.fill(1, 1, 40, 20, " ")
  22.                 gpu.setForeground(0x00FF00)
  23.                 gpu.set(16, 10, "Access Granted")
  24.                 Locked = false
  25.             else
  26.                 gpu.fill(1, 1, 40, 20, " ")
  27.                 gpu.setForeground(0x00FF00)
  28.                 gpu.set(16, 10, "LOCKED")
  29.                 Locked = true
  30.             end
  31.         end
  32.     end
  33. end
  34.  
  35. Main()
Add Comment
Please, Sign In to add comment