I made a code to load the equipment of the player armor.
code
Is there a command to simplify this further?Code: Select all
c = game.players[1].character --Get the player's character
if c and c .valid then --Make sure we have a character as some players (god mode for instance) won't have a character
if c.logistic_cell and c.logistic_cell.mobile then --See if character is a logistic cell AND is a mobile cell
radius = c.logistic_cell.construction_radius or 0 -- Return a radius for the construction cell
robot_count = c.logistic_cell.stationed_construction_robot_count -- total robots (or available not sure which)
end
--For you to check as I am not sure: are any/all of these available if power in roboport is 0 .cell, .mobile, .construction_radius
--These might be able to be wrapped with .active
end
Oh! Thank you!! I missed [players.character]Nexela wrote:Equipping a personal roboport attaches a logistic_cell to your character http://lua-api.factorio.com/latest/LuaLogisticCell.html