Advertisement
zeplintwo

CCRules

Jan 30th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. -- pastebin get DdYNsTwA CCRules
  2. --this function will print the text in the centre of the current line of the monitor connected on the specified side
  3. local monitorprintcentred = function(text, size)
  4. local monitor = peripheral.wrap("top")
  5. local maxw, maxh = monitor.getSize() --screen dimensions
  6. local curx, cury = monitor.getCursorPos() --cursor pos
  7. if size == "default" then
  8. monitor.setCursorPos((maxw-#text)/2,cury) --set it to the point where write will make the text centred
  9. else
  10. monitor.setCursorPos((#size),cury) --set it to the point where write will make the text centred
  11. end
  12. monitor.write(text) --write the text
  13. monitor.setCursorPos(curx,cury+1) --return the cursor to the same position on the next line
  14. end
  15. local monitor = peripheral.wrap("top") -- makes 'monitor' refer to the monitor on the left side
  16. local maxw, maxh =monitor.getSize() --screen dimensions
  17. monitor.setTextScale(1.5)
  18. monitor.setCursorPos(1,math.floor(maxh)/6)--set cursor to the start of the upper middle line
  19. monitorprintcentred("Rules", "default")-- TITLE
  20. monitor.setCursorPos(1,1)--set cursor to the start of the upper middle line
  21. monitor.setTextScale(1)
  22. monitor.setCursorPos(1,math.floor(maxh)/2)--set cursor to the start of the upper middle line
  23. monitor.setTextColor(colors.red)
  24. monitorprintcentred("[1] Be respectful","1")
  25. monitorprintcentred("[2] No Grieving of any kind.","1")
  26. monitorprintcentred("[3] No stealing.","1")
  27. monitorprintcentred("[4] No PVP unless agreed to. Ban-able","1")
  28. monitorprintcentred(" offence, No Warnings!","1")
  29. monitorprintcentred("[5a] Please do not build right next to","1")
  30. monitorprintcentred(" other people unless you have","1")
  31. monitorprintcentred(" been invited to do so.","1")
  32. monitorprintcentred("[5b] This also means no building above","1")
  33. monitorprintcentred(" or below someone as well.","1")
  34. monitorprintcentred("[6] Use common sense.","1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement