Advertisement
Goldman92

msUp40

Dec 21st, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.44 KB | None | 0 0
  1.  
  2.  
  3. local lvl = 40
  4.  
  5. --count =  tArgs[1]
  6.  
  7. function fuel()
  8. print( "checkfuel" )
  9. if noFuel() then
  10.     local f = 1
  11.     turtle.select(f)
  12.     while not turtle.refuel() do
  13.         f = f + 1
  14.         turtle.select(f)
  15.         end
  16. end
  17. print("leaving checkfuel")
  18. end
  19.  
  20. function noFuel()
  21. print( turtle.getFuelLevel())
  22.     if turtle.getFuelLevel() < 5 then
  23.     return true
  24.     else
  25.     return false
  26. end
  27. end
  28.  
  29. function moveDown(count)
  30. for v = 1, count, 1 do
  31.     fuel()
  32.     turtle.digDown()
  33.     turtle.down()
  34.     end
  35. end
  36.  
  37. function moveUp(count)
  38. for vi = 1, count, 1 do
  39.     fuel()
  40.     turtle.digUp()
  41.     turtle.up()
  42.     end
  43. end
  44.  
  45. function moveBack(count)
  46. for vii = 1, count, 1 do
  47.     fuel()
  48.     if not turtle.back() then
  49.         turtle.turnRight()
  50.         turtle.turnRight()
  51.         moveForward(1)
  52.         turtle.turnRight()
  53.         turtle.turnRight()
  54.        
  55.     end
  56.     end
  57. end
  58. function getCobble()
  59.     cob = 1
  60.     turtle.select(cob)
  61.     if turtle.getItemCount(cob) <2 then
  62.     cob = cob + 1
  63.     end
  64.     turtle.select(cob)
  65.     end
  66.  
  67. function moveForward(count)
  68. for iv = 1, count, 1 do
  69. print( "about to moveforward" )
  70.     fuel()
  71.     turtle.dig()
  72.     turtle.forward()
  73.     end
  74. end
  75.  
  76. function sCaseDown(count)
  77.  
  78. for iii = 1, count, 1 do
  79.     fuel()
  80.     moveDown(1)
  81.     turtle.digDown()
  82.     getCobble()
  83.     turtle.placeDown()
  84.     turtle.turnLeft()
  85.     for ii = 1, 2, 1 do
  86.         fuel()
  87.         moveForward(1)
  88.         turtle.digDown()
  89.         getCobble()
  90.         turtle.placeDown()
  91.         turtle.turnRight()
  92.         turtle.turnRight()
  93.         turtle.forward()
  94.     end
  95.     if math.fmod(iii, 5) == 0 then
  96.     turtle.select(16)
  97.     turtle.place()
  98.     end
  99.     turtle.turnRight()
  100.     moveForward(1)
  101.    
  102.     for i = 1, 3, 1 do
  103.         fuel()
  104.         turtle.turnLeft()
  105.         turtle.dig()
  106.         turtle.turnRight()
  107.         turtle.turnRight()
  108.         turtle.dig()
  109.         if i < 3 then
  110.             turtle.turnLeft()
  111.             turtle.dig()
  112.             turtle.forward()
  113.             else
  114.             turtle.turnRight()
  115.             turtle.forward()
  116.             turtle.forward()
  117.             turtle.turnRight()
  118.             turtle.turnRight()
  119.         end
  120.     end
  121. end
  122. end
  123.  
  124. function sCaseUp(count)
  125.     fuel()
  126.     for ix = 1, count, 1 do
  127.         for viii = 1, 5, 1 do
  128.         fuel()
  129.         moveForward(1)
  130.         turtle.turnLeft()
  131.         turtle.dig()
  132.         turtle.turnRight()
  133.         turtle.turnRight()
  134.         turtle.dig()
  135.        
  136.         turtle.turnLeft()
  137.         end
  138.        
  139.         turtle.turnLeft()
  140.         getCobble()
  141.         turtle.place()
  142.         turtle.turnRight()
  143.         turtle.turnRight()
  144.         turtle.place()
  145.         turtle.turnLeft()
  146.         moveBack(1)
  147.         getCobble()
  148.         turtle.place()
  149.         moveBack(3)
  150.         moveUp(1)
  151.         turtle.turnLeft()
  152.         turtle.dig()
  153.         turtle.turnRight()
  154.         turtle.turnRight()
  155.         turtle.dig()
  156.        
  157.         turtle.turnLeft()
  158.    
  159.     end
  160. end
  161. sCaseUp(lvl)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement