Advertisement
Epuuc

Minecraft CC - etOS APP - Staircase Mine

Nov 20th, 2020 (edited)
1,948
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. --Epuuc
  2. local args = {...}
  3.  
  4. print("What Y do you want me to mine to?")
  5. local ygoal = tonumber(read())
  6.  
  7. print("What's my current Y?")
  8. local ypos = tonumber(read())
  9. local diff = ypos-ygoal
  10. while true do
  11.     if diff > 0 then
  12.         turtle.dig()
  13.         turtle.forward()
  14.         turtle.digUp()
  15.         ypos = ypos - 1
  16.         turtle.digDown()
  17.         turtle.down()
  18.         if not turtle.detectDown() and args[1] ~= "false" then
  19.             turtle.placeDown()
  20.         end
  21.     else
  22.         if diff == 0 then break end
  23.         turtle.dig()
  24.         turtle.forward()
  25.         turtle.digUp()
  26.         ypos = ypos + 1
  27.         if not turtle.detectDown() then
  28.             turtle.placeDown()
  29.         end
  30.         turtle.up()
  31.         turtle.digUp()
  32.     end
  33.     if ypos == ygoal then break end
  34. end
  35. print("Y reached")
  36. --Epuuc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement