Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.08 KB | None | 0 0
  1. --Mining turtle at level 13, 12, 11 and dump into chest at each path
  2. --Written by weezeranon for Boozecraft - Crackpack server
  3. --Ladders in slot 1
  4. --At least 15 Chests in slot 2
  5.  
  6. function getReady(top) --Dig hole to layer 13
  7.     height = top
  8.     turtle.select(1) --Make sure ladders are in slot 1
  9.     while height > 13 do
  10.         turtle.digDown()
  11.         turtle.down()
  12.         height = height - 1
  13.         turtle.dig()
  14.         if turtle.place()==false then
  15.             break
  16.         end
  17.                
  18.     end
  19. end
  20.  
  21.  
  22. function digChannels()
  23.     for i = 1,20 do --Layer 13 row
  24.             turtle.dig()
  25.             turtle.forward()
  26.     end
  27.    
  28.     --turn around
  29.     turtle.digDown()
  30.     turtle.down()
  31.     turtle.turnLeft()
  32.     turtle.turnLeft()
  33.  
  34.     for i = 1,20 do --Layer 12 row
  35.             turtle.dig()
  36.             turtle.forward()
  37.     end
  38.    
  39.     --turn around
  40.     turtle.digDown()
  41.     turtle.down()
  42.     turtle.turnLeft()
  43.     turtle.turnLeft()
  44.  
  45.     for i = 1,20 do --Layer 11 row
  46.             turtle.dig()
  47.             turtle.forward()
  48.     end    
  49.    
  50.     --place chest and empty items
  51.     turtle.dig()
  52.     turtle.digDown()
  53.     turtle.down()
  54.     turtle.dig()
  55.     turtle.select(2) --Make sure chests are in slot 2
  56.     turtle.place() --Place chest
  57.    
  58.     for i = 3,16 do
  59.         turtle.select(i)
  60.         turtle.drop()
  61.     end
  62.    
  63. end
  64.  
  65. function returnToMain()
  66.     turtle.up()
  67.     turtle.up()
  68.     turtle.turnLeft()
  69.     turtle.turnLeft()
  70.     for i = 1,20 do
  71.         turtle.forward()
  72.     end
  73. end
  74.  
  75. function moveToNext()
  76.     turtle.turnRight()
  77.     turtle.forward()
  78.     turtle.forward()
  79.     turtle.forward()
  80.     turtle.turnRight()
  81. end
  82.  
  83.  
  84. x = 0
  85. y = 0
  86. z = 0
  87. --
  88. --
  89. --Start of program
  90. --
  91. --
  92. --
  93.  
  94. print("What is the Y coordinate of the Turtle?")
  95. write("Y: ")
  96. local input = tonumber(read())
  97.  
  98. y = input
  99. climb = y - 13
  100. turtle.forward()
  101. getReady(y)
  102. --y = 13
  103. digChannels() --Dig main channel
  104.  
  105. turtle.up()
  106. turtle.up()
  107. turtle.turnLeft()
  108. digChannels()
  109.  
  110. for i = 1,6 do
  111.     returnToMain()
  112.     moveToNext()
  113.     digChannels()
  114. end
  115.  
  116. returnToMain()
  117. digChannels() --Start digging the right side
  118.  
  119. for i = 1,6 do
  120.     returnToMain()
  121.     moveToNext()
  122.     digChannels()
  123. end
  124.  
  125. returnToMain()
  126. turtle.turnLeft()
  127.  
  128. for i = 1,20 do --Exit to surface
  129.     turtle.forward()
  130. end
  131.  
  132. for i = 1,climb do
  133.     turtle.up()
  134. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement