Epuuc

Minecraft CC Simple Strip Mine X

Nov 21st, 2020 (edited)
903
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("How far should I mine?")
  2. local distance = tonumber(read())
  3. local answers = {
  4.     ["no"] = false,
  5.     ["don't"] = false,
  6.     ["dont"] = false,
  7.     ["false"] = false,
  8.     ["do not"] = false,
  9.     ["yes"] = true,
  10.     ["true"] = true,
  11.     ["yeah"] = true,
  12.     ["yea"] = true,
  13.     ["ye"] = true,
  14.     ["yeh"] = true,
  15.     ["sure"] = true,
  16.     ["fuck off"] = false,
  17. }
  18. local comeback = false
  19. print("Should I come back?")
  20. local answer = read()
  21. if answers[answer] ~= nil then
  22.     if answers[answer] then
  23.         comeback = true
  24.     else
  25.         comeback = false
  26.     end
  27. else
  28.     print("Sorry I didn't understand that, please simplify next time.")
  29.     return
  30. end
  31.  
  32. term.clear()
  33. term.setCursorPos(0,0)
  34.  
  35. local blocksbroken = 0
  36.  
  37. local function dig()
  38.     while not turtle.forward() do
  39.         turtle.dig()
  40.         blocksbroken = blocksbroken + 1
  41.     end
  42. end
  43.  
  44. for d=1,distance do
  45.     dig()
  46.     term.clear()
  47.     term.setCursorPos(0,0)
  48.     print("Fuel Level: " .. turtle.getFuelLevel())
  49.     print("Blocks Left: " .. (distance*2)-blocksbroken)
  50.     turtle.digUp()
  51.     blocksbroken = blocksbroken + 1
  52.     term.clear()
  53.     term.setCursorPos(0,0)
  54.     print("Fuel Level: " .. turtle.getFuelLevel())
  55.     print("Blocks Left: " .. (distance*2)-blocksbroken)
  56. end
  57. if comeback then
  58.     turtle.turnLeft()
  59.     turtle.turnLeft()
  60.     for d=1,distance do
  61.         repeat sleep(0.01) until turtle.forward()
  62.     end
  63.     turtle.turnRight()
  64.     turtle.turnRight()
  65. end
RAW Paste Data