StiGMaT14

Computer Craft: Turtle - Tunneler 3000 Helper V1.0

Sep 9th, 2025 (edited)
100
0
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.67 KB | None | 0 0
  1. --[[
  2.   Mining Turtle Tunneler 3000 Helper
  3.   --> Used to reposition the Turtle for the next Tunnel
  4.   Version: ComputerCraft 1.8 (Minecraft 1.12.2)
  5.   Program Version: 1.0 (Updated: September 9th 2025)
  6.   --> This script expects:
  7.   --> The turtle to be docked on a tunneler 3000 docking station (Chest under and chest behind)
  8.   ---> You will need to reposition the 2 Chests after running this Program
  9.   --> Will move the turtle to the left or the Right of its current position into the next tunnel starting position.
  10. ]]
  11.  
  12.   ------------------ Config ------------------
  13. -- Tunneler 3000 Helper (fixed)
  14. write("Enter tunnel width (Ex 4): ")
  15. local TUNNEL_WIDTH = tonumber(read())
  16.  
  17. write("Enter tunnel offset (Ex 2): ")
  18. local TUNNEL_OFFSET = tonumber(read())
  19.  
  20. write("Move to the Left or Right? (L=Left, R=Right): ")
  21. local TUNNEL_DIRECTION = string.upper(read())  -- <- read as string, not number
  22.  
  23. if not (TUNNEL_WIDTH and TUNNEL_WIDTH > 0) then error("Width must be > 0") end
  24. if not (TUNNEL_OFFSET and TUNNEL_OFFSET >= 0) then error("Offset must be >= 0") end
  25. if TUNNEL_DIRECTION ~= "L" and TUNNEL_DIRECTION ~= "R" then error("Direction must be L or R") end
  26.  
  27. local function stepForward()
  28.   while not turtle.forward() do
  29.     if turtle.detect() then turtle.dig() else sleep(0.2) end
  30.   end
  31. end
  32.  
  33. local total_moves = TUNNEL_WIDTH + TUNNEL_OFFSET
  34.  
  35. -- turn toward the side aisle
  36. if TUNNEL_DIRECTION == "L" then turtle.turnLeft() else turtle.turnRight() end
  37.  
  38. -- move sideways into the next tunnel start
  39. for i = 1, total_moves do stepForward() end
  40.  
  41. -- face original forward direction again
  42. if TUNNEL_DIRECTION == "L" then turtle.turnRight() else turtle.turnLeft() end
  43.  
  44. print("Done!")
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment