Code: Select all
if ent and ent.type == "electric-pole" and ent.name == "small-electric-pole" then
log(string.format("%s (%s) is connected: %s\tNetwork ID: %s\tNeighbours: %s", ent.name, ent.unit_number, ent.is_connected_to_electric_network(), ent.electric_network_id, ent.neighbours["copper"]))
end
Code: Select all
small-electric-pole (34) is connected: false Network ID: 1 Neighbours: small-electric-pole

Bonus question: Is there a way to read how much power goes over a wire?