Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local title = "XtreamTech Official Rules"
- local footers = {
- "If caught breaking any of these rules you will face"
- , "a Temp-Mute, Mute, Temp-Ban, Ban, or Jail"
- }
- local rules = {
- "No griefing"
- , "No PVP"
- , "No Spamming Chat"
- , "No Excessive Swearing"
- , "Don't build within 300 blocks of Spawn"
- , "No overflowing or leaking machines/pipes"
- , "Don't ask Staff for items/teleports/commands"
- , "X-ray and other Hacks are strictly BANNED"
- , "No Ugly Buildings or 1x1 Towers"
- , "Max Quarry size is 20x20"
- }
- function main()
- term.clear()
- local monitor, _, side, width, height, i, padding, rule, firstLine, x, y, footer
- firstLine = 2
- for _, side in pairs(rs.getSides()) do
- if peripheral.isPresent(side) then
- if peripheral.getType(side) == "monitor" then
- monitor = peripheral.wrap(side)
- end
- end
- end
- if monitor == nil then
- print("Please attach a monitor to any side")
- return
- end
- width, height = monitor.getSize()
- monitor.clear()
- monitor.setCursorPos(1, firstLine)
- for i = 1, width do
- monitor.write("=")
- end
- padding = (width / 2) - (#title / 2)
- monitor.setCursorPos(1, firstLine + 2)
- for i = 1, padding do
- monitor.write(" ")
- end
- monitor.write(title)
- monitor.setCursorPos(1, firstLine + 4)
- for i = 1, width do
- monitor.write("=")
- end
- for _, rule in pairs(rules) do
- monitor.setCursorPos(1, firstLine + 6 + _)
- monitor.write(" " .. rule)
- end
- x, y = monitor.getCursorPos()
- for _, footer in pairs(footers) do
- monitor.setCursorPos(1, y + 3 + _)
- padding = (width / 2) - (#footer / 2)
- for i = 1, padding do
- monitor.write(" ")
- end
- monitor.write(footer)
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement