Mackan90096

MackCode

May 24th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. --[[ MackCode ]]--
  2. Author= "Mackan90096"
  3. Version = "1.0"
  4.  
  5.  
  6. function cls()
  7.     term.clear()
  8. end
  9.  
  10. function txtCol(colcode)
  11.     term.setTextColor(colcode)
  12. end
  13.  
  14. function bgCol(col)
  15.     term.setBackgroundColor(colcode)
  16. end
  17.  
  18. function bgcolc(colcode)
  19.     term.setBackgroundColor(colcode)
  20.     cls()
  21. end
  22.  
  23. function getVer()
  24.     print("MackCode Version "..Version)
  25.     print("Author: "..Author)
  26. end
  27.  
  28. function saveFile(filename, mode, text)
  29. local file = fs.open(filename, mode)
  30. file.write(text)
  31. file.close()
  32. end
  33.  
  34. function del(filename)
  35.     fs.delete(filename)
  36. end
  37.  
  38. function size()
  39. w, h = term.getSize()
  40. end
  41.  
  42. function cursor(x, y)
  43.     term.setCursorPos(x,y)
  44. end
  45.  
  46. function centerPrint(string, X, Y)
  47.     size()
  48.     term.setCursorPos(math.floor(w-string.len(string))/X, Y)
  49.     print(string)
  50. end
  51.  
  52. function EasterEgg(timeS)
  53.     times = 0
  54. while true do
  55.     if times <= timeS then
  56.         txtCol(colors.black)
  57. bgcolc(colors.lime)
  58. centerPrint(tostring(times), 2,2)
  59. sleep(0.05)
  60. bgcolc(colors.yellow)
  61. centerPrint(tostring(times), 2,2)
  62. sleep(0.05)
  63. bgcolc(colors.blue)
  64. centerPrint(tostring(times), 2,2)
  65. sleep(0.05)
  66. bgcolc(colors.red)
  67. centerPrint(tostring(times), 2,2)
  68. sleep(0.05)
  69. bgcolc(colors.orange)
  70. centerPrint(tostring(times), 2,2)
  71. times = times+1
  72. else
  73.     if time2 <= 2 then
  74.     sleep(1)
  75.     cls()
  76.     bgcolc(colors.white)
  77.     txtCol(colors.black)
  78.     centerPrint("Thank you!", 2,2)
  79.     sleep(1)
  80.     centerPrint("For using MackCode", 2,4)
  81.     time2 = time2 +1
  82. else
  83.     times = 0
  84.     EasterEgg()
  85.  
  86. end
  87. end
  88. end
  89. end
Advertisement
Add Comment
Please, Sign In to add comment