Reimplementation of extractbb, written in Lua
