Advertisement
Guest User

startup

a guest
Oct 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. numSlot=0
  2. distance=0
  3. while distance<500 do
  4.  for x,1,height do
  5.    if turtle.detect() then
  6.     turtle.dig()
  7.    end
  8.    if turtle.detectDown() then
  9.      turtle.digDown()
  10.    end
  11.    
  12.    turtle.down()
  13.   end
  14.  
  15.   if not suck() then
  16.     for x,1,height do
  17.     turtle.up()
  18.   end
  19.  
  20.   turtle.turnLeft()
  21.   turtle.turnLeft()  
  22.   booln = 0
  23.     while  not turtle.detect() do
  24.       turtle.forward()
  25.     end
  26.     for slot,4,16 do
  27.       turtle.select(slot)
  28.       turtle.drop()
  29.     end
  30.  
  31.     turtle.select(1)
  32.     turtle.suckUp()
  33.     turtle.select(2)
  34.     turtle.suckUp()
  35.     turtle.select(3)
  36.     turtle.suckUp()
  37.     turtle.turnLeft()
  38.     turtle.turnLeft()
  39.     for dist,1,distance do
  40.       turtle.forward()
  41.     end
  42.     for x,1,height do
  43.       turtle.down()
  44.     end
  45.     suck()
  46. end
  47.  if not turtle.detect() and turtle.getItemCount(1)>1 then
  48.    turtle.select(1)
  49.    turtle.placeDown()
  50.  end
  51.   for x,1,height do
  52.   turtle.up()
  53.  end  
  54.  
  55. fuelUP()
  56. end
  57.  
  58. function suck ()
  59. turtle.select(4)
  60. count=0
  61.   for c,1,height do
  62.     for slot,4,16 do
  63.      count=count + turtle.getItemCount(slot)
  64.      end
  65.      if count>704 then
  66.      return false
  67.      end
  68.     turtle.suckDown()
  69.   end
  70. return true
  71. end
  72. function fuelUP ()
  73. if turtle.getFuelLevel()<=16 then
  74. turtle.select(2)
  75. if turtle.getItemCount(2)>1 then
  76. turtle.refuel(1)
  77. return true
  78. end
  79. end
  80. return false
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement