Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chests = {
- "quark:oak_chest",
- "charm:oak_chest",
- }
- fuel = {
- "minecraft:coal_block",
- "actuallyadditions:block_misc",
- "quark:charcoal_block",
- "minecraft:charcoal"
- }
- wood = {
- "byg:fir_log"
- }
- function getFuelIndex()
- for slotNum = 1, 16, 1 do
- local Item = turtle.getItemDetail(slotNum)
- if(Item ~=nil) then
- for fuelIndex =1, #fuel, 1 do
- if(Item.name == fuel[fuelIndex]) then
- return slotNum
- end
- end
- end
- end
- end
- function refuel()
- if(turtle.getFuelLevel() < 400) then
- local Index = getFuelIndex()
- if(Index ~= nil) then
- turtle.select(Index)
- turtle.refuel(2)
- end
- end
- end
- function getCoalIndex()
- for slotNum = 1, 16, 1 do
- local item = turtle.getItemDetail(slotNum)
- if(item ~= nil) then
- if(item.name == "minecraft:charcoal") then
- return slotNum
- end
- end
- end
- end
- function getCoalCount()
- coalCount = 0
- for slotNum = 1,16,1 do
- local whatsHere = turtle.getItemDetail(slotNum)
- if(whatsHere ~= nil) then
- if (whatsHere.name == "minecraft:charcoal") then
- turtle.select(slotNum)
- coalCount = coalCount + turtle.getItemCount()
- print("Current coal Count A-",coalCount)
- end
- end
- end
- print("Current coal Count B-",coalCount)
- end
- function dropCoal()
- getCoalCount()
- for slotNum = 1, 16, 1 do
- local item = turtle.getItemDetail(slotNum)
- if(item ~= nil) then
- if(item.name == "minecraft:charcoal") then
- print("Droppign - " .. item.name)
- turtle.select(slotNum)
- turtle.dropDown()
- end
- end
- end
- end
- function fillCraftingGrid()
- turtle.select(1)
- turtle.suckDown(coalCount / 9)
- turtle.select(2)
- turtle.suckDown(coalCount / 9)
- turtle.select(3)
- turtle.suckDown(coalCount / 9)
- turtle.select(5)
- turtle.suckDown(coalCount / 9)
- turtle.select(6)
- turtle.suckDown(coalCount / 9)
- turtle.select(7)
- turtle.suckDown(coalCount / 9)
- turtle.select(9)
- turtle.suckDown(coalCount / 9)
- turtle.select(10)
- turtle.suckDown(coalCount / 9)
- turtle.select(11)
- turtle.suckDown(coalCount / 9)
- end
- function getCoal()
- for i = 1, 5, 1 do
- turtle.suckUp()
- turtle.dropUp()
- turtle.forward()
- end
- end
- while true do
- getCoal()
- dropCoal()
- fillCraftingGrid()
- turtle.craft()
- refuel()
- if getFuelIndex ~= nil then
- turtle.select(getFuelIndex())
- turtle.dropUp(1)
- turtle.drop()
- end
- turtle.suckDown()
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1, 5, 1 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- sleep(600)
- end
Add Comment
Please, Sign In to add comment