Advertisement
colhaydutu

Untitled

Apr 20th, 2024 (edited)
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. local redstoneside = "front"
  2. local monitor = peripheral.wrap("top")
  3. local redstone = peripheral.wrap(redstoneside)
  4.  
  5. local rule1 = "*-Keep it friendly and nontoxic"
  6. local rule2 = "*-No griefing or stealing"
  7. local rule3 = "*-No advertising"
  8. local rule4 = "*-No hacking or cheating"
  9. local rule5 = "*-Don't be racist or sexist"
  10.  
  11. local function drawScreen()
  12. term.redirect(monitor)
  13. monitor.clear()
  14. monitor.setTextScale(1.2)
  15. paintutils.drawLine(2, 2, 18, 2, colors.orange)
  16. paintutils.drawLine(25, 2, 38, 2, colors.orange)
  17. paintutils.drawLine(2, 14, 38, 14, colors.orange)
  18. paintutils.drawLine(2, 18, 2, 3, colors.orange)
  19. paintutils.drawLine(38, 18, 38, 2, colors.orange)
  20.  
  21. monitor.setBackgroundColor(colors.white)
  22. monitor.setTextColor(colors.black)
  23. monitor.setCursorPos(16, 2)
  24. monitor.write("[ RULES ]")
  25.  
  26. monitor.setCursorPos(4, 4)
  27. monitor.write(rule1)
  28.  
  29. monitor.setCursorPos(4, 6)
  30. monitor.write(rule2)
  31.  
  32. monitor.setCursorPos(4, 8)
  33. monitor.write(rule3)
  34.  
  35. monitor.setCursorPos(4, 10)
  36. monitor.write(rule4)
  37.  
  38. monitor.setCursorPos(4, 12)
  39. monitor.write(rule5)
  40.  
  41. monitor.setCursorPos(10, 17)
  42. monitor.write("WELCOME TO PIXELMODS")
  43. end
  44.  
  45. drawScreen()
  46.  
  47. while true do
  48. local event, side, x, y = os.pullEvent("monitor_touch")
  49.  
  50. if x >= 1 and x <= 40 and y >= 1 and y <= 40 then
  51. drawScreen()
  52. end
  53.  
  54. local _, redstoneSide, redstoneState = os.pullEvent("redstone")
  55. if redstoneSide == redstoneside and redstoneState == 1 then
  56. drawScreen()
  57. print("Hello world!")
  58. end
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement