If you want add your inserter, load your mod after Cursed PI and call this in data.lua
Code: Select all
cursedPI_addInserter(name,baseRecipe,baseItem,baseEntity,icon,ingredients,ingMult,energy,energyMult,distIn,distOut,othersRecipe,othersItem,othersEntity)
name: name of inserter, is the name of recipe, item and entity.
baseRecipe, baseItem, baseEntity: The base to copy this entity, can be a base item or can copy your item.
icon: the for recipe, item, entity
ingredients: if is ~= nil then override base ingredients with this - Can be null
ingMult: use base ingredients incresed - Can be null
energy: must be energy = {energy_per_movement,energy_per_rotation,effectivity,drain}, effectivity if is a burner inserter and drain if is a electric inserter - Can be null
energyMult: use base energy incresed - Can be null
distIn: distance to pickup items (i.e long-handler = 2, basic = 1)
distOut: distance to drop items
othersRecipe, othersItem, othersEntity: can modify what you want, i.e: othersRecipe {enabled = false} or othersItem {subgroup = yourgroup, order = "i[inserter]-p[pro]"}
I.E my inserters:
Code: Select all
cursedPI_addInserter("cursed-burner-inserter","burner-inserter","burner-inserter","burner-inserter",burnerIcon,nil,3,nil,3,1,1,{enabled = false})
cursedPI_addInserter("cursed-basic-inserter","basic-inserter","basic-inserter","basic-inserter",basicIcon,nil,3,nil,3,1,1,{enabled = false})
cursedPI_addInserter("cursed-long-handed-inserter","long-handed-inserter","long-handed-inserter","long-handed-inserter",longIcon,nil,3,nil,3,2,2,{enabled = false})
cursedPI_addInserter("cursed-smart-inserter","smart-inserter","smart-inserter","smart-inserter",smartIcon,nil,3,nil,3,1,1,{enabled = false})
cursedPI_addInserter("cursed-fast-inserter","fast-inserter","fast-inserter","fast-inserter",fastIcon,nil,3,nil,3,1,1,{enabled = false})
And in control.lua add this in your on_init and on_load:
Code: Select all
if remote.interfaces["Cursed-PI"] and remote.interfaces["Cursed-PI"]["addInserter"] then
local inserter =
{
["name"] = "MyName",
["entity"] = "MyEntityName",
["recipe"] = "MyRecipeName"
}
local temp = remote.call("Cursed-PI","addInserter")
if temp ~= nil then
error(temp)
end
end
I.E 1 or my inserters:
Code: Select all
if remote.interfaces["Cursed-PI"] and remote.interfaces["Cursed-PI"]["addInserter"] then
local inserter =
{
["name"] = "cursed-basic-inserter",
["entity"] = "cursed-basic-inserter",
["recipe"] = "cursed-basic-inserter"
}
local temp = remote.call("Cursed-PI","addInserter",inserter)
if temp ~= nil then
error(temp)
end
end