Advertisement
milkshake

Tekkit Welcome Screen

Jun 22nd, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.72 KB | None | 0 0
  1. -- Tekkit Welcome Screen
  2. -- Custom monitor program 0-0-3
  3. -- Works with: Advanced Computer & Monitor
  4. -- Environment Tested: Minecraft 1.6.4 Computer Craft version 1.5
  5. -- By RCMilkshakebunny @
  6. -- Download this file here >> http://pastebin.com/dUxyb3uX
  7.  
  8. -- ##########################
  9. -- DEFINE VARIABLES -- BEGIN
  10.  
  11. -- Define peripheral monitor side
  12. m = peripheral.wrap("top")
  13.  
  14. -- DEFINE VARIABLES -- END
  15. -- ##########################
  16.  
  17. -- ##########################
  18. -- FUNCTIONS - BEGIN
  19.  
  20. -- set the cursor position on the monitor ready to write
  21. -- in this case 1,1 means the first line at the first character. so for western based code that would be TOP,LEFT
  22. -- if we were to put (5,10) then the cursor would begin at the 5th line down and the 10th character position in from the left
  23. -- in this case the function requires the value to be given in the call
  24. function cursor(p1,p2)
  25.   m.setCursorPos(p1,p2)
  26. end
  27.  
  28. -- clear any content on the monitor function
  29. function clearMon()
  30.   m.clear()
  31. end
  32.  
  33. -- set text color function
  34. function textColor(setTo)
  35. -- set the color the text will be
  36. -- in this case blue
  37. -- the choices: white | orange | magenta | lightBlue | yellow | lime | pink | gray
  38. --   contd.. | lightGray | cyan | purple | blue | brown | green | red | black
  39. -- you can also reference colors by a 'decimal value' without the requirement of the use of 'colors'
  40. -- an example of referencing a color for text by decimal is
  41. -- m.setTextColor(512) and this would produce the same result as m.setTextColor(colors.cyan)
  42. -- m.setTextColor(colors.blue) -- << basic usage
  43.   m.setTextColor(setTo)-- << dynamic usage
  44. end
  45.  
  46. -- write to monitor function
  47. function monitorWrite(txt)
  48.   m.write(txt)
  49. end
  50.  
  51. -- monitor set new line
  52. function nl()
  53.   local _,cY= m.getCursorPos()
  54.   m.setCursorPos(1,cY+1)
  55. end
  56.  
  57. -- Monitor Center text
  58. function monCenterText(text)
  59.   local x,y = m.getSize()
  60.   local x2,y2 = m.getCursorPos()
  61.   m.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
  62.   m.write(text)
  63. end
  64.  
  65. --initialise monitor function
  66. function mInit()
  67.   clearMon()
  68.   cursor(1,1)
  69.   textColor(512)
  70. end
  71.  
  72. -- ##########################
  73. -- TERMINAL FUNCTIONS -- BEGIN
  74.  
  75. -- clears terminal
  76. function clearTerm()
  77.   term.clear()
  78. end
  79.  
  80. -- writes to the terminal
  81. function writeTerm(termtext)
  82.   term.write(termtext)
  83. end
  84.  
  85. -- set terminal cursor position -- Dynamic
  86. function termCursor(p1,p2)
  87.   term.setCursorPos(p1,p2)
  88. end
  89.  
  90. -- terminal set new line
  91. function term_nl()
  92.   local _,cY= term.getCursorPos()
  93.   term.setCursorPos(1,cY+1)
  94. end
  95.  
  96. -- TERMINAL FUNCTIONS -- END
  97. -- ##########################
  98.  
  99. -- ##########################
  100. -- PAGES  BEGIN
  101. function infoSec()
  102.   nl()
  103.   nl()
  104.   monitorWrite("                     Welcome to RC-Tekkit  ")
  105.   nl()
  106.   monitorWrite("                  .........................")
  107.   nl()
  108.   nl()
  109.   monitorWrite(" RC-Tekkit Hub : /hub ")
  110.   nl()
  111.   monitorWrite(" Game Type : Command to join ")
  112.   nl()
  113.   monitorWrite(" - Survival : /survival (Closed) ")
  114.   nl()
  115.   monitorWrite(" - Factions : /factions (Closed) ")
  116.   nl()
  117.   monitorWrite(" - Player vs Player : /pvp (Closed) ")
  118.   nl()
  119.   monitorWrite(" - Games & Puzzles : /games (CLosed) ")
  120. end
  121.  
  122. function page1()
  123.   monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
  124.   nl()
  125.   monitorWrite("  _______  ______  _  __ _  __ _____  _______   ")
  126.   nl()
  127.   monitorWrite(" |__   __||  ____|| |/ /| |/ /|_   _||__   __|  ")
  128.   nl()
  129.   monitorWrite("    | |   | |__   | ' / | ' /   | |     | |     ")
  130.   nl()
  131.   monitorWrite("    | |   |  __|  |  <  |  <    | |     | |     ")
  132.   nl()
  133.   monitorWrite("    | |   | |____ | . \\ | . \\  _| |_    | |     ")
  134.   nl()
  135.   monitorWrite("    |_|   |______||_|\\_\\|_|\\_\\|_____|   |_|     ")
  136.   nl()
  137.   nl()
  138.   monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
  139.   infoSec()
  140. end
  141.  
  142. function page2()
  143.   monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
  144.   nl()
  145.   monitorWrite("    _______  ______  _  __ _  __ _____  _______   ")
  146.   nl()
  147.   monitorWrite("   |__   __||  ____|| |/ /| |/ /|_   _||__   __|  ")
  148.   nl()
  149.   monitorWrite("      | |   | |__   | ' / | ' /   | |     | |     ")
  150.   nl()
  151.   monitorWrite("      | |   |  __|  |  <  |  <    | |     | |     ")
  152.   nl()
  153.   monitorWrite("      | |   | |____ | . \\ | . \\  _| |_    | |     ")
  154.   nl()
  155.   monitorWrite("      |_|   |______||_|\\_\\|_|\\_\\|_____|   |_|     ")
  156.   nl()
  157.   nl()
  158.   monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
  159.   infoSec()
  160. end
  161.  
  162. function page3()
  163.   monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
  164.   nl()
  165.   monitorWrite("       _______  ______  _  __ _  __ _____  _______   ")
  166.   nl()
  167.   monitorWrite("     |__   __||  ____|| |/ /| |/ /|_   _||__   __|  ")
  168.   nl()
  169.   monitorWrite("        | |   | |__   | ' / | ' /   | |     | |     ")
  170.   nl()
  171.   monitorWrite("        | |   |  __|  |  <  |  <    | |     | |     ")
  172.   nl()
  173.   monitorWrite("        | |   | |____ | . \\ | . \\  _| |_    | |     ")
  174.   nl()
  175.   monitorWrite("        |_|   |______||_|\\_\\|_|\\_\\|_____|   |_|     ")
  176.   nl()
  177.   nl()
  178.   monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
  179.   infoSec()
  180. end
  181.  
  182. function page4()
  183.   monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
  184.   nl()
  185.   monitorWrite("        _______  ______  _  __ _  __ _____  _______   ")
  186.   nl()
  187.   monitorWrite("       |__   __||  ____|| |/ /| |/ /|_   _||__   __|  ")
  188.   nl()
  189.   monitorWrite("          | |   | |__   | ' / | ' /   | |     | |     ")
  190.   nl()
  191.   monitorWrite("          | |   |  __|  |  <  |  <    | |     | |     ")
  192.   nl()
  193.   monitorWrite("          | |   | |____ | . \\ | . \\  _| |_    | |     ")
  194.   nl()
  195.   monitorWrite("          |_|   |______||_|\\_\\|_|\\_\\|_____|   |_|     ")
  196.   nl()
  197.   nl()
  198.   monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
  199.   infoSec()
  200. end
  201.  
  202. function page5()
  203.   monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
  204.   nl()
  205.   monitorWrite("          _______  ______  _  __ _  __ _____  _______   ")
  206.   nl()
  207.   monitorWrite("         |__   __||  ____|| |/ /| |/ /|_   _||__   __|  ")
  208.   nl()
  209.   monitorWrite("            | |   | |__   | ' / | ' /   | |     | |     ")
  210.   nl()
  211.   monitorWrite("            | |   |  __|  |  <  |  <    | |     | |     ")
  212.   nl()
  213.   monitorWrite("            | |   | |____ | . \\ | . \\  _| |_    | |     ")
  214.   nl()
  215.   monitorWrite("            |_|   |______||_|\\_\\|_|\\_\\|_____|   |_|     ")
  216.   nl()
  217.   nl()
  218.   monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
  219.   infoSec()
  220. end
  221.  
  222. function page6()
  223.   monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
  224.   nl()
  225.   monitorWrite("            _______  ______  _  __ _  __ _____  _______   ")
  226.   nl()
  227.   monitorWrite("           |__   __||  ____|| |/ /| |/ /|_   _||__   __|  ")
  228.   nl()
  229.   monitorWrite("              | |   | |__   | ' / | ' /   | |     | |     ")
  230.   nl()
  231.   monitorWrite("              | |   |  __|  |  <  |  <    | |     | |     ")
  232.   nl()
  233.   monitorWrite("              | |   | |____ | . \\ | . \\  _| |_    | |     ")
  234.   nl()
  235.   monitorWrite("              |_|   |______||_|\\_\\|_|\\_\\|_____|   |_|     ")
  236.   nl()
  237.   nl()
  238.   monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
  239. infoSec()
  240. end
  241.  
  242. function page7()
  243.   monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
  244.   nl()
  245.   monitorWrite("              _______  ______  _  __ _  __ _____  _______   ")
  246.   nl()
  247.   monitorWrite("             |__   __||  ____|| |/ /| |/ /|_   _||__   __|  ")
  248.   nl()
  249.   monitorWrite("                | |   | |__   | ' / | ' /   | |     | |     ")
  250.   nl()
  251.   monitorWrite("                | |   |  __|  |  <  |  <    | |     | |     ")
  252.   nl()
  253.   monitorWrite("                | |   | |____ | . \\ | . \\  _| |_    | |     ")
  254.   nl()
  255.   monitorWrite("                |_|   |______||_|\\_\\|_|\\_\\|_____|   |_|     ")
  256.   nl()
  257.   nl()
  258.   monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
  259.   infoSec()
  260. end
  261.  
  262. function page8()
  263.   monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
  264.   nl()
  265.   monitorWrite("                _______  ______  _  __ _  __ _____  _______   ")
  266.   nl()
  267.   monitorWrite("               |__   __||  ____|| |/ /| |/ /|_   _||__   __|  ")
  268.   nl()
  269.   monitorWrite("                  | |   | |__   | ' / | ' /   | |     | |     ")
  270.   nl()
  271.   monitorWrite("                  | |   |  __|  |  <  |  <    | |     | |     ")
  272.   nl()
  273.   monitorWrite("                  | |   | |____ | . \\ | . \\  _| |_    | |     ")
  274.   nl()
  275.   monitorWrite("                  |_|   |______||_|\\_\\|_|\\_\\|_____|   |_|     ")
  276.   nl()
  277.   nl()
  278.   monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
  279.   infoSec()
  280. end
  281.  
  282.   function leftRight()
  283.     mInit()
  284.     page1()
  285.     sleep(0.1)
  286.     mInit()
  287.     page2()
  288.     sleep(0.1)
  289.     mInit()
  290.     page3()
  291.     sleep(0.1)
  292.     mInit()
  293.     page4()
  294.     sleep(0.1)
  295.     mInit()
  296.     page5()
  297.     sleep(0.1)
  298.     mInit()
  299.     page6()
  300.     sleep(0.1)
  301.     mInit()
  302.     page7()
  303.     sleep(0.1)
  304.     mInit()
  305.     page8()
  306.     sleep(0.1)
  307.   end
  308.  
  309.   function rightLeft()
  310.     mInit()
  311.     page8()
  312.     sleep(0.1)
  313.     mInit()
  314.     page7()
  315.     sleep(0.1)
  316.     mInit()
  317.     page6()
  318.     sleep(0.1)
  319.     mInit()
  320.     page5()
  321.     sleep(0.1)
  322.     mInit()
  323.     page4()
  324.     sleep(0.1)
  325.     mInit()
  326.     page3()
  327.     sleep(0.1)
  328.     mInit()
  329.     page2()
  330.     sleep(0.1)
  331.     mInit()
  332.     page1()
  333.     sleep(0.1)
  334.   end  
  335.  
  336. -- PAGES - END
  337. -- ##########################
  338.  
  339. -- ##########################
  340. -- SCENES -- BEGIN
  341.  
  342.   function scene1()
  343.     leftRight()
  344.     rightLeft()  
  345.     leftRight()
  346.     rightLeft()
  347.     leftRight()
  348.     rightLeft()  
  349.     leftRight()
  350.     rightLeft()
  351.   end
  352.  
  353. -- SCENES -- END
  354. -- ##########################
  355.  
  356. -- the program function
  357. function program()
  358.  
  359. -- ##########################
  360. -- PROGRAM OUTPUT - BEGIN
  361.  
  362.   clearTerm()
  363.   termCursor(1,1)
  364.   writeTerm("Program Running")
  365.   term_nl()
  366.  
  367.   while true do
  368.     scene1()
  369.   end
  370.  
  371. -- Test Output to Monitor
  372. --  monitorWrite("Monitor write completed")
  373. --  nl()
  374. --  monCenterText("Centered Text")
  375. --  nl()
  376.  
  377. -- Test output to Terminal
  378. --  writeTerm("Terminal write completed")
  379. --  term_nl()
  380.  
  381. -- PROGRAM OUTPUT - END
  382. -- ##########################
  383. end
  384.  
  385. -- FUNCTIONS -- END
  386. -- ##########################
  387.  
  388. -- ############################################################
  389. -- ############################################################
  390.  
  391.  
  392. -- ##########################
  393. -- SEQUENCE -- BEGIN
  394.  
  395. mInit()
  396. program()
  397.  
  398.  
  399. -- SEQUENCE -- END
  400. -- ##########################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement