Allows ComputerCraft to handle items, fluids and RF similar to Steve's Factory Manager but with the power of lua.
Though you can, please don't just pastebin code for this peripheral. It can be very over powered and you are meant to work for it by spending time on programming. This is also the reason why there is only a very basic quick-start guide and the peripheral documentation.
Tutorials, Spotlights and "how-to"-guides are very welcome - just don't post finished code.
- Place a Factory Controller next to a Turtle
- Use a few Factory Cables to connect the controller to an empty chest or place a chest besides the controller.
- Right-click the Controller to open its GUI and name the turtle "hello" and the chest "world"
- Put a distinctive item in the turtles first slot, open a lua shell on the turtle and run:
factory = peripheral.wrap("front")
factory.transferItem("hello", 1, "world", 1, 0)
- It should say 1, because it transferred 1 item from the first slot of "hello" to the first-best slot (0) of the target "world", i.e.:
transferItem(source, source-slot, target, quantity, target-slot)
Feel free to use in any modpack. I won't answer messages/issues about this, please don't feel insulted.
Factory Controller | Factory Cable |
---|---|
![]() |
![]() |
Sets the name of a position relative to the Factory Controller. This can also be done via the GUI of the Factory Controller block. Note that names are unique and setting a new name for a position might overwrite a old one. The name is used by other Factory methods to refer to the block in that position.
Returns the name of the position.
Returns the position a name is refering to.
Clears the name of all positions. Useful for lua programs which are naming their blocks themselves.
Returns a table containing details about all Blocks capable of handling items, fluids and/or energy, e.g. when connected to a single Casting Table:
{
{
Pos = { x = 5, y = 0, z = 1 },
Types = { "item", "fluid" },
Meta = 0,
Block = "TConstruct:SearedBlock",
Name = "Casting Table",
Target = "IngotCast",
},
}
Returns a table with the capabilities provided by the given target, e.g. for above Casting Table:
{
item = true,
fluid = true
}
Returns the number of transferred items. If target-slot
is 0 the first matching/free slot will be used.
Returns the number of slots of the inventory at source-name
.
Returns a table containing all items stored in the inventory at that position. E.g.:
{
{
mod_id = "minecraft",
raw_name = "tile.stone",
max_size = 64,
max_dmg = 0,
qty = 32,
dmg = 0,
id = "minecraft:stone",
ore_dict = { stone = true, },
display_name = "Stone",
name = "stone",
},
[ 11 ] = {
display_name = "Enchanted Book",
raw_name = "item.enchantedbook",
max_size = 1,
max_dmg = 0,
qty = 1,
dmg = 0,
id = "minecraft:enchanted_book",
nbt_id = "258bbd4a6be0fef5da627018fb8cc9b1",
name = "enchanted_book",
mod_id = "minecraft",
},
}
Side is specified as "north", "up", "down" etc.
Tank-Id is the number of the tank stored in the block; this is usually 1
as most blocks only have one tank.
Returns the amount of mB transferred.
Returns details about the tank accessible from the given side for the given block. If side is ""
the details about all sides will be returned. E.g. for querying any specific side of an Extra-Utilities Drum filled with one bucket of Lava:
{
{
capacity = 256000,
contents = {
rawName = "Lava",
amount = 1000,
name = "lava",
id = 2,
},
},
}
Side is specified as "north", "up", "down" etc. Returns the amount of RF transferred.
Returns details about the RF stored at the given side of the given block.
{
stored = 25200,
capacity = 500000,
}