Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Version 2.1
- Written by: Tom Nordloh (Notze)
- This script will do the Stripmining
- for you. Amount and length of the
- branches are adjustable just as the
- spacing between them also is.
- Place the following things into the
- Turtles inventory:
- Slot 1: cole
- Slot 2: torch
- Slot 3: filling material
- ]]
- -- make your adjustments here
- local int branches = 5 -- the amount of "branch-pairs"
- local int branchLength = 32 -- the length of each branch
- local int branchSpace = 5 -- the space between each branch-pair
- -- end of adjustments
- function main()
- for i=1, branches, 1 do
- refuel(1+(branchSpace+branchLength*4)/96)
- forward(branchSpace+1)
- turnLeft()
- forward(branchLength)
- back(branchLength)
- torch()
- turnAround()
- forward(branchLength)
- back(branchLength)
- torch()
- turnLeft()
- end
- end
- function refuel(amount)
- if turtle.getFuelLevel() < 96*amount then
- turtle.select(1)
- turtle.refuel(amount)
- end
- end
- function forward(length)
- for i=1, length, 1 do
- while turtle.detect() or turtle.detectUp() do
- turtle.dig()
- turtle.digUp()
- sleep(0.5)
- end
- if turtle.detectDown() == false then
- turtle.select(3)
- turtle.placeDown()
- end
- turtle.forward()
- end
- end
- function back(length)
- for i=1, length, 1 do
- if i==9 then torch() end
- if (i-8)%16==0 and i>9 then torch() end
- turtle.back()
- end
- end
- function turnLeft()
- turtle.turnLeft()
- end
- function turnRight()
- turtle.turnRight()
- end
- function turnAround()
- turtle.turnRight()
- turtle.turnRight()
- end
- function torch()
- turtle.select(2)
- turtle.place()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment