Advertisement
jille_Jr

CC: Turtle xmas desc

Dec 23rd, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. --[[
  2. I want to again wish you a merry christmas
  3. even though you probably read this after
  4. christmas day :)
  5. I hope that you enjoy this gift.
  6.  
  7. I'd like to thank you for accepting me onto
  8. this server! Not just for white listing me,
  9. but for being friendly and kind.
  10. It has really made me want to come back and
  11. be a regular player on this server. :D
  12. ]]-- code is below
  13.  
  14. -- This just prints out a small message.
  15. -- Nothing fancy
  16.  
  17. -- Size of screen
  18. local w,h = term.getSize()
  19.  
  20. -- Get rid of the "CraftOS 1.6"
  21. term.clear()
  22.  
  23. -- The message itself
  24. local msg = {
  25.     "------[ Merry Christmas Hockey! ]------",
  26.     "",
  27.     "I gift you this present, containing",
  28.     "a card and the turtle computer holding",
  29.     "the card.",
  30.     "",
  31.     "If you like programming or would like",
  32.     "to start with it, then this turtle is",
  33.     "a great start!",
  34.     "",
  35.     "Other than that, have a wonderful day!",
  36.     "",
  37.     "--[ Press a key to return to shell  ]--",
  38. }
  39.  
  40. -- Loop the message rows
  41. for row = 1,#msg do
  42.     -- Center the text on each line
  43.     local x = math.floor(w/2 - #msg[row]/2)+1
  44.  
  45.     -- Write it out
  46.     term.setCursorPos(x,row)
  47.     term.write(msg[row])
  48. end
  49.  
  50. -- Wait for keyboard input
  51. os.pullEvent("key")
  52. sleep(0)
  53.  
  54. -- Empty screen and make it look like
  55. -- the computer just booted
  56. term.clear()
  57. term.setCursorPos(1,1)
  58. print(os.version())
  59.  
  60. -- EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement