Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Slot_Count = 16
- local x = 50
- local z = 50
- DROPPED_ITEMS = {
- "minecraft:stone",
- "minecraft:dirt",
- "minecraft:cobblestone",
- "minecraft:sand",
- "minecraft:gravel",
- "minecraft:flint",
- "minecraft:dye",
- "forestry:apatite"
- }
- function Drop_Items()
- print("Droping trash...")
- for SlotNum = 1, Slot_Count, 1 do
- local Item = turtle.getItemDetail(SlotNum)
- if(Item ~= nil) then
- for FilterIndex = 1, #DROPPED_ITEMS, 1 do
- if(Item["name"] == DROPPED_ITEMS[FilterIndex]) then
- print("Droppign - " .. Item["name"])
- turtle.select(SlotNum)
- turtle.dropDown()
- end
- end
- end
- end
- end
- -- drops unwanted items
- function GetEnderIndex()
- for SlotNum = 1, Slot_Count, 1 do
- local Item = turtle.getItemDetail(SlotNum)
- if(Item ~=nil) then
- if(Item["name"] == "enderstorage:ender_storage") then
- return SlotNum
- end
- end
- end
- end
- -- finds slot with ender chest
- function manageInventory()
- Drop_Items()
- Index = GetEnderIndex()
- if(Index ~= nil) then
- turtle.select(Index)
- turtle.digUp()
- turtle.placeUp()
- end
- -- ender chest deployed
- for SlotNum = 1, Slot_Count, 1 do
- local Item = turtle.getItemDetail(SlotNum)
- if(Item ~=nil) then
- if(Item["name"] ~= "minecraft:coal_block" and Item["name"] ~= "actuallyadditions:block_misc") then
- turtle.select(SlotNum)
- turtle.dropUp()
- end
- end
- end
- -- Items are stored
- turtle.digUp()
- end
- -- thorws out trash and stores items
- function GetFuelIndex()
- for SlotNum = 1, Slot_Count, 1 do
- local Item = turtle.getItemDetail(SlotNum)
- if(Item ~=nil) then
- if(Item["name"] == "minecraft:coal_block" or Item["name"] == "actuallyadditions:block_misc") then
- return SlotNum
- end
- end
- end
- end
- --Finds slot with fuel
- function Refuel()
- if(turtle.getFuelLevel() < 400) then
- Index = GetFuelIndex()
- if(Index ~= nil) then
- turtle.select(Index)
- turtle.refuel(2)
- end
- end
- end
- -- Checks fuel lvl and refuels when necessary.
- function Mine_Forward()
- for var = 1, x, 1 do
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- turtle.digUp()
- end
- end
- -- mines a 1 wide by 3 tall tunnel
- function Next_Row_R()
- Refuel()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- end
- function Next_Row_L()
- Refuel()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- end
- function Quarry()
- Refuel()
- for var = 1, z/2, 1 do
- manageInventory()
- Mine_Forward()
- Next_Row_L()
- Mine_Forward()
- Next_Row_R()
- end
- end
- Quarry()
Add Comment
Please, Sign In to add comment