Advertisement
SuperRavenSn1per

CC Text API

Mar 19th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. function center(txt)
  2.   w, h = term.getSize()
  3.   term.setCursorPos(w / 2 - math.floor(string.len(txt) / 2), h / 2)
  4.   print(txt)
  5. end
  6.  
  7. function slowCenter(txt)
  8.   w, h = term.getSize()
  9.   term.setCursorPos(w / 2 - math.floor(string.len(txt) / 2), h / 2)
  10.   textutils.slowPrint(txt)
  11. end
  12.  
  13. function randomPrint(txt, num)
  14.   w, h = term.getSize()
  15.  
  16.   for i = 1,num do
  17.     term.setCursorPos(math.random(1, w), math.random(1, h))
  18.     print(txt)
  19.   end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement