factory077-lib is a library mod: it adds no items, entities or recipes, and it is safe to install on its own. It ships Lua modules that other Factorio mods require from their own control.lua, so several mods can share the same code instead of copying it.
Modules
- nth_tick - one engine timer per period, shared by any number of mods. Each mod subscribes its own callbacks, with an optional key for later removal, and can ask which periods are active and who is subscribed to them.
- tables - combine arrays and dictionaries, with or without a deep copy, and turn a list into a lookup set.
- geometry - convert a bounding box into an area, find the chunk a position belongs to, and build nested square matrices.
- debug - opt-in, tagged output that stays silent until a mod enables it, with a per-call override for messages that must always appear.
- mod_data - pass a table from the data stage into the runtime through the engine's mod-data prototype, without building one by hand.
For modders
- Add the dependency to your
info.json:
"dependencies": ["factory077-lib"] - Require the modules you need at the top of your
control.lua:
local nth_tick = require("__factory077-lib__.modules.nth_tick")
The library never registers events, writes storage or changes prototypes by itself: every module is inert until you call it. It also never forces a name prefix on your identifiers, and each module states the stage it is safe to load in.
Full documentation
The API reference, per-module notes, limits and the development setup live in the >> GitHub repository. Its README documents every function, the subscription lifecycle and the exact error messages, which is more detail than fits on this page.
Development note
This mod was developed with AI assistance: an AI coding agent wrote and revised the code, the tests and the documentation under the author's direction, and the author reviewed and accepted every change. The design decisions are the author's, and every engine behavior was measured in a real game rather than assumed.