Advertisement
MagmaLP

Unlequid_Core

Apr 12th, 2022 (edited)
781
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. mon.setTextScale(1.5)
  3. side = "top" --Monitor Seite
  4. rs.setOutput("bottom", true)
  5.  
  6. function an()
  7.     mon.setCursorPos(1,1)
  8.     mon.setBackgroundColor(colors.lime)
  9.     mon.setCursorPos(2,2)
  10.     mon.clear()
  11.     mon.setTextColor(colors.black)
  12.     mon.write("an")
  13.     sleep(0.5)
  14.     local event, side, X, Y = os.pullEvent("monitor_touch")
  15.     if X >= 01 and X <= 05 and Y >= 1 and Y <= 4 and side == side then
  16.         rs.setOutput("bottom", true)
  17.         aus()
  18.     end
  19. end
  20.  
  21. function aus()
  22.     mon.setCursorPos(1,1)
  23.     mon.setBackgroundColor(colors.red)
  24.     mon.clear()
  25.     mon.setTextColor(colors.black)
  26.     mon.setCursorPos(2,2)
  27.     mon.write("aus")
  28.     sleep(0.5)
  29.     local event, side, X, Y = os.pullEvent("monitor_touch")
  30.     if X >= 01 and X <= 05 and Y >= 1 and Y <= 4 and side == side then
  31.         rs.setOutput("bottom", false)
  32.         an()
  33.     end
  34. end
  35.  
  36. aus()
  37.  
  38.    
  39.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement