Advertisement
colhaydutu

steampunk elevator C screen

Apr 16th, 2024 (edited)
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. local monitor = peripheral.wrap("front")
  2. local redstoneOutput = "back"
  3.  
  4. local function drawScreen()
  5. term.redirect(monitor)
  6. monitor.clear()
  7. monitor.setBackgroundColor(colors.lightGray)
  8. monitor.setTextScale(0.9)
  9. paintutils.drawBox(2, 4, 13, 8, colors.red)
  10.  
  11. monitor.setCursorPos(4, 6)
  12. monitor.setBackgroundColor(colors.blue)
  13. monitor.setTextColor(colors.white)
  14. monitor.write("[ Call ]")
  15. end
  16.  
  17. drawScreen()
  18.  
  19. while true do
  20. local event, side, x, y = os.pullEvent("monitor_touch")
  21.  
  22. if x >= 1 and x <= 10 and y >= 4 and y <= 6 then
  23. redstone.setOutput(redstoneOutput, true)
  24. sleep(2)
  25. redstone.setOutput(redstoneOutput, false)
  26. end
  27.  
  28. drawScreen()
  29. end
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement