Substring /remove kW
Posted: Wed Sep 14, 2016 3:53 am
if trying to do this:
However this does not work, since there it is a string with "kW" in it.
So i tried substr(entity.energy_usage, 1, strlen (entity.energy_usage) - 2) to get rid of the kW, but these lua function don't work in Factorio.
Any ideas? Thx for the help!
PS: I also look for a way to increase the item input buffer of an assembling machine (how many items are grabbed in when the assembler is on idle) - help is appreaciated
Code: Select all
local entity = data.raw["assembling-machine"]["assembling-machine-1"]
entity.energy_usage = entity.energy_usage * factor
So i tried substr(entity.energy_usage, 1, strlen (entity.energy_usage) - 2) to get rid of the kW, but these lua function don't work in Factorio.
Any ideas? Thx for the help!
PS: I also look for a way to increase the item input buffer of an assembling machine (how many items are grabbed in when the assembler is on idle) - help is appreaciated
