Both of the following lines work (when hovering over a locomotive for example):
Code: Select all
game.player.selected.burner.currently_burning = game.item_prototypes["nuclear-fuel"]
game.player.selected.burner.currently_burning = "coal"
Code: Select all
-- note: first slot of inventory is coal. this is just an easy way to get a LuaItemStack
item_stack = game.player.get_inventory(1)[1]
game.player.selected.burner.currently_burning = item_stack