Simple Train AutoRefueling


Automatically reroute trains to a refueling station when low on fuel

Utilities
1 year, 2 months ago
1.1
257
Trains

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

1 year, 1 month 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>

11 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.?

6 days ago

sorry I forgot how I got the right name. I think I have a mod that displays internal information about items and found it that way.
But outside of that you should be able to get it off the item wiki
For example for solid fuel you can find the internal name here:

https://wiki.factorio.com/Solid_fuel

or really for all items go here

https://wiki.factorio.com/Data.raw

And search the wall of text. If you search for rocket and keep jumping until you find it linked with fuel (in the Items section)
you will find it is

rocket-fuel

New response