Guest User

security

a guest
Jul 4th, 2014
3,777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.32 KB | None | 0 0
  1. ---- Super Security Door, By Gustavo Wizard, @2014
  2. ---- This program needs Direwolf20 Button API
  3. ---- This program needs 2 monitors (bottom 1x1 and top 3x1)
  4. ---- Plz give credit for me and for the button API author if using this program in any way
  5.  
  6.  
  7. os.loadAPI("btn")
  8. m = peripheral.wrap("bottom")
  9. m1 = peripheral.wrap("top")
  10. local commandBlock = peripheral.wrap("left")
  11. currentCommand = commandBlock.getCommand()
  12.  
  13. m.setTextScale(0.5)
  14. m1.clear()
  15.  
  16. while true do
  17. m1.setBackgroundColor(colors.black)
  18. m1.clear()
  19. m.setBackgroundColor(colors.black)
  20. m.clear()
  21. m.setCursorPos(4,1)
  22. m.setTextColor(colors.lime)
  23. m.write("PASSWORD:")
  24. term.redirect(m)
  25. paintutils.drawLine(4,2,12,2,colors.red)
  26. paintutils.drawLine(4,2,4,10,colors.red)
  27. paintutils.drawLine(12,2,12,10,colors.red)
  28. paintutils.drawLine(4,10,12,10,colors.red)
  29. m.setBackgroundColor(colors.red)
  30. m.setTextColor(colors.white)
  31.  
  32. function fillTable()
  33.  btn.setTable("1", one, 6,6,4,4)
  34.  btn.setTable("2", two, 8,8,4,4)
  35.  btn.setTable("3", tre, 10,10,4,4)
  36.  btn.setTable("4", four, 6,6,6,6)
  37.  btn.setTable("5", five, 8,8,6,6)
  38.  btn.setTable("6", six, 10,10,6,6)
  39.  btn.setTable("7", sev, 6,6,8,8)
  40.  btn.setTable("8", eit, 8,8,8,8)
  41.  btn.setTable("9", nin, 10,10,8,8)
  42.  btn.screen()
  43. end
  44.  
  45. function getClick()
  46.  event,side,x,y = os.pullEvent("monitor_touch")
  47.  btn.checkxy(x,y)
  48. end
  49.  
  50. function one()
  51.  btn.flash("1")
  52.  num1 = 1
  53. end
  54.  
  55. function two()
  56.  btn.flash("2")
  57.  num1 = 2
  58. end
  59.  
  60. function tre()
  61.  btn.flash("3")
  62.  num1 = 3
  63. end
  64.  
  65. function four()
  66.  btn.flash("4")
  67.  num1 = 4
  68. end
  69.  
  70. function five()
  71.  btn.flash("5")
  72.  num1 = 5
  73. end
  74.  
  75. function six()
  76.  btn.flash("6")
  77.  num1 = 6
  78. end
  79.  
  80. function sev()
  81.  btn.flash("7")
  82.  num1 = 7
  83. end
  84.  
  85. function eit()
  86.  btn.flash("8")
  87.  num1 = 8
  88. end
  89.  
  90. function nin()
  91.  btn.flash("9")
  92.  num1 = 9
  93. end
  94.  
  95. fillTable()
  96.  
  97. getClick()
  98.  
  99.  
  100. function one()
  101.  btn.flash("1")
  102.  num2 = 1
  103. end
  104.  
  105. function two()
  106.  btn.flash("2")
  107.  num2 = 2
  108. end
  109.  
  110. function tre()
  111.  btn.flash("3")
  112.  num2 = 3
  113. end
  114.  
  115. function four()
  116.  btn.flash("4")
  117.  num2 = 4
  118. end
  119.  
  120. function five()
  121.  btn.flash("5")
  122.  num2 = 5
  123. end
  124.  
  125. function six()
  126.  btn.flash("6")
  127.  num2 = 6
  128. end
  129.  
  130. function sev()
  131.  btn.flash("7")
  132.  num2 = 7
  133. end
  134.  
  135. function eit()
  136.  btn.flash("8")
  137.  num2 = 8
  138. end
  139.  
  140. function nin()
  141.  btn.flash("9")
  142.  num2 = 9
  143. end
  144.  
  145. fillTable()
  146.  
  147. getClick()
  148.  
  149. function one()
  150.  btn.flash("1")
  151.  num3 = 1
  152. end
  153.  
  154. function two()
  155.  btn.flash("2")
  156.  num3 = 2
  157. end
  158.  
  159. function tre()
  160.  btn.flash("3")
  161.  num3 = 3
  162. end
  163.  
  164. function four()
  165.  btn.flash("4")
  166.  num3 = 4
  167. end
  168.  
  169. function five()
  170.  btn.flash("5")
  171.  num3 = 5
  172. end
  173.  
  174. function six()
  175.  btn.flash("6")
  176.  num3 = 6
  177. end
  178.  
  179. function sev()
  180.  btn.flash("7")
  181.  num3 = 7
  182. end
  183.  
  184. function eit()
  185.  btn.flash("8")
  186.  num3 = 8
  187. end
  188.  
  189. function nin()
  190.  btn.flash("9")
  191.  num3 = 9
  192. end
  193.  
  194. fillTable()
  195.  
  196. getClick()
  197.  
  198. m1.setTextScale(1)
  199.  
  200. if num1 == 1 and num2 == 2 and num3 == 3 then -- change your password here
  201. m1.setBackgroundColor(colors.green)
  202. m1.clear()
  203. m1.setCursorPos(14,3)
  204. m1.write("ACESS GRANTED!")
  205. rs.setOutput("back", true)
  206. commandBlock.setCommand("playsound wizard.access_granted @a")
  207. commandBlock.runCommand()
  208. sleep(6)
  209. rs.setOutput("back", false)
  210.  
  211. else
  212.  
  213. m1.setBackgroundColor(colors.red)
  214. m1.clear()
  215. m1.setCursorPos(14,3)
  216. m1.write("ACESS DENIED!")
  217. commandBlock.setCommand("playsound wizard.access_denied @a")
  218. commandBlock.runCommand()
  219. sleep(4)
  220. end
  221.  
  222.  
  223. end
Advertisement
Add Comment
Please, Sign In to add comment