Lua API Reference
This page contains documentation for all the known functions within the Lua Bonfire API. For more information for running Lua code in Bonfire, please see the Lua scripting page.
Lua Console Commands
This table comprises the list of Lua-related console commands to actually inject, run, or even delete scripts from the console target's inventory. These can be placed into a scroll, macro, or NPC's CustomCall action during dialogue.
|
Command |
Usage |
Effect |
|---|---|---|
| oluainj | oluainj luaScriptName | Injects a Lua script within the console target's inventory.
Lua Scripts must be stored within the Lua directory, located at %appdata%/Prasetto/Bonfire/Mods/lua |
| oluacf | oluacf luaScriptName,functionName | Executes a single function within an injected Lua script once |
| oluaiifr | oluaiifr luaScriptName,functionName,duration | Causes a single Lua function to iterate, and execute repeatedly for a set duration. When the duration, the iteration will stop.
Tip: Set duration to "Infinity" will make the script run forever. |
| oluaria | oluaria luaScriptName,functionName
oluaria |
Stops an iterating function within a Lua script. Using oluaria with no parameters will stop all iterating scripts within the console target. |
| oluarem | oluarem luaScriptName | Removes the Lua script from the target's inventory. This will also stop any related iterators. |
Automatic Functions / Code
This code will execute automatically when injected into the target's inventory using the oluainj command. This removes the need to run functions manually with oluacf or oluaiifr. Note: The start() and update() functions will not run automatically if injected as an OrcLuaScript action with macros.
|
Function Name |
Return Type |
Description /Usage |
|---|---|---|
|
start |
void |
The start() function will execute once upon injection. |
|
update |
void |
The update() function will start an iterator that runs for Infinity seconds upon injection. |
|
[chunk space] |
N/A |
“Chunk Space” refers to any code lying outside of a function within a Lua file. This code will execute once upon injection AND whenever the holder enters a new scene. This is typically used for setting variables and preemptively granting data flags. |
