Lua API Reference: Difference between revisions
bonfire-wiki>Sonic260 Created the Lua API Page. This is still a work in progress. |
bonfire-wiki>Sonic260 |
||
| Line 3: | Line 3: | ||
== Lua Console Commands == | == 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. | 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. | ||
{| class=" | {| class="article-table" | ||
! | |||
! | |||
! | |||
|- | |||
| | |||
| | |||
| | |||
|- | |||
| | |||
| | |||
| | |||
|- | |||
| | |||
| | |||
| | |||
|} | |} | ||
== Automatic Functions / Code == | == 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. | 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. | ||
Revision as of 23:12, 11 April 2020
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.
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. |
