edoreld

Untitled

Mar 7th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. -- Vars
  2.  
  3. north = colors.yellow
  4. east = colors.lime
  5. south = colors.pink
  6. west = colors.gray
  7. up = colors.purple
  8. down = colors.blue
  9.  
  10.  
  11. -- Misc Functions
  12.  
  13. function clearScreen()
  14. term.clear()
  15. term.setCursorPos(1,1)
  16. end
  17.  
  18. -- Setting & Getting functions
  19.  
  20. function getDrills()
  21. clearScreen()
  22. for i=1,8 do
  23. print("Retrieving drill #"..i)
  24. redstone.setBundledOutput("left",colors.lightBlue)
  25. os.sleep(1)
  26. redstone.setBundledOutput("left",0)
  27. os.sleep(1)
  28. end
  29. end
  30.  
  31. function setDrills()
  32. clearScreen()
  33. for i=1,8 do
  34. print ("Deploying drill #"..i)
  35. redstone.setBundledOutput("left",colors.magenta)
  36. os.sleep(1)
  37. redstone.setBundledOutput("left",0)
  38. os.sleep(1)
  39. end
  40. end
  41.  
  42. --function getCells()
  43. -- clearScreen()
  44. -- for i=1,8 do
  45. -- print("Retrieving cell stack #"..i)
  46. -- redstone.setBundledOutput("left",colors.orange)
  47. -- os.sleep(1)
  48. -- redstone.setBundledOutput("left",0)
  49. -- os.sleep(1)
  50. -- end
  51. --end
  52.  
  53. function setCells()
  54. clearScreen()
  55. for i=1,8 do
  56. print("Deploying cell stack #"..i)
  57. redstone.setBundledOutput("left",colors.white)
  58. os.sleep(1)
  59. redstone.setBundledOutput("left",0)
  60. os.sleep(1)
  61. end
  62. end
  63.  
  64. function coverHoles()
  65. clearScreen()
  66. for i=1,64 do
  67. print("Deploying sand #"..i)
  68. redstone.setBundledOutput("left",colors.orange)
  69. os.sleep(1)
  70. redstone.setBundledOutput("left",0)
  71. os.sleep(1)
  72. end
  73. end
  74.  
  75. function mainMiningProgram()
  76. clearScreen()
  77. setDrills()
  78. clearScreen()
  79. for i=1,15 do
  80. clearScreen()
  81. print("Waiting for drills...")
  82. print("Time remaining: "..15-i)
  83. os.sleep(1)
  84. end
  85. setCells()
  86. for i=1,1800 do
  87. clearScreen()
  88. print("Mining...")
  89. print("Time remaining: "..1800-i)
  90. if i % 100 == 0 then
  91. setCells()
  92. end
  93. os.sleep(1)
  94. end
  95. getDrills()
  96. os.sleep(100)
  97. coverHoles()
  98. end
  99.  
  100.  
  101. while true do
  102. redstone.setBundledOutput("left",0)
  103. clearScreen()
  104. print("Frame Ship Menu")
  105. print("==============================")
  106. print("What do you wish to do?")
  107. print("1. Main mining program.")
  108. print("2. Retrieve Drills from Miners")
  109. print("3. Insert Drills into miners")
  110. print("4: Insert cells into pumps")
  111. print("5. Cover holes")
  112. print("6. Initializa navigation system")
  113. print("0. Exit")
  114. write("Command> ")
  115. local choice = read()
  116.  
  117. if (choice == '1') then
  118. mainMiningProgram()
  119. elseif (choice == '2') then
  120. getDrills()
  121. elseif (choice == '3') then
  122. setDrills()
  123. elseif (choice == '4') then
  124. setCells()
  125. elseif (choice == '5') then
  126. coverHoles()
  127. elseif (choice == '0') then
  128. clearScreen()
  129. break
  130. end
  131. end
Advertisement
Add Comment
Please, Sign In to add comment