Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Pinwheel Mining is a variation of branch mining designed to maximize time and resources
- --define variables
- local slot=0
- --define functions
- --Deliver will empty inventory into chests
- function Deliver()
- for drop = 1, 11, 1 do
- slot=slot+1
- turtle.select(slot)
- turtle.drop()
- end
- end
- --Torch Check will allow two slots with Stacks of torches!!**needs updating for 5 slots
- function TorchCheck()
- turtle.select(13)
- if turtle.getitemCount(12) < 1 then
- turtle.transferTo(12)
- end
- turtle.select(14)
- if turtle.getitemCount(13) < 1 then
- turtle.transferTo(13)
- end
- turtle.select(15)
- if turtle.getitemCount(14) < 1 then
- turtle.transferTo(14)
- end
- turtle.select(16)
- if turtle.getitemCount(15) < 1 then
- turtle.transferTo(15)
- end
- turtle.select(12)
- end
- --spiralStep is the basic unit of spiral mining
- function spiralStep()
- if turtle.detectDown()==true then
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- if turtle.detect()==true then
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- spiralStep()
- end
- turtle.down()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- else
- turtle.turnLeft()
- for run = 1, 3, 1 do
- turtle.up()
- turtle.forward()
- turtle.turnRight()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- --spiralLevel mines down levels
- function spiralLevel()
- turtle.select(12)
- for steps = 1, 5, 1 do
- spiralStep()
- end
- turtle.up()
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.down()
- end
- --Mine Step is the building block for the rest of the Script
- function Sstep()
- if turtle.detectDown()==false then
- turtle.placeDown()
- turtle.dig()
- turtle.digUp()
- turtle.forward()
- else
- turtle.dig()
- turtle.digUp()
- if turtle.detect()==true then
- turtle.dig()
- turtle.digUp()
- Sstep()
- end
- turtle.forward()
- end
- end
- --Shaft leg one is for 9 blocks then a torch
- function SlegOne()
- TorchCheck()
- for Steps = 1, 9, 1 do
- Sstep()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- --Shaft leg two is for 18 blocks; designed to use in conjunction with leg one and a return trip
- function SlegTwo()
- TorchCheck()
- for Steps = 1, 18, 1 do
- Sstep()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- --Main Branch is 2x2x~50
- function mBranch()
- SlegOne()
- SlegTwo()
- SlegTwo()
- turtle.turnLeft()
- Sstep()
- turtle.turnLeft()
- SlegOne()
- SlegTwo()
- SlegTwo()
- end
- --Secondary Branches come off the main branch
- function sBranch()
- SlegOne()
- SlegTwo()
- SlegTwo()
- turtle.turnLeft()
- turtle.turnLeft()
- SlegOne()
- SlegTwo()
- SlegTwo()
- end
- --SecondaryBranchDigging Step
- function SBDigStep()
- sBranch()
- turtle.turnRight()
- for move = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- end
- --Secondary Branch Digging part1of3(SBDigOne) is the function
- function SBDigOne()
- turtle.turnRight()
- for SBDO = 1, 3, 1 do
- SBDigStep()
- end
- turtle.turnRight()
- for retu = 1, 8, 1 do
- turtle.forward()
- end
- end
- --12 Secondary Branch Digging part2of3(SBDigTwo)
- function SBDigTwo()
- for SBDTO = 1, 12, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- for SBDTT = 1, 3, 1 do
- SBDigStep()
- end
- turtle.turnRight()
- for retuT = 1, 20, 1 do
- turtle.forward()
- end
- end
- --24 Secondary Branch Digging part3of3(SBDigThree)
- function SBDigThree()
- for SBDThO = 1, 24, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- for SBDThT = 1, 5, 1 do
- SBDigStep()
- end
- turtle.turnRight()
- for retuTh = 1, 43, 1 do
- turtle.forward()
- end
- end
- --preliminary test of functions
- term.clear()
- print("Hello World: ")
- print("-rim-shot- I'm kidding ")
- print("Before I start please load me up ")
- --Fuel slot 4, 2 Chests slot 3, Torches slots 12-16
- print("I need fuel in slot 4, 2 Chests in ")
- print("slot 3, & a stack of torches in ")
- print("slots 12, 13, 14, 15 & 16--I'll need them")
- print("Please press enter to continue: ")
- local intro = read()
- print("Now I need to know how many levels of 5 blocks ")
- print("You want me to dig down for the Pinwheel Mine ")
- print("If you want to mine at the current level, press 0")
- local depth = read()
- print("Ok.. ", depth, " levels... let's go")
- turtle.select(4)
- turtle.refuel()
- --if depth => 0 then
- for deep = 1, depth, 1 do
- spiralLevel()
- end
- --end
- --Central Chamber
- Sstep()
- Sstep()
- turtle.turnLeft()
- Sstep()
- Sstep()
- turtle.turnLeft()
- Sstep()
- Sstep()
- Sstep()
- turtle.turnLeft()
- Sstep()
- Sstep()
- Sstep()
- turtle.turnLeft()
- for cham1 = 1, 4, 1 do
- Sstep()
- end
- turtle.turnLeft()
- for cham2 = 1, 4, 1 do
- Sstep()
- end
- turtle.turnLeft()
- for cham5 = 1, 3, 1 do
- for cham3 = 1, 5, 1 do
- Sstep()
- end
- turtle.turnLeft()
- end
- Sstep()
- Sstep()
- turtle.turnLeft()
- turtle.select(3)
- turtle.place()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- Deliver()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- --begin main branches
- --Mbranch 3 o'clock from standing in front of chest
- mBranch()
- turtle.forward()
- Deliver()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- for twelve = 1, 4, 1 do
- turtle.forward()
- end
- --Mbranch 12 o'clock from standing in front of chest
- mBranch()
- for tdOne = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- Deliver()
- turtle.turnRight()
- for tdmTwo = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- for nine = 1, 4, 1 do
- turtle.forward()
- end
- --Mbranch 9 o'clock from standing in front of chest
- mBranch()
- turtle.turnRight()
- for ndmOne = 1, 3, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- Deliver()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- --Mbranch 6 o'clock from standing in front of chest
- mBranch()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- --begin secondary branches with 6 oclock Mbranch
- SBDigOne()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- Deliver()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- SBDigTwo()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- Deliver()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- SBDigThree()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- Deliver()
- turtle.turnLeft()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- --secondary branches at 9 oclock
- SBDigOne()
- turtle.turnRight()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- Deliver()
- turtle.turnLeft()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- SBDigTwo()
- turtle.turnRight()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- Deliver()
- turtle.turnLeft()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- SBDigThree()
- turtle.turnRight()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- Deliver()
- turtle.turnLeft()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- --Secondary branches from 12 oclock
- SBDigOne()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.forward()
- Deliver()
- turtle.turnRight()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- SBDigTwo()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.forward()
- Deliver()
- turtle.turnRight()
- for next = 1, 4, 1 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- SBDigThree()
- for next = 1, 5, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- --Secondary Branches 3oclock
- SBDigOne()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.foward()
- Deliver()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- SBDigTwo()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.foward()
- Deliver()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- SBDigThree()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement