Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
-- Get player inputs print("Enter current Y level:") local startY = tonumber(read()) print("Enter target Y level:") local targetY = tonumber(read()) print("Enter staircase height (e.g., 3):") local stairHeight = tonumber(read()) print("Enter staircase width (e.g., 2):") local stairWidth = tonumber(read()) -- Validate inputs if not startY or not targetY or not stairHeight or not stairWidth then print("Invalid input. Exiting.") return end if targetY >= startY then print("Target Y level must be lower than current level. Exiting.") return end local steps = startY - targetY print("Preparing to dig staircase down " .. steps .. " steps, height " .. stairHeight .. ", width " .. stairWidth) -- Helper: ensure block under is solid local function ensureFloor() if not turtle.detectDown() then for slot = 1, 16 do local detail = turtle.getItemDetail(slot) if detail and detail.name ~= "minecraft:torch" then turtle.select(slot) turtle.placeDown() return end end print("Warning: No blocks available to fill air gap under step!") end end -- Helper: dig height local function digHeight() for h = 1, stairHeight - 1 do turtle.digUp() turtle.up() end -- Return to bottom for h = 1, stairHeight - 1 do turtle.down() end end -- Helper: dig width local function digWidth() for w = 1, stairWidth - 1 do turtle.turnRight() turtle.dig() turtle.forward() digHeight() turtle.back() turtle.turnLeft() end end -- Main loop for i = 1, steps do -- Dig front and down while turtle.detect() do turtle.dig() end -- Dig height digHeight() -- Dig width (right side) digWidth() -- Move forward if not turtle.forward() then print("Blocked! Could not move forward.") return end -- Dig down while turtle.detectDown() do turtle.digDown() end -- Move down if not turtle.down() then print("Blocked! Could not move down.") return end -- Ensure solid floor ensureFloor() end print("Finished digging staircase.")
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)