Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Local Variables
- local blocksMined = 0
- local fuelLevel = 0
- --Move Functions
- function turn180()
- turtle.turnRight()
- turtle.turnRight()
- end
- --Check Functions
- function checkFwd()
- while turtle.detect() == true do
- digFwd()
- end
- end
- function checkUp()
- while turtle.detectUp() == true do
- digUp()
- end
- end
- --1x3 Mine
- function mine1x3()
- checkFwd()
- turtle.forward()
- turtle.digUp()
- checkUp()
- turtle.digDown()
- checkFuel()
- end
- --3x3 Mine
- function mine3x3()
- mine1x3()
- turtle.turnLeft()
- mine1x3()
- turn180()
- turtle.forward()
- turtle.forward()
- mine1x3()
- --Reset
- turtle.back()
- turtle.right()
- --Count blocksMined
- blocksMined = blocksMined + 1
- end
- --Check Fuel Level
- function checkFuel()
- fuelLevel = turtle.getFuelLevel()
- if turtle.getFuelLevel() == 0 then
- turtle.refuel()
- end
- return fuelLevel
- end
- function returnStart()
- for i=0, blocksMined do
- turtle.back()
- end
- end
- --Start Main Function
- function main()
- checkFuel()
- for i=0, 25 do
- mine3x3()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement