Advertisement
xKevinn

Untitled

Feb 14th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local invslot = 2
  2. while true do
  3.     if turtle.detectDown() == true then /if there is a block below, it will do this
  4.         for i=1, invslot do /switches through the slots between 1 and 2
  5.             turtle.select(i)
  6.             if turtle.compare() == true and i == 1 then /if the desired block is infront
  7.                 turtle.dig()
  8.                 turtle.forward()
  9.                 turtle.digUp()
  10.                 turtle.up()
  11.                 turtle.digUp()
  12.                 turtle.up()
  13.                 turtle.digUp()
  14.                 turtle.up()
  15.                 turtle.digUp()
  16.                 turtle.up()
  17.                 turtle.down()
  18.                 turtle.down()
  19.                 turtle.down()
  20.                 turtle.down()
  21.             elseif turtle.compare() == true and i == 2 then /if the desired block is infront
  22.             if i == 2 then
  23.                 print("Got into the 2nd i!")
  24.             else
  25.                 print ("i:"..i)
  26.             end
  27.                 turtle.dig()
  28.                 turtle.forward()
  29.             end
  30.         end
  31.             if turtle.compare() == false then /if the block infront is NOT the desired block
  32.                 while turtle.compare() == false and turtle.detectDown() == true do /while the block infront is not a desired block AND there is a block underneath
  33.                     turtle.forward()
  34.                     if turtle.detect() == true then /if it detects a block infront of it
  35.                         turtle.turnLeft()
  36.                         turtle.forward()
  37.                     else
  38.                         turtle.forward()
  39.                     end
  40.                 end
  41.             end
  42.     else
  43.     end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement