Advertisement
xKevinn

Untitled

Feb 14th, 2013
36
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 then -- if the desired block is infront
  7.                            if i == 1
  8.                                 turtle.dig()
  9.                                 turtle.forward()
  10.                                 turtle.digUp()
  11.                                 turtle.up()
  12.                                 turtle.digUp()
  13.                                 turtle.up()
  14.                                 turtle.digUp()
  15.                                 turtle.up()
  16.                                 turtle.digUp()
  17.                                 turtle.up()
  18.                                 turtle.down()
  19.                                 turtle.down()
  20.                                 turtle.down()
  21.                                 turtle.down()
  22.                            else if i == 2 then
  23.                                 turtle.dig()
  24.                                 turtle.forward()
  25.                                 print("Got into the 2nd i!")
  26.                           else
  27.                                 print ("i:"..i)
  28.             end
  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