Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made By Vilsol
- -- DoubleQuarry Digger
- -- Digs 2 blocks at a time
- -- Digs double the depth amount
- local args = { ... }
- if not args[1] or not args[2] or not args[3] then
- print "Command:"
- print "doublequarry X Y Depth"
- error()
- end
- if not tonumber(args[1]) then
- print "X must be a number!"
- else
- x = tonumber(args[1])
- end
- if not tonumber(args[2]) then
- print "Y must be a number!"
- else
- y = tonumber(args[2])
- end
- if not tonumber(args[3]) then
- print "Depth must be a number!"
- else
- d = tonumber(args[3])
- end
- if(turtle.getItemCount(13) == 0)then
- print "No EnderChest!"
- print "Put an EnderChest in the slot 13 and re-run the program!"
- error()
- end
- turn = "right"
- totaldig = 0
- function reFuel()
- fuel = turtle.getFuelLevel()
- if fuel < 100 then
- turtle.select(16)
- turtle.refuel()
- turtle.select(1)
- end
- fuel = turtle.getFuelLevel()
- if fuel < 100 then
- print "No Fuel!"
- print "Put Fuel in slot 16 and re-run the program!"
- error()
- end
- end
- function bringHome()
- turtle.digUp()
- turtle.select(13)
- if not turtle.placeUp() then
- for attacker = 1,50 do
- turtle.attackUp()
- end
- end
- for slots = 1, 12 do
- turtle.select(slots)
- turtle.dropUp()
- end
- turtle.select(13)
- turtle.digUp()
- turtle.select(1)
- end
- function checkSlot()
- fullness = turtle.getItemCount(12)
- if fullness > 0 then
- bringHome()
- end
- end
- function digQuarry()
- reFuel()
- bringHome()
- turtle.digDown()
- turtle.down()
- for depth = 1, d do
- checkSlot()
- for width = 1, y do
- checkSlot()
- for height = 2, x do
- checkSlot()
- if turtle.dig() then
- totaldig = totaldig+1
- end
- if turtle.digDown() then
- totaldig = totaldig+1
- end
- if not turtle.forward() then
- reFuel()
- if not turtle.forward() then
- bringHome()
- if not turtle.forward() then
- if not turtle.attack() then
- print "Error"
- error()
- end
- if not turtle.forward() then
- for times = 1,50 do
- turtle.attack()
- end
- if not turtle.forward() then
- print "Error"
- error()
- end
- end
- end
- end
- end
- end
- if width < y then
- if turn == "left" then
- turn = "right"
- turtle.turnLeft()
- if turtle.dig() then
- totaldig = totaldig+1
- end
- if turtle.digDown() then
- totaldig = totaldig+1
- end
- if not turtle.forward() then
- reFuel()
- if not turtle.forward() then
- bringHome()
- if not turtle.forward() then
- if not turtle.attack() then
- print "Error"
- error()
- end
- if not turtle.forward() then
- for times = 1,50 do
- turtle.attack()
- end
- if not turtle.forward() then
- print "Error"
- error()
- end
- end
- end
- end
- end
- turtle.turnLeft()
- else
- turn = "left"
- turtle.turnRight()
- if turtle.dig() then
- totaldig = totaldig+1
- end
- if turtle.digDown() then
- totaldig = totaldig+1
- end
- if not turtle.forward() then
- reFuel()
- if not turtle.forward() then
- bringHome()
- if not turtle.forward() then
- if not turtle.attack() then
- print "Error"
- error()
- end
- if not turtle.forward() then
- for times = 1,50 do
- turtle.attack()
- end
- if not turtle.forward() then
- print "Error"
- error()
- end
- end
- end
- end
- end
- turtle.turnRight()
- end
- end
- end
- if depth < d then
- if turtle.digDown() then
- totaldig = totaldig+1
- end
- if not turtle.down() then
- reFuel()
- if not turtle.down() then
- bringHome()
- if not turtle.down() then
- if not turtle.attack() then
- print "Error"
- error()
- end
- if not turtle.down() then
- for times = 1,50 do
- turtle.attack()
- end
- if not turtle.down() then
- print "Error"
- error()
- end
- end
- end
- end
- end
- if turtle.digDown() then
- totaldig = totaldig+1
- end
- if not turtle.down() then
- reFuel()
- if not turtle.down() then
- bringHome()
- if not turtle.down() then
- if not turtle.attack() then
- print "Error"
- error()
- end
- if not turtle.down() then
- for times = 1,50 do
- turtle.attack()
- end
- if not turtle.down() then
- print "Error"
- error()
- end
- end
- end
- end
- end
- turtle.turnLeft()
- turtle.turnLeft()
- else
- if turtle.digDown() then
- totaldig = totaldig+1
- end
- for goup = 1, d*2 do
- turtle.up()
- end
- bringHome()
- end
- end
- end
- digQuarry()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement