Simple Train AutoRefueling


Automatically reroute trains to a refueling station when low on fuel

Utilities
7 months ago
1.1
163
Trains

b crash because I don't know the "right" name for my fuel

6 months ago

I like the idea of this mod, however it does not gracefully handle it if you put in the wrong name for the fuel, when it tries to get a count of the fuel
I was trying to use it with Krastorio and used the display name of the fuel I was using. Unfortunately it crashed the game with the error below.
Is there any reason to even need to get the name of the fuel really?

It seems like the API would just give you a fuel available count or percentage without even needing to know the name.
On LuaEntity there is a "get_fuel_inventory" method that might work

https://lua-api.factorio.com/latest/classes/LuaEntity.html#get_fuel_inventory

The mod Simple Train AutoRefueling (0.3.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event simple-train-auto-refueling::on_train_changed_state (ID 25)
Unknown item name: Uranium fuel cell
stack traceback:
[C]: in function 'get_item_count'
simple-train-auto-refueling/control.lua:94: in function 'getFuelCount'
simple-train-auto-refueling/control.lua:24: in function <simple-train-auto-refueling/control.lua:4>

4 months ago

I'm having the same issue.. lol How do you figure out the actual name your meant to use.? Like I was going to use processed fuel. But that caused the crash then i changed it to solid rocket fuel, which did the same.. lol coal seem to be the only one I can get working.. Should I not put spaces.?

New response