itssnowing

Mining Down snippet

Aug 15th, 2016
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. while digDown do
  2.     local block, what = robot.detectDown()
  3.     print(what)
  4.     if what == "solid" then
  5.       if robot.swingDown() then
  6.         robot.down()
  7.         depth = depth + 1
  8.       else
  9.         digDown = false
  10.       end
  11.     elseif (what == "replaceable") or (what == "liquid") then
  12.       print("I think there's lava!")
  13.       os.sleep(1)
  14.       local drain = robot.compareFluidDown()
  15.       print(drain)
  16.       while drain do
  17.         os.sleep(2)
  18.         robot.drainDown()
  19.         local detect, thing = robot.detectDown()
  20.         if (thing == "air") then
  21.           drain = false
  22.           print("I did it!")
  23.         else
  24.           print("Nope, no lava this time.")
  25.         end
  26.       end
  27.         robot.down()
  28.         depth = depth + 1
  29.     else
  30.       robot.down()
  31.       depth = depth + 1
  32.     end
  33.   end
Advertisement
Add Comment
Please, Sign In to add comment