lua_exec
Execute Lua code on the Factorio server to query game state or perform custom actions. Use 'return' to capture results.
Instructions
Execute Lua code on the Factorio server via /silent-command. The code is wrapped in a function — use 'return' to send results back. Results are serialized via serpent.line for tables. Use this for any game state query not covered by specific tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Lua code to execute. Use 'return expr' to get a value back. Tables are auto-serialized. |