SHOW:
|
|
- or go back to the newest paste.
| 1 | --[[ | |
| 2 | Using: CC: Tweaked, Plethora | |
| 3 | - | pastebin run sBTwAePK |
| 3 | + | pastebin run 1k4ECcCv |
| 4 | - | pastebin get sBTwAePK startup |
| 4 | + | pastebin get 1k4ECcCv startup |
| 5 | ]]-- | |
| 6 | ||
| 7 | if pcall(os.loadAPI, "jLib/jFuncs") then | |
| 8 | else | |
| 9 | shell.run("pastebin get kqBFGcfV jLib/jFuncs")
| |
| 10 | os.loadAPI("jLib/jFuncs")
| |
| 11 | end | |
| 12 | - | if(fs.exists("jLib/ExternalCrafterRecipes")) then
|
| 12 | + | |
| 13 | - | fs.delete("jLib/ExternalCrafterRecipes")
|
| 13 | + | local craftingCore = peripheral.find("actuallyadditions:phantomface")
|
| 14 | local input1 = peripheral.wrap("minecraft:ender chest_4")
| |
| 15 | - | shell.run("pastebin get a2DA84Hg jLib/ExternalCrafterRecipes")
|
| 15 | + | local input2 = peripheral.wrap("minecraft:ender chest_5")
|
| 16 | local output = peripheral.wrap("minecraft:ender chest_6")
| |
| 17 | ||
| 18 | - | local inputChest = peripheral.wrap("back")
|
| 18 | + | |
| 19 | - | local self = peripheral.wrap("left").getInventory()
|
| 19 | + | local function moveAllCobble() |
| 20 | for i, item in pairs(input1.list()) do | |
| 21 | - | local file = fs.open("jLib/ExternalCrafterRecipes", "r")
|
| 21 | + | if(item.name == "minecraft:cobblestone") then |
| 22 | - | local recipes = textutils.unserialize(file.readAll()) |
| 22 | + | input1.pushItems(peripheral.getName(output), i) |
| 23 | end | |
| 24 | - | local function containsRecipe(items, recipe) |
| 24 | + | |
| 25 | - | local needed = {}
|
| 25 | + | for i, item in pairs(input2.list()) do |
| 26 | - | for _, material in pairs(recipe) do |
| 26 | + | if(item.name == "minecraft:cobblestone") then |
| 27 | - | table.insert(needed, {["name"] = material.name, ["damage"] = material.damage, ["nbtHash"] = material.nbtHash, ["checked"] = false})
|
| 27 | + | input2.pushItems(peripheral.getName(output), i) |
| 28 | - | end |
| 28 | + | |
| 29 | end | |
| 30 | - | local lItems = jFuncs.tableClone(items) |
| 30 | + | |
| 31 | ||
| 32 | - | local ret = {}
|
| 32 | + | while(true) do |
| 33 | - | for _, material in pairs(needed) do |
| 33 | + | if(craftingCore.getItem(2)) then |
| 34 | - | for i, item in pairs(lItems) do |
| 34 | + | moveAllCobble() |
| 35 | - | if(item.name == material.name and item.damage == material.damage and item.nbtHash == material.nbtHash and not material.checked and item.count > 0) then |
| 35 | + | craftingCore.pushItems(peripheral.getName(output), 2) |
| 36 | - | table.insert(ret, { ["slot"] = i })
|
| 36 | + | |
| 37 | - | material.checked = true |
| 37 | + | os.sleep(1) |
| 38 | - | item.count = item.count - 1 |
| 38 | + | |
| 39 | - | end |
| 39 | + |