superanonymous

Monlock (see bg (s9kuCHX5))

Feb 13th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. password = "4960"
  2. sideq = "back"
  3. side = "left"
  4. orange = colors.orange
  5. black = colors.gray
  6. function drawtext(tx,ty,txt,colorwee)
  7. term.setBackgroundColor(colorwee)
  8. term.setCursorPos(tx,ty)
  9. term.write(txt)
  10. end
  11.  
  12. input=""
  13.  
  14. function drawgui()
  15. drawtext(1,4,"1",orange)
  16. drawtext(2,4,"2",black)
  17. drawtext(3,4,"3",orange)
  18. drawtext(4,4,"4",black)
  19. drawtext(5,4,"5",orange)
  20. drawtext(1,5,"6",black)
  21. drawtext(2,5,"7",orange)
  22. drawtext(3,5,"8",black)
  23. drawtext(4,5,"9",orange)
  24. drawtext(5,5,"0",black)
  25. drawtext(1,2,">",colors.black)
  26. end
  27.  
  28. function ifcall(xc,yc,num)
  29. if x==xc and y==yc then
  30. input=input..num
  31. term.write("*")
  32. end
  33. end
  34.  
  35. term.redirect(peripheral.wrap(side))
  36. paintutils.drawImage(paintutils.loadImage("bg"),1,1)
  37. drawgui()
  38. while true do
  39. event,disp,x,y = os.pullEvent()
  40. ifcall(1,4,"1")
  41. ifcall(2,4,"2")
  42. ifcall(3,4,"3")
  43. ifcall(4,4,"4")
  44. ifcall(5,4,"5")
  45. ifcall(1,5,"6")
  46. ifcall(2,5,"7")
  47. ifcall(3,5,"8")
  48. ifcall(4,5,"9")
  49. ifcall(5,5,"0")
  50. if x==7 and y==4 then
  51. term.setCursorPos(2,1)
  52. if input==password then
  53. rs.setOutput(sideq, true)
  54. sleep(2)
  55. os.reboot()
  56. else os.reboot() end
  57. end
  58. if x==7 and y==5 then
  59. os.reboot()
  60. end
  61. sleep(0.2)
  62. end
  63. term.restore()
Advertisement
Add Comment
Please, Sign In to add comment