So great work guys I am loving the game again
Apparently I posted this in the wrong forum initially, so I'll delete that post and here it is again \o/
I just updated my mod here https://mods.factorio.com/mod/folk-janitor and with the scripting changes in 2.0.16 I really wanted to get going with the personal logistics stuff, but specifically working with blueprint books is made difficult by what I imagine is actually just something you overlooked.
I'll let past self me explain from the code: https://github.com/folknor/factorio-jan ... ol.lua#L65
Code: Select all
-- So here's the problem with books. There are two kinds: books from inventory and books from the library.
-- p.cursor_stack.is_blueprint_book = true for inventory, false for library
-- p.cursor_record is valid for library, invalid for inventory
-- both _stack and _record .type == "blueprint-book"
--
-- _record has a field called https://lua-api.factorio.com/latest/classes/LuaRecord.html#contents
-- from this field we can iterate all the blueprints in the book
-- _stack has a field called https://lua-api.factorio.com/latest/classes/LuaItemCommon.html#active_index
-- from this field we can determine which blueprint is the active one in a book
--
-- But that's the problem. _record doesn't have active_index, and _stack doesn't have .contents.
-- So we can't really work with either of them.
-- For _record (library books) we can't actually get the contents of any of the blueprints because
-- we can't iterate them.
-- And for _stack we can determine the active blueprint index, but not get the contents of that
-- blueprint by index.
\o/