If you want to use the main function from another Lua module, you may want to use the luaMain function. This provides the same functionality as the main function, but doesn't require that a frame object be available.