Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

password

By: a guest on Jan 14th, 2013  |  syntax: Lua  |  size: 1.26 KB  |  views: 54  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. local running = true
  2. --local eventm = event,arg,x,y = os.pullEvent("mouse_click")
  3.  
  4. function clear(t)
  5. term.clear()
  6. term.setCursorPos(1,1)
  7.  if t == nil then
  8.   term.setCursorPos(19,4)
  9.   term.setTextColor(8)
  10.   write("Enter Password")
  11.   term.setTextColor(1)
  12.   term.setCursorPos(22,7)
  13.   write("1  2  3")
  14.   term.setCursorPos(22,9)
  15.   write("4  5  6")
  16.   term.setCursorPos(22,11)
  17.   write("7  8  9")
  18.  end
  19. end
  20.  
  21. function marker()
  22. -- while true do
  23.  event,arg,x,y = os.pullEvent("mouse_click")
  24.  term.setCursorPos(x,y)
  25.  term.setTextColor(4)
  26.  write("*")
  27.  sleep(1)
  28.  clear()
  29.  term.setTextColor(1)
  30. -- end
  31. end
  32.  
  33. while running do
  34. clear()
  35. --marker()
  36. event,arg,x,y = os.pullEventRaw()
  37.  if event == "mouse_click" and x == 28 and y == 7 then
  38.  --marker()
  39.  event,arg,x,y = os.pullEventRaw()
  40.   if event == "mouse_click" and x == 25 and y == 9 then
  41.   --marker()
  42.    event,arg,x,y = os.pullEventRaw()
  43.    if event == "mouse_click" and x == 28 and y == 11 then
  44.    --marker()
  45.     event,arg,x,y = os.pullEventRaw()
  46.      if event == "mouse_click" and x == 28 and y == 9 then
  47.      term.setCursorPos(18,14)
  48.      term.setTextColor(32)
  49.      write("Correct Password!")
  50.      term.setTextColor(1)
  51.      sleep(1)
  52.      running = false
  53.     end
  54.    end
  55.   end
  56.  end    
  57. end
  58.  
  59. clear(1)
clone this paste RAW Paste Data