Template:LuaCallout: Difference between revisions
From Spring
Jump to navigationJump to search
Fixed a missing line leading to one of the arguments being ignored |
m Added description |
||
| Line 15: | Line 15: | ||
==Lua Callout usage example== | ==Lua Callout usage example== | ||
This template creates an anchored entry meant for Lua functions. It allows for a function prefix, funtion name, up to 9 function argument slots, info about the returned variable(s) and a description. | |||
<pre> | <pre> | ||
Latest revision as of 22:19, 28 February 2021
Lua Callout usage example
This template creates an anchored entry meant for Lua functions. It allows for a function prefix, funtion name, up to 9 function argument slots, info about the returned variable(s) and a description.
{{LuaCallout
|prefix = Spring.
|name = UseTeamResource
|arg1 = {{type|number}} teamID
|arg2 = {{type|string}} "metal" {{pipe}} "energy"
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }
|arg4 =
|arg5 =
|arg6 =
|arg7 =
|arg8 =
|arg9 =
|return = {{type|nil}} {{pipe}} {{type|bool}} hadEnough
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.
}}
Spring.UseTeamResource
( number teamID,
string "metal" | "energy",
number amount | { metal = number amount, energy = number amount } )
return: nil | bool hadEnough
- Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.