Advertisement
Telerabi

Zahlencode Monitor

Jun 28th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. vorgabe = {}
  3.  
  4. mon.setBackgroundColor(colors.white)
  5. mon.clear()
  6. for i=1, 4 do
  7.     mon.setTextColor(colors.green)
  8.     mon.setCursorPos(i*2-1, 3)
  9.     mon.write(i)
  10. end
  11.  
  12. while true do
  13.     for i=1,4 do
  14.         event, side, x, y = os.pullEvent("monitor_touch")
  15.         if(event) then
  16.             mon.setCursorPos(i*2-1, 4)
  17.             mon.setTextColor(colors.gray)
  18.             mon.write("*")
  19.         end
  20.         vorgabe[i] = x
  21.         if(vorgabe[1]==1 and vorgabe[2] ==7 and vorgabe[3]==3 and vorgabe[4]==5) then
  22.             rs.setOutput("right", true)
  23.             sleep(1)
  24.             rs.setOutput("right", false)
  25.         end
  26.     end
  27. sleep(0.25)
  28. mon.clearLine()
  29. vorgabe = {}
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement