Template:LuaCallout: Difference between revisions
From Spring
Jump to navigationJump to search
Adapted the API template to feature a readable code for the respective function arguments |
m removed superfluous line break |
||
| Line 11: | Line 11: | ||
}} ) | }} ) | ||
{{#if: {{{return|}}}|<br>return: {{var|1={{{return}}}}}|}} | {{#if: {{{return|}}}|<br>return: {{var|1={{{return}}}}}|}} | ||
:{{#if: {{{info|}}} | | :{{#if: {{{info|}}} | {{{info}}} | }}</includeonly><noinclude> | ||
==Lua Callout usage example== | ==Lua Callout usage example== | ||
Revision as of 00:04, 3 February 2021
Lua Callout usage example
{{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.