Advertisement
arismoko

setup

Sep 26th, 2021
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Variable Delcarations
  2. local startY = 0
  3. local endY = 0
  4. local currentY = 0
  5. local input = ""
  6.  
  7. --Function Declarations
  8. function staircase()
  9.     while currentY > endY do
  10.         turtle.select(1)
  11.         while turtle.detect() == true do
  12.             turtle.dig()
  13.         end
  14.         turtle.forward()
  15.         turtle.digUp()
  16.         turtle.digDown()
  17.         turtle.down()
  18.         if not turtle.detectDown() then
  19.             turtle.placeDown()
  20.         end
  21.         if (startY - currentY) % 5 == 0 then
  22.             turtle.select(16)
  23.             turtle.up()
  24.             turtle.turnRight()
  25.             turtle.turnRight()
  26.             turtle.place()
  27.             turtle.turnRight()
  28.             turtle.turnRight()
  29.             turtle.down()
  30.         end
  31.         currentY = currentY - 1
  32.     end
  33. end
  34.  
  35. function clearRoom()
  36.     while turtle.detect() == true do
  37.         turtle.dig()
  38.     end
  39.     turtle.turnLeft()
  40.     for i=1,3,1 do
  41.         while turtle.detect() == true do
  42.             turtle.dig()
  43.         end
  44.     end
  45.     turtle.forward()
  46.     turtle.digUp()
  47.     turtle.turnRight()
  48.     for i=1,2,1 do
  49.         for j=1,5,1 do
  50.             while turtle.detect() == true do
  51.                 turtle.dig()
  52.             end
  53.             turtle.forward()
  54.             turtle.digUp()
  55.         end
  56.         turtle.turnRight()
  57.         while turtle.detect() == true do
  58.             turtle.dig()
  59.         end
  60.         turtle.forward()
  61.         turtle.digUp()
  62.         turtle.turnRight()
  63.         for j=1,5,1 do
  64.             while turtle.detect() == true do
  65.                 turtle.dig()
  66.             end
  67.             turtle.forward()
  68.             turtle.digUp()
  69.         end
  70.         turtle.turnLeft()
  71.         while turtle.detect() == true do
  72.             turtle.dig()
  73.         end
  74.         turtle.forward()
  75.         turtle.digUp()
  76.         turtle.turnLeft()
  77.     end
  78. end
  79.  
  80. function setup()
  81.     --Double Chests
  82.     turtle.turnLeft()
  83.     turtle.forward()
  84.     turtle.forward()
  85.     turtle.forward()
  86.     turtle.turnRight()
  87.     turtle.forward()
  88.     turtle.forward()
  89.     turtle.forward()
  90.     turtle.select(15)
  91.     turtle.place()
  92.     turtle.turnRight()
  93.     turtle.forward()
  94.     turtle.turnLeft()
  95.     turtle.place()
  96.     turtle.turnRight()
  97.     turtle.forward()
  98.     turtle.turnLeft()
  99.     turtle.forward()
  100.     turtle.forward()
  101.     turtle.turnLeft()
  102.     turtle.forward()
  103.     turtle.forward()
  104.     --Redstone Idle System
  105.     turtle.select(1)
  106.     turtle.place()
  107.     turtle.up()
  108.     turtle.select(14)
  109.     turtle.forward()
  110.     turtle.dig()
  111.     turtle.back()
  112.     turtle.place()
  113.     turtle.down()
  114.     --Depositing items
  115.     turtle.turnLeft()
  116.     for i=1,15,1 do
  117.         turtle.select(i)
  118.         turtle.drop(turtle.getItemCount(i))
  119.     end
  120.     turtle.select(1)
  121.     turtle.turnRight()
  122.     turtle.turnRight()
  123. end
  124.  
  125. function run()
  126.     staircase()
  127.     clearRoom()
  128.     setup()
  129. end
  130.  
  131. --Execution
  132. print("---------------------------------")
  133. print("Welcome to the Strip Prep Program")
  134. print("---------------------------------")
  135. print("> Fill slot 16 with torches")
  136. print("> Fill slot 15 with 1-2 chest(s)")
  137. print("> Fill slot 14 with 1 rs torch")
  138. sleep(5)
  139. print("---------------------------------")
  140. print("Please input current Y-Pos:")
  141. startY = tonumber(read())
  142. currentY = startY
  143. print("Please input end Y-Pos:")
  144. endY = tonumber(read())
  145. print("")
  146. print("Current Fuel Level:")
  147. print(turtle.getFuelLevel())
  148. print("Would you like to refuel (y/n)?")
  149. input = io.read()
  150. if input == "y" then
  151.     print("Refueling all of Slot 1 in 5s")
  152.     sleep(5)
  153.     turtle.select(1)
  154.     turtle.refuel(turtle.getItemCount(1))
  155. else
  156.     print("Did not refuel.")
  157. end
  158. print("Beginning Dig!")
  159. run()
  160. print("Ready to Strip Mine!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement