Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Quarry Code
- --Variables:
- Args = {...}
- --functions:
- function TurtleRefuel() --Refuel
- if turtle.getFuelLevel() < 320 and turtle.getItemCount(1) > 3 then
- turtle.select(1)
- turtle.refuel(3)
- end
- end
- function UDF() --Break up down in front and move forward
- if turtle.detect() then
- turtle.dig()
- end
- if turtle.detectDown() then
- turtle.digDown()
- end
- if turtle.detectUp() then
- turtle.digUp()
- end
- turtle.forward()
- end
- function CobbleVoid() --Search inventory for Cobble and void it, move itemslot 15 to an empty one
- if turtle.getItemCount(15) > 1 then
- turtle.select(15)
- for v=2,14 do
- turtle.transferTo(v)
- end
- turtle.select(1)
- end
- end
- function Down3() --move 3 down
- for k=1,3 do
- if turtle.detectDown() then
- turtle.digDown()
- end
- turtle.down()
- end
- end
- function Up3() --move 3 up
- for k=1,3 do
- if turtle.detectUp() then
- turtle.digUp()
- end
- turtle.up()
- end
- end
- function TurnAround() --Turn around
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function EndoftheRoad() --Turns around and down at the end of the road
- Down3()
- TurnAround()
- end
- function ItemDelivery() --Drop items in the chest in front of it (needs to be trapped or regular)
- if turtle.detect() then
- bool,data=turtle.inspect()
- if data.name == "minecraft:chest" or data.name == "minecraft:trapped_chest" then
- for i=2,16 do
- turtle.select(i)
- os.sleep(2/20)
- turtle.drop()
- end
- else
- turtle.dig()
- end
- end
- end
- function BacktoChest() --Moves Turtle by q blocks back to chest
- Up3()
- turtle.turnLeft()
- for u=1,q do
- turtle.forward()
- end
- turtle.turnRight()
- end
- function LeavingChest() --Moves Turtle by q blocks from the chest
- turtle.turnRight()
- for u=1,q do
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight()
- end
- --Parameters:
- i=0
- j=tonumber(Args[2])
- r=tonumber(Args[1])
- q=0
- --Code:
- for y=1,r do
- while i <= j do
- TurtleRefuel()
- CobbleVoid()
- if i < 0.5*j then
- UDF()
- elseif i == 0.5*j then
- EndoftheRoad()
- elseif i > 0.5*j then
- UDF()
- TurtleRefuel()
- end
- i=i+1
- end
- BacktoChest()
- ItemDelivery()
- q=q+1
- LeavingChest()
- i=0
- end
- print("type name 'repeats' 'length' for specifications")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement