Advertisement
kEOKIX

MiningTool

Sep 9th, 2022 (edited)
746
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. function Tunnel()
  2.     while(true) do
  3.         TunnelLeftToRight()
  4.         TunnelRightToLeft()
  5.     end
  6. end
  7.  
  8. function TunnelLeftToRight()
  9.     turtle.dig()
  10.     turtle.forward()
  11.     turtle.digUp()
  12.     turtle.digDown()
  13.     turtle.turnLeft()
  14.     turtle.dig()
  15.     turtle.forward()
  16.     turtle.digUp()
  17.     turtle.digDown()
  18.     turtle.dig()
  19.     turtle.forward()
  20.     turtle.digUp()
  21.     turtle.digDown()
  22.     turtle.turnRight()
  23. end
  24.  
  25. function TunnelRightToLeft()
  26.     turtle.dig()
  27.     turtle.forward()
  28.     turtle.digUp()
  29.     turtle.digDown()
  30.     turtle.turnRight()
  31.     turtle.dig()
  32.     turtle.forward()
  33.     turtle.digUp()
  34.     turtle.digDown()
  35.     turtle.dig()
  36.     turtle.forward()
  37.     turtle.digUp()
  38.     turtle.digDown()
  39.     turtle.turnLeft()
  40. end
  41.  
  42.  
  43. function Refuel()
  44.     for i = 1, 16 do
  45.         turtle.select(i)  
  46.             turtle.refuel()
  47.     end
  48. end
  49.  
  50.  
  51. funtion Menu()
  52.     Refuel()
  53.     print("Mining by Keokix_")
  54.     print("Select mode:")
  55.     print("1: Strip mining, 3x1 and every 3rd block, 3 in each side")
  56.     print("2: Excavate - Are is adjustable when selecting this")
  57.     print("3: Tunnel - 3x3 Tunnel")
  58.  
  59.     print("Please select a mode:")
  60.  
  61.     input = io.read()
  62.  
  63.     if(input == 1) then
  64.         StripMining()
  65.     elseif(input == 2) then
  66.         print("Please define the length in front direction: ")
  67.         length = io.read()
  68.         print("Please define the width (going in right direction):")
  69.         width = io.read()
  70.         Excavate(length, width)
  71.     elseif(input == 3) then
  72.         Tunnel()
  73.     else
  74.         print("Invalid input, Try again!")
  75.         Menu()
  76.     end
  77. end
  78.  
  79. Menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement