Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local redstoneside = "front"
- local monitor = peripheral.wrap("top")
- local redstone = peripheral.wrap(redstoneside)
- local rule1 = "*-Keep it friendly and nontoxic"
- local rule2 = "*-No griefing or stealing"
- local rule3 = "*-No advertising"
- local rule4 = "*-No hacking or cheating"
- local rule5 = "*-Don't be racist or sexist"
- local function drawScreen()
- term.redirect(monitor)
- monitor.clear()
- monitor.setTextScale(1.2)
- paintutils.drawLine(2, 2, 18, 2, colors.orange)
- paintutils.drawLine(25, 2, 38, 2, colors.orange)
- paintutils.drawLine(2, 14, 38, 14, colors.orange)
- paintutils.drawLine(2, 18, 2, 3, colors.orange)
- paintutils.drawLine(38, 18, 38, 2, colors.orange)
- monitor.setBackgroundColor(colors.white)
- monitor.setTextColor(colors.black)
- monitor.setCursorPos(16, 2)
- monitor.write("[ RULES ]")
- monitor.setCursorPos(4, 4)
- monitor.write(rule1)
- monitor.setCursorPos(4, 6)
- monitor.write(rule2)
- monitor.setCursorPos(4, 8)
- monitor.write(rule3)
- monitor.setCursorPos(4, 10)
- monitor.write(rule4)
- monitor.setCursorPos(4, 12)
- monitor.write(rule5)
- monitor.setCursorPos(10, 17)
- monitor.write("WELCOME TO PIXELMODS")
- end
- drawScreen()
- while true do
- local event, side, x, y = os.pullEvent("monitor_touch")
- if x >= 1 and x <= 40 and y >= 1 and y <= 40 then
- drawScreen()
- end
- local _, redstoneSide, redstoneState = os.pullEvent("redstone")
- if redstoneSide == redstoneside and redstoneState == 1 then
- drawScreen()
- print("Hello world!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement