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
-- This program creates a tunnel liner to facilitate mining via 5 x 5 tunnels -- Pastebin code = "yqYhZdbF"; Pastebin name is "MDC_Tunnel_Liner" -- Place the turtle down on the right-forward end of the tunnel cut. -- Place coal into Turtle slot #14 to assure adequate fueling -- Place stone into Turtle slot #15 and #16 to assure adequate placement resources -- This program begins by asking you how many two-block sections you want to cut local function mv_fwd() -- This function moves the turtle forward one block if turtle.detect() then turtle.dig(); turtle.forward() else turtle.forward() end end local function mv_up() -- This function moves the turtle up one block if turtle.detectUp() then turtle.digUp(); turtle.up() else turtle.up() end end local function mv_dwn() -- This function moves the turtle down one block if turtle.detectDown() then turtle.digDown(); turtle.down() else turtle.down() end end local function sel_slot() -- This function selects the active slot for placing blocks turtle.select(15) if turtle.getItemCount() < 3 then turtle.select(16) end end local function place_fwd() -- This function places a block if none is present in front of the turtle if not turtle.detect() then sel_slot(); turtle.place() end -- check forward and place end local function place_up() if not turtle.detectUp() then sel_slot(); turtle.placeUp() end -- check up and place end local function place_dwn() if not turtle.detectDown() then sel_slot(); turtle.placeDown() end -- check down and place end if turtle.getFuelLevel() < 200 then print( "Your fuel level is less than 200; refueling with 240." ) turtle.select(14); turtle.refuel(3) end text_input = { ... } -- Obtain the number of two-block sections desired print ( "Checking Data Entered." ) if ( tonumber( text_input[1] < 1 )) then print( "Error: You must respond with a positive number." ) return end desired_sets = to number( text_input[1] ) desired_height = 5 desired_width = 5 while desired_sets > 0 do for iter1 = 1, desired_sets do -- Cut a hallway for the desired length while filling sides mv_fwd(); turtle.turnRight() -- Position turtle for initial cutting and placing for iter2 = 1, ( desired_height + 1 ) do -- Cut and place blocks up right side place_fwd(); mv_up() end turtle.turnLeft(); turtle.turnLeft(); -- Position turtle for cutting and placing on top of tunnel for iter3 = 1, ( desired_width + 1 ) do -- Cut and place blocks across the top place_up(); mv_fwd() end for iter4 = 1, desired_height do -- Cut and place blocks down the left side place_fwd(); mv_down() end turtle.turnRight(); turtle.forward(); turtle.turnLeft() for iter5 = 1, ( desired_height + 1 ) do -- Cut and place blocks up the 2nd left side place_fwd(); mv_up() end turtle.turnRight(); turtle.turnRight(); for iter6 = 1, ( desired_width + 1 ) do -- Cut and place blocks across the top again place_up(); mv_fwd() end for iter4 = 1, desired_height do -- Cut and place blocks down the left side place_fwd(); mv_down() end turtle.turnLeft(); desired_sets = ( desired_sets - 1 ) end end print( "The program has ended successfully." )
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)