Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs ~= 1 then
- print( "Usage: bridge <# of Sections>" )
- return
- end
- local length = tonumber( tArgs[1] )
- if length < 1 then
- print( "The number of sections to your bridge" )
- print( "must be a positive number." )
- print( " " )
- print( "Each section is 31 blocks long plus an" )
- print( "additional 3 at the end." )
- print( "(If you choose [bridge 1] then you will" )
- print( " need 34 blocks of space to build.)" )
- print( "Press any key to continue..." )
- os.pullEvent("char")
- return
- end
- term.clear()
- print( "*******************************" )
- print( "***********WELCOME!************" )
- print( "*******************************" )
- print( "********turtle.bridge()********" )
- print( "**************is***************" )
- print( "************ACTIVE*************" )
- print( "***Please read & follow all****" )
- print( "****instructions closely.******" )
- print( "*******************************" )
- print( "Press any key to continue..." )
- os.pullEvent("char")
- term.clear()
- print( "*******************************" )
- print( "*******turtle.bridge()*********" )
- print( "*****is brought to you by******" )
- print( "******theCountChuckula*********" )
- print( "*******************************" )
- print( "Press any key to continue..." )
- os.pullEvent("char")
- term.clear()
- print( "Place 2+ Block-Auto-Re-Filled" )
- print( "Ender Chests into Slot 1." )
- print( "Place 2+ Fuel-Auto-Re-Filled" )
- print( "Ender Chests into Slot 2." )
- print( "Place 2+ Auto-Sorting" )
- print( "Ender Chests into Slot 3." )
- print( "Press any key to continue..." )
- os.pullEvent("char")
- term.clear()
- print( "I mean it. At least 2 of each chest!" )
- print( "When the turtle places one, it uses" )
- print( "the extras as a placeholder to prevent" )
- print( "errors." )
- print( "Press any key to continue..." )
- os.pullEvent("char")
- term.clear()
- local dist = ((length * 31) + 3)
- print( "Turtle will build a bridge ", dist )
- print( "blocks long!" )
- print( " " )
- print( "If you didn't plan for that much" )
- print( "space, use CTRL+T to cancel the" )
- print( "program." )
- print( "Press any key to continue..." )
- os.pullEvent("char")
- term.clear()
- shell.run( "refuel all" )
- local function ascend()
- while turtle.detectUp() do
- turtle.digUp()
- sleep(1)
- end
- turtle.up()
- turtle.select(16)
- turtle.placeDown()
- end
- local function descend()
- turtle.digDown()
- turtle.down()
- end
- local function refuel()
- turtle.select(5)
- while turtle.detectUp() do
- turtle.digUp()
- sleep(1)
- end
- turtle.select(2)
- turtle.placeUp()
- turtle.select(15)
- turtle.suckUp()
- shell.run("refuel all")
- turtle.select(2)
- turtle.digUp()
- end
- local function restock()
- turtle.select(5)
- while turtle.detectUp() do
- turtle.digUp()
- sleep(1)
- end
- turtle.select(1)
- turtle.placeUp()
- turtle.select(16)
- turtle.suckUp()
- turtle.select(1)
- turtle.digUp()
- end
- local function unload()
- turtle.select(5)
- while turtle.detectUp() do
- turtle.digUp()
- sleep(1)
- end
- turtle.select(3)
- turtle.placeUp()
- for s = 4, 14 do
- turtle.select(s)
- turtle.dropUp()
- end
- turtle.select(3)
- turtle.digUp()
- end
- local function checks()
- if turtle.getFuelLevel() < 140 then
- refuel()
- end
- if turtle.getItemCount(16) < 64 then
- restock()
- end
- end
- local function surface()
- if turtle.getItemCount(16) < 4 then
- checks()
- unload()
- end
- if turtle.getFuelLevel() < 4 then
- checks()
- unload()
- end
- turtle.turnLeft()
- turtle.select(16)
- while turtle.detect() do
- turtle.dig()
- sleep(1)
- end
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(16)
- while turtle.detect() do
- turtle.dig()
- sleep(1)
- end
- turtle.place()
- turtle.turnLeft()
- ascend()
- while turtle.detectUp() do
- turtle.digUp()
- sleep(1)
- end
- while turtle.detect() do
- turtle.dig()
- sleep(1)
- end
- turtle.forward()
- end
- local function pillar()
- checks()
- unload()
- for i = 1, 63 do
- descend()
- end
- for i = 1, 62 do
- ascend()
- end
- surface()
- end
- local function beginArch()
- checks()
- unload()
- for i = 1, 11 do
- descend()
- end
- for i = 1, 10 do
- ascend()
- end
- surface()
- for i = 1, 9 do
- descend()
- end
- for i = 1, 8 do
- ascend()
- end
- surface()
- for i = 1, 6 do
- descend()
- end
- for i = 1, 5 do
- ascend()
- end
- surface()
- for i = 1, 4 do
- descend()
- end
- for i = 1, 3 do
- ascend()
- end
- surface()
- for i = 1, 3 do
- descend()
- end
- for i = 1, 2 do
- ascend()
- end
- surface()
- for i = 1, 3 do
- descend()
- end
- for i = 1, 2 do
- ascend()
- end
- surface()
- for i = 1, 2 do
- descend()
- end
- ascend()
- surface()
- for i = 1, 2 do
- descend()
- end
- ascend()
- surface()
- for i = 1, 2 do
- descend()
- end
- ascend()
- surface()
- end
- local function endArch()
- checks()
- unload()
- for i = 1, 2 do
- descend()
- end
- ascend()
- surface()
- for i = 1, 2 do
- descend()
- end
- ascend()
- surface()
- for i = 1, 2 do
- descend()
- end
- ascend()
- surface()
- for i = 1, 3 do
- descend()
- end
- for i = 1, 2 do
- ascend()
- end
- surface()
- for i = 1, 3 do
- descend()
- end
- for i = 1, 2 do
- ascend()
- end
- surface()
- for i = 1, 4 do
- descend()
- end
- for i = 1, 3 do
- ascend()
- end
- surface()
- for i = 1, 6 do
- descend()
- end
- for i = 1, 5 do
- ascend()
- end
- surface()
- for i = 1, 9 do
- descend()
- end
- for i = 1, 8 do
- ascend()
- end
- surface()
- for i = 1, 11 do
- descend()
- end
- for i = 1, 10 do
- ascend()
- end
- surface()
- end
- local function path()
- descend()
- for i = 1, 10 do
- surface()
- descend()
- end
- ascend()
- end
- for l = 1, length do
- pillar()
- pillar()
- pillar()
- beginArch()
- path()
- endArch()
- end
- pillar()
- pillar()
- pillar()
Advertisement
Add Comment
Please, Sign In to add comment