Skip to content

Instantly share code, notes, and snippets.

@isochronous
Last active August 18, 2025 18:39
Show Gist options
  • Save isochronous/161401ec617f8e9fa4212359b4b5450f to your computer and use it in GitHub Desktop.
Save isochronous/161401ec617f8e9fa4212359b4b5450f to your computer and use it in GitHub Desktop.
A ComputerCraft program for automating a Thaumcraft Infusion Altar
local inputName = "abyssalcraft:tileentitycrate_0"
local centralPedestalName = "thaumcraft:tilepedestal_0"
local pedestalNameBase = "thaumcraft:tilepedestal_"
local outputName = "appliedenergistics2:interface_4"
-- Set this to the number of pedestals you have, NOT counting the central pedestal
local pedestalCount = 16
-- set to whatever your first (should be central!) pedestal ID is when you start enabling modems
-- For example, if the first pedestal modem you turn on says its name is "thaumcraft:tilepedestal_15", set this to 15
-- This script assumes all pedestals in one infusion setup will have consecutive IDs with no gaps
local startPedestalID = 0
local input = peripheral.wrap(inputName)
local output = peripheral.wrap(outputName)
local centralPedestal = peripheral.wrap(centralPedestalName)
while true do
local inputList = input.list()
if #inputList > 0 then
-- save the first item's metadata so we can monitor when it changes
local centralItem = input.getItemMeta(1)
-- push first item to center
input.pushItems(centralPedestalName, 1, 1)
-- push the rest of the items to the pedestals
local outputNum = startPedestalID
for slot, item in pairs(inputList) do
local count = item.count;
for i = 1, count do
input.pushItems(pedestalNameBase .. outputNum, slot, 1)
outputNum = outputNum + 1
if outputNum > pedestalCount then
break
end
end
end
while centralPedestal.getItemMeta(1).rawName == centralItem.rawName do
os.sleep(0.2)
end
-- take result and any leftover ingredients off the pedestals
for ped = startPedestalID, pedestalCount do
output.pullItems(pedestalNameBase .. ped, 1, 1)
end
end
os.sleep(0.2)
end
@isochronous
Copy link
Author

isochronous commented Jul 15, 2025

Physical setup: https://imgur.com/a/ePnMUja

This program can handle an arbitrary number of surrounding pedestals. For it to work properly, you must enable the modems for the pedestals in the order you want them populated during infusions. The central pedestal, 0, should be enabled first. Pedestal 1 can be any arbitrary pedestal. Then pedestal 2's modem should be opposite pedestal 1's, pedestal's 3 modem can be arbitrary, pedestal 4's should be opposite pedestal 3's, etc. This will make sure the symmetry requirement of infusion is satisfied.

To sum up, you basically want the central pedestal to have the lowest peripheral ID, so activate it first. For example, thaumcraft:tilepedestal_0 is as low as it can get. If you active the central pedestal and its ID is above 0, don't worry. Just update the startPedestalID value in the script to match whatever the ID winds up being. Then activate the rest of the pedestals in opposite pairs until all of the modems are activated.

@isochronous
Copy link
Author

Just make sure any interfaces, unpackagers, etc you use next to the crate are set to blocking mode

@isochronous
Copy link
Author

And finally, this script requires that the central item be the first item listed in the AE2 pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment