Difference between revisions of "User:Strife Onizuka/Sandbox/Switch/Template:Test"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{LSL Header}} __NOTOC__ <noinclude>
{{LSL Header}} __NOTOC__ <noinclude>
See [[{{FULLPAGENAME}}/docs]] for additional documentation.
<pre>
<pre>
{{LSL_Event
{{LSL_Function
|event
|func
|event_id
|func_id
|event_delay
|func_sleep
|event_desc
|func_energy
|event_footnote
|func_desc
|p1_type|p1_name|p1_desc
|func_footnote
|p2_type|p2_name|p2_desc
|return_type
|p3_type|p3_name|p3_desc
|return_text
|p4_type|p4_name|p4_desc
|p1_type|p1_name|p1_desc|p1_hover
|p5_type|p5_name|p5_desc
|p2_type|p2_name|p2_desc|p2_hover
|p6_type|p6_name|p6_desc
|p3_type|p3_name|p3_desc|p3_hover
|p7_type|p7_name|p7_desc
|p4_type|p4_name|p4_desc|p4_hover
|p8_type|p8_name|p8_desc
|p5_type|p5_name|p5_desc|p5_hover
|p9_type|p9_name|p9_desc
|p6_type|p6_name|p6_desc|p6_hover
|p10_type|p10_name|p10_desc
|p7_type|p7_name|p7_desc|p7_hover
|p11_type|p11_name|p11_desc
|p8_type|p8_name|p8_desc|p8_hover
|p12_type|p12_name|p12_desc
|p9_type|p9_name|p9_desc|p9_hover
|p10_type|p10_name|p10_desc|p10_hover
|p11_type|p11_name|p11_desc|p11_hover
|p12_type|p12_name|p12_desc|p12_hover
|constants
|constants
|spec
|spec
Line 27: Line 31:
|also_functions
|also_functions
|also_tests
|also_tests
|also_events
|also_articles
|also_articles
|also_footer
|also_footer
Line 32: Line 37:
|mode
|mode
|deprecated
|deprecated
|location
|cat1
|cat1
|cat2
|cat2
Line 38: Line 44:
|cat5
|cat5
|cat6
|cat6
|cat7
|cat8
}}
}}
</pre>
</pre>


See [[Template:LSL Function]] for syntax explanation (they are almost identical).
The LSL_Function template is a intermediate template for LSL_Generic, which handles the formating for both functions and events (LSL_Event is also an intermediate template). The main job of this template is to change the parameter, names & setup the right-side floater. Also makes permission requirements a part of the template.
 
{| {{Prettytable}}
|-{{Hl2}}
!parameter
!desc
!example
|-
|func
|Function name
|-
|func_id
|{{LSLG|Function ID}}
|1.0
|-
|func_sleep
|{{LSLG|Delay}}
|0.0
|-
|func_energy
|{{LSLG|Energy}}
|10.0
|-
|func_desc
|Function description text.
|Gives the monkey a banana
|-
|func_footnote
|Function footnote (appears after the parameters text).
|Has the side effect of causing the avatar to run in circles shouting like on fire.
|-
|return_type
|return type
|integer
|-
|return_text
|"Returns a return_type return_text" in most cases return_text can be used instead of func_desc.
|that is a monkey
|-
|p1_type
|first parameter type
|-
|p1_name
|first parameter name
|-
|p1_desc
|first parameter desc
|-
|p1_hover
|first parameter hover, if not included it defaults to p1_desc
|-
|p2_type
|second parameter type
|-
|p2_name
|second parameter name
|-
|p2_desc
|second parameter desc
|-
|p2_hover
|second parameter hover, if not included it defaults to p2_desc
|-
|...
|
|
|-
|p12_type
|twelfth parameter type
|
|-
|p12_name
|twelfth parameter name
|-
|p12_desc
|twelfth parameter desc
|-
|p12_hover
|twelfth parameter hover, if not included it defaults to p12_desc
|-
|constants
|constants area, no box, please use a table for this section.
|
|-
|spec
|spec box
|
|-
|caveats
|caveats box
|
|-
|examples
|examples box
|
|-
|helpers
|helper functions box
|
|-
|also_header
|also header
|
|-
|also_functions
|also functions indent
|
|-
|also_events
|also events indent
|
|-
|also_articles
|also articles indent
|
|-
|also_tests
|also tests indent
|
|-
|also_footer
|also footer
|
|-
|notes
|notes box
|
|-
|mode
|if mode equals 'god' then it is tagged as requiring godmode. if set to 'request' marks the page as a feature request.
|
|-
|deprecated
|Marks the function as deprecated. Set the value to the replacement functions name or 'none'. If it is not set to none and it is infact set, it will include a link to the replacement function.
|-
|self
|Special field that you only set if you don't want the function to be included in any categories.
|
|-
|cat1
|An LSL specific category and sets the proper sort. (example would add the function to the "LSL Stub" category)
|Stub
|-
|cat2
|"
|-
|cat3
|"
|-
|cat4
|"
|-
|cat5
|"
|-
|cat6
|"
|-
|sort
|not required but used to specify the sort order, if excluded the wiki will calculate this value for you.
|-
|location
|optional: location box, used to say which source file it is defined in.
|-
|history
|a box for function history
|}


<div id="box">
<div id="box">
{{{{FULLPAGENAME}}
{{LSL Function
|event=MyEvent
|func=MyFunction
|event_id=-1
|func_id=-1
|event_delay=100.5
|func_sleep=100.5
|event_desc=A fictitious Event
|func_energy=0.0
|event_footnote=event_footnote
|func_desc=A fictitious function
|func_footnote=func_footnote
|return_type=void
|return_text=(aka nadda, nothing).
|p1_type=integer|p1_name=i|p1_desc
|p1_type=integer|p1_name=i|p1_desc
|p2_type=float|p2_name=f|p2_desc
|p2_type=float|p2_name=f|p2_desc
Line 65: Line 238:
|helpers=helpers
|helpers=helpers
|also_header=also_header
|also_header=also_header
|also_events=
|also_events=*also_events
*also_events
|also_functions=*also_functions
|also_functions=
|also_articles=*also_articles
*also_functions
|also_tests=*also_tests
|also_tests=
*also_tests
|also_articles=
*also_articles
|also_footer=also_footer
|also_footer=also_footer
|notes=notes
|notes=notes
|mode
|mode
|self=self
|self=self
|location=location
|history=history
}}
}}
</div>
</div>
</noinclude><includeonly>{{#if:
</noinclude><includeonly>{{#if:{{#vardefine:sort|{{#if:{{#var:sort}}|{{#var:sort}}|{{{sort|}}}}}}}{{{{#if:{{#var:sort}}|!|LSL_Sort}}|}}}}<div id="sort" style="display:none">{{DEFAULTSORT:{{#var:sort}}}}{{#var:sort}}</div>{{#if:{{#var:nofixname}}||{{#if:{{#pos:{{lc:{{FULLPAGENAMEE}}}}|{{lc:{{{func}}}}}}}|<div id="RealTitleBanner" style="display:none"><span id="RealTitle">{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{{func}}}</span></div>}}}}{{#if:
{{#vardefine:p1_name|{{{p1_name|}}}}}{{#vardefine:p1_type|{{{p1_type|}}}}}{{#vardefine:p1_desc|{{{p1_desc|}}}}}
{{#vardefine:history|{{{history|}}}}}
{{#vardefine:p2_name|{{{p2_name|}}}}}{{#vardefine:p2_type|{{{p2_type|}}}}}{{#vardefine:p2_desc|{{{p2_desc|}}}}}
{{#vardefine:func_id|{{{func_id|}}}}}
{{#vardefine:p3_name|{{{p3_name|}}}}}{{#vardefine:p3_type|{{{p3_type|}}}}}{{#vardefine:p3_desc|{{{p3_desc|}}}}}
{{#vardefine:p_{{{p1_name|}}}_desc|{{#var:p_{{{p1_name|}}}_desc}}{{{p1_desc|}}}}}
{{#vardefine:p4_name|{{{p4_name|}}}}}{{#vardefine:p4_type|{{{p4_type|}}}}}{{#vardefine:p4_desc|{{{p4_desc|}}}}}
{{#vardefine:p_{{{p1_name|}}}_hover|{{#var:p_{{{p1_name|}}}_hover}}{{{p1_hover|}}}}}
{{#vardefine:p5_name|{{{p5_name|}}}}}{{#vardefine:p5_type|{{{p5_type|}}}}}{{#vardefine:p5_desc|{{{p5_desc|}}}}}
{{#vardefine:p_{{{p2_name|}}}_desc|{{#var:p_{{{p2_name|}}}_desc}}{{{p2_desc|}}}}}
{{#vardefine:p6_name|{{{p6_name|}}}}}{{#vardefine:p6_type|{{{p6_type|}}}}}{{#vardefine:p6_desc|{{{p6_desc|}}}}}
{{#vardefine:p_{{{p2_name|}}}_hover|{{#var:p_{{{p2_name|}}}_hover}}{{{p2_hover|}}}}}
{{#vardefine:p7_name|{{{p7_name|}}}}}{{#vardefine:p7_type|{{{p7_type|}}}}}{{#vardefine:p7_desc|{{{p7_desc|}}}}}
{{#vardefine:p_{{{p3_name|}}}_desc|{{#var:p_{{{p3_name|}}}_desc}}{{{p3_desc|}}}}}
{{#vardefine:p8_name|{{{p8_name|}}}}}{{#vardefine:p8_type|{{{p8_type|}}}}}{{#vardefine:p8_desc|{{{p8_desc|}}}}}
{{#vardefine:p_{{{p3_name|}}}_hover|{{#var:p_{{{p3_name|}}}_hover}}{{{p3_hover|}}}}}
{{#vardefine:p9_name|{{{p9_name|}}}}}{{#vardefine:p9_type|{{{p9_type|}}}}}{{#vardefine:p9_desc|{{{p9_desc|}}}}}
{{#vardefine:p_{{{p4_name|}}}_desc|{{#var:p_{{{p4_name|}}}_desc}}{{{p4_desc|}}}}}
{{#vardefine:p10_name|{{{p10_name|}}}}}{{#vardefine:p10_type|{{{p10_type|}}}}}{{#vardefine:p10_desc|{{{p10_desc|}}}}}
{{#vardefine:p_{{{p4_name|}}}_hover|{{#var:p_{{{p4_name|}}}_hover}}{{{p4_hover|}}}}}
{{#vardefine:p11_name|{{{p11_name|}}}}}{{#vardefine:p11_type|{{{p11_type|}}}}}{{#vardefine:p11_desc|{{{p11_desc|}}}}}
{{#vardefine:p_{{{p5_name|}}}_desc|{{#var:p_{{{p5_name|}}}_desc}}{{{p5_desc|}}}}}
{{#vardefine:p12_name|{{{p12_name|}}}}}{{#vardefine:p12_type|{{{p12_type|}}}}}{{#vardefine:p12_desc|{{{p12_desc|}}}}}
{{#vardefine:p_{{{p5_name|}}}_hover|{{#var:p_{{{p5_name|}}}_hover}}{{{p5_hover|}}}}}
{{#vardefine:return_end|<nowiki>{ ; }</nowiki>}}
{{#vardefine:p_{{{p6_name|}}}_desc|{{#var:p_{{{p6_name|}}}_desc}}{{{p6_desc|}}}}}
{{#vardefine:template}}
{{#vardefine:p_{{{p6_name|}}}_hover|{{#var:p_{{{p6_name|}}}_hover}}{{{p6_hover|}}}}}
{{#vardefine:name|{{{event}}}}}
{{#vardefine:p_{{{p7_name|}}}_desc|{{#var:p_{{{p7_name|}}}_desc}}{{{p7_desc|}}}}}
{{#vardefine:constants_nb|{{#var:constants_nb}}{{{constants|}}}}}
{{#vardefine:p_{{{p7_name|}}}_hover|{{#var:p_{{{p7_name|}}}_hover}}{{{p7_hover|}}}}}
{{#vardefine:spec|{{{spec|}}}}}
{{#vardefine:p_{{{p8_name|}}}_desc|{{#var:p_{{{p8_name|}}}_desc}}{{{p8_desc|}}}}}
{{#vardefine:p_{{{p8_name|}}}_hover|{{#var:p_{{{p8_name|}}}_hover}}{{{p8_hover|}}}}}
{{#vardefine:p_{{{p9_name|}}}_desc|{{#var:p_{{{p9_name|}}}_desc}}{{{p9_desc|}}}}}
{{#vardefine:p_{{{p9_name|}}}_hover|{{#var:p_{{{p9_name|}}}_hover}}{{{p9_hover|}}}}}
{{#vardefine:p_{{{p10_name|}}}_desc|{{#var:p_{{{p10_name|}}}_desc}}{{{p10_desc|}}}}}
{{#vardefine:p_{{{p10_name|}}}_hover|{{#var:p_{{{p10_name|}}}_hover}}{{{p10_hover|}}}}}
{{#vardefine:p_{{{p11_name|}}}_desc|{{#var:p_{{{p11_name|}}}_desc}}{{{p11_desc|}}}}}
{{#vardefine:p_{{{p11_name|}}}_hover|{{#var:p_{{{p11_name|}}}_hover}}{{{p11_hover|}}}}}
{{#vardefine:p_{{{p12_name|}}}_desc|{{#var:p_{{{p12_name|}}}_desc}}{{{p12_desc|}}}}}
{{#vardefine:p_{{{p12_name|}}}_hover|{{#var:p_{{{p12_name|}}}_hover}}{{{p12_hover|}}}}}
{{#vardefine:return_text|{{#var:return_text}}{{{return_text|}}} }}
{{#vardefine:spec|{{#if:{{#var:spec}}|{{#var:spec}}<br/>}}{{{spec|}}}}}
{{#vardefine:examples|{{#var:examples}}{{{examples|}}}}}
{{#vardefine:examples|{{#var:examples}}{{{examples|}}}}}
{{#vardefine:helpers|{{#var:helpers}}{{{helpers|}}}}}
{{#vardefine:helpers|{{#var:helpers}}{{{helpers|}}}}}
{{#vardefine:also_header|{{#var:also_header}}{{{also_header|}}}}}
{{#vardefine:also_header|{{#var:also_header}}{{{also_header|}}}}}
{{#vardefine:also_tests|{{#var:also_tests}}{{{also_tests|}}}}}
{{#vardefine:also_tests|{{#var:also_tests}}
{{#vardefine:also_events|{{#var:also_events}}{{{also_events|}}}}}
{{{also_tests|}}}}}
{{#vardefine:also_functions|{{#var:also_functions}}{{{also_functions|}}}}}
{{#vardefine:also_events|{{#var:also_events}}
{{#vardefine:also_articles|{{#var:also_articles}}{{{also_articles|}}}}}
{{{also_events|}}}}}
{{#vardefine:also_functions|{{#var:also_functions}}
{{{also_functions|}}}}}
{{#vardefine:also_articles|{{#var:also_articles}}
{{{also_articles|}}}}}
{{#vardefine:also_footer|{{#var:also_footer}}{{{also_footer|}}}}}
{{#vardefine:also_footer|{{#var:also_footer}}{{{also_footer|}}}}}
{{#vardefine:notes|{{#var:notes}}{{{notes|}}}}}
{{#vardefine:notes|{{#var:notes}}{{{notes|}}}}}
{{#vardefine:mode|{{#var:mode}}{{{mode|}}}}}
{{#vardefine:mode|{{#var:mode}}{{{mode|}}}}}
{{#vardefine:self|{{#var:self}}{{{self|}}}}}
{{#vardefine:self|{{#var:self}}{{{self|}}}}}
{{#vardefine:type|event}}
{{#vardefine:type|function}}
{{#vardefine:template}}
{{#vardefine:caveats|{{#ifexpr:{{{func_sleep|0.0}}}> 0.0|*This function causes the script to sleep for {{{func_sleep|}}} seconds.}}{{#if:{{#var:caveats}}|
{{#vardefine:caveats|{{#var:caveats}}{{{caveats|}}}}}
{{#var:caveats}}}}
{{{caveats|}}}}}
{{#vardefine:location|{{#var:location}}{{{location|}}}}}
{{#vardefine:location|{{#var:location}}{{{location|}}}}}
{{#vardefine:sort|{{#if:{{#var:sort}}|{{#var:sort}}|{{#if:{{{sort|}}}|{{{sort}}}|{{ucfirst:{{#var:name}}}}}}}}}}
{{#vardefine:header_footnote|{{#if:{{#var:header_footnote}}|{{#var:header_footnote}}<br/>}}{{{func_footnote|}}}{{{func_footer|}}}}}
{{#vardefine:footer|{{#var:footer}}}}
{{#vardefine:header_desc|{{#if:{{#var:header_desc}}|{{#var:header_desc}}<br/>}}{{#var:header_desc}}{{{func_desc|}}}}}
{{#vardefine:header_footnote|{{{event_footnote|}}}{{{event_footer|}}}}}
{{#vardefine:header_desc|{{{event_desc|event_desc undefined}}}}}
{{{{#ifeq:{{#var:mode}}|god|LSL_Generic/god|!}}|}}
{{{{#ifeq:{{#var:mode}}|god|LSL_Generic/god|!}}|}}
{{{{#ifeq:{{#var:mode}}|request|LSL_Generic/request|!}}|}}
{{{{#ifeq:{{#var:mode}}|request|LSL_Generic/request|!}}|}}
{{{{#if:{{{deprecated|}}}{{{depreciated|}}}|LSL_Generic/deprecated|!}}|{{{deprecated|}}}{{{depreciated|}}}|}}
{{{{#if:{{{deprecated|}}}|LSL_Generic/deprecated|!}}|{{{deprecated|}}}|}}
{{#vardefine:header_floater|<table><tr>
}}{{#if:{{#var:self}}|| __NOEDITSECTION__
<td>{{HoverText|{{{event_id|}}}|The event index number.}}
}}{{#var:header}}
<td>[[LSL Event ID|Event ID]]
{{#if:{{#var:func_id}}{{#var:mode}}||
</tr><tr>
<div id="box" style="background:red;">
<td>{{HoverText|{{{event_delay|}}}|Seconds between events of this type}}
&nbsp;&nbsp;'''Don't delete the 'func_id''''
<td>[[LSL Delay|Delay]]
<div style="padding: 0.5em;background:#ffffff;">
</tr></table>}}
''func_id is a bit of technical information that should not be removed as it is pertinent to anyone writing an LSL compiler or decompiler, so you go and revert the page or set the value properly right now :P.''</div></div>{{#if:{{#var:self}}|| [[Category:LSL FixMe]] }} }}
{{#vardefine:header_text|{{LSL Generic/Text}}}}
{{#if:{{{also|}}}|<div id="box" style="background:yellow;">
{{#vardefine:header_title|Event: {{LSL_Generic/Title}}}}
&nbsp;&nbsp;''' 'also' Tag Removed'''
}}{{#if:{{#var:header_desc}}||
<div style="padding: 0.5em;background:#ffffff;">
<div id="box" style="background:yellow;">
''(Please use 'also_header','also_events','also_functions','also_articles', or 'also_footer')''</div></div>{{#if:{{#var:self}}|| [[Category:LSL FixMe]] }} }}
&nbsp;&nbsp;''' 'event_desc' can not be undefined'''
{{#if:{{#if:{{{return_type|}}}|{{#var:return_text}}}}{{{func_desc|}}}||<div id="box" style="background:yellow;">
&nbsp;&nbsp;''' 'return_text' and 'func_desc' can both not be undefined'''
<div style="padding: 0.5em;background:#ffffff;">
<div style="padding: 0.5em;background:#ffffff;">
''(Please define a value for 'event_desc' to describe the events actions.)''</div></div>{{#if:{{{self|}}}|| {{LSLC|FixMe}} }} }}
''(Please use 'return_text' or 'func_desc' to describe the functions actions.)''</div></div>{{#if:{{#var:self}}|| [[Category:LSL FixMe]] }} }}
__NOTOC__ {{#vardefine:t|{{#pos:{{lc:{{PAGENAMEE}}}}|{{lc:{{#var:name}}}}}}}}{{#vardefine:t|{{#if:{{#var:t}}|{{#var:t}}|-1}}}}{{#ifexpr:not {{#var:t}} and {{#ifeq:{{#sub:{{ucfirst:{{#var:name}}}}|0|1}}|{{#sub:{{#var:name}}|0|1}}|0|1}}|{{lowercase}}}} {{#if:{{#var:P_Rendered}}||
{{#vardefine:P_Rendered|t}} {{#if:{{#var:self}}|| __NOEDITSECTION__ }} {{#var:header}}
{{{!}} width="100%"
{{{!}} width="100%"
{{!}}-
{{!}}-
{{!}} valign="top" {{!}} <div id="box">
{{!}} valign="top" {{!}} <div id="box">
<h2>{{#var:header_title}}</h2>
<h2>Function: {{#if:{{{return_type|}}}|[[{{{return_type|}}}]]||}} [[{{{func}}}]]( {{#if:{{{p1_name|}}}{{{p1_type|}}}| [[{{{p1_type|}}}]] {{LSL Param|{{{p1_name|}}}}}{{#if:{{{p2_name|}}}{{{p2_type|}}}|, [[{{{p2_type|}}}]] {{LSL Param|{{{p2_name|}}}}}{{#if:{{{p3_name|}}}{{{p3_type|}}}|, [[{{{p3_type|}}}]] {{LSL Param|{{{p3_name|}}}}}{{#if:{{{p4_name|}}}{{{p4_type|}}}|, [[{{{p4_type|}}}]] {{LSL Param|{{{p4_name|}}}}}{{#if:{{{p5_name|}}}{{{p5_type|}}}|, [[{{{p5_type|}}}]] {{LSL Param|{{{p5_name|}}}}}{{#if:{{{p6_name|}}}{{{p6_type|}}}|, [[{{{p6_type|}}}]] {{LSL Param|{{{p6_name|}}}}}{{#if:{{{p7_name|}}}{{{p7_type|}}}|, [[{{{p7_type|}}}]] {{LSL Param|{{{p7_name|}}}}}{{#if:{{{p8_name|}}}{{{p8_type|}}}|, [[{{{p8_type|}}}]] {{LSL Param|{{{p8_name|}}}}}{{#if:{{{p9_name|}}}{{{p9_type|}}}|, [[{{{p9_type|}}}]] {{LSL Param|{{{p9_name|}}}}}{{#if:{{{p10_name|}}}{{{p10_type|}}}|, [[{{{p10_type|}}}]] {{LSL Param|{{{p10_name|}}}}}{{#if:{{{p11_name|}}}{{{p11_type|}}}|, [[{{{p11_type|}}}]] {{LSL Param|{{{p11_name|}}}}}{{#if:{{{p12_name|}}}{{{p12_type|}}}|, [[{{{p12_type|}}}]] {{LSL Param|{{{p12_name|}}}}}}}}}}}}}}}}}}}}}}}}}}}}} )<nowiki>;</nowiki></h2>
<div style="padding: 0.5em">{{#if:{{#var:header_floater}}|<div id="box" style="float:right;">{{#var:header_floater}}</div>}}
<div style="padding: 0.5em"><div id="box" style="float:right;"><table class="collapsible" style="font-size:50%;"><tr><td colspan="2"></tr><tr>
{{#var:header_text}}
<td> {{HoverText|{{#var:func_id}}|The function index number.}}
{{#if:{{#var:header_floater}}|<div style="clear:right;" ></div>}}
<td> [[LSL Function ID|Function ID]]
</tr><tr>
<td> {{HoverText|{{{func_sleep|}}}|The number of seconds this script will sleep after executing this function.}}
<td> [[LSL Delay|Delay]]
</tr>{{#if:{{{func_complexity|}}}|<tr>
<td> {{HoverText|{{{func_complexity|}}}|The complexity of the function based on the parameters.}}
<td> [[LSL Complexity|Compl.]]
</tr>}}<tr>
<td> {{HoverText|{{{func_energy|}}}|The quantity of energy consumed by this function.}}
<td> [[Energy|Energy]]
</tr></table></div>
{{#if:{{#var:header_desc}}|{{#var:header_desc}}<br/>{{#if:{{{return_type|}}}|<br/>}}}}{{#if:{{{return_type|}}}| Returns {{AAn|{{{return_type|}}}}} {{#if:{{#var:return_text}}| {{#var:return_text}} }}<br/>}}
{{#if:{{{p1_name|}}}{{{p1_type|}}}|{{{!}}
{{LSL DefineRow|1={{{p1_type|}}}|2={{{p1_name|}}}|3={{#var:p_{{{p1_name|}}}_desc}}}}
{{#if:{{{p2_name|}}}{{{p2_type|}}}|{{LSL DefineRow|1={{{p2_type|}}}|2={{{p2_name|}}}|3={{#var:p_{{{p2_name|}}}_desc}}}}
{{#if:{{{p3_name|}}}{{{p3_type|}}}|{{LSL DefineRow|1={{{p3_type|}}}|2={{{p3_name|}}}|3={{#var:p_{{{p3_name|}}}_desc}}}}
{{#if:{{{p4_name|}}}{{{p4_type|}}}|{{LSL DefineRow|1={{{p4_type|}}}|2={{{p4_name|}}}|3={{#var:p_{{{p4_name|}}}_desc}}}}
{{#if:{{{p5_name|}}}{{{p5_type|}}}|{{LSL DefineRow|1={{{p5_type|}}}|2={{{p5_name|}}}|3={{#var:p_{{{p5_name|}}}_desc}}}}
{{#if:{{{p6_name|}}}{{{p6_type|}}}|{{LSL DefineRow|1={{{p6_type|}}}|2={{{p6_name|}}}|3={{#var:p_{{{p6_name|}}}_desc}}}}
{{#if:{{{p7_name|}}}{{{p7_type|}}}|{{LSL DefineRow|1={{{p7_type|}}}|2={{{p7_name|}}}|3={{#var:p_{{{p7_name|}}}_desc}}}}
{{#if:{{{p8_name|}}}{{{p8_type|}}}|{{LSL DefineRow|1={{{p8_type|}}}|2={{{p8_name|}}}|3={{#var:p_{{{p8_name|}}}_desc}}}}
{{#if:{{{p9_name|}}}{{{p9_type|}}}|{{LSL DefineRow|1={{{p9_type|}}}|2={{{p9_name|}}}|3={{#var:p_{{{p9_name|}}}_desc}}}}
{{#if:{{{p10_name|}}}{{{p10_type|}}}|{{LSL DefineRow|1={{{p10_type|}}}|2={{{p10_name|}}}|3={{#var:p_{{{p10_name|}}}_desc}}}}
{{#if:{{{p11_name|}}}{{{p11_type|}}}|{{LSL DefineRow|1={{{p11_type|}}}|2={{{p11_name|}}}|3={{#var:p_{{{p11_name|}}}_desc}}}}
{{#if:{{{p12_name|}}}{{{p12_type|}}}|{{LSL DefineRow|1={{{p12_type|}}}|2={{{p12_name|}}}|3={{#var:p_{{{p12_name|}}}_desc}}}}
}}}}}}}}}}}}}}}}}}}}}}
{{!}}} }}
{{#if:{{#var:header_footnote}}|<br/>
{{#var:header_footnote}}}}
<div style="clear:right;" ></div>
</div></div>
</div></div>
{{#if:{{#var:spec}}|{{!}}-
{{#if:{{#var:spec}}|{{!}}-
Line 150: Line 363:
</div></div>}}
</div></div>}}
{{!}}-
{{!}}-
{{#if:{{#var:constants_nb}}{{#var:constants}}|
{{#if:{{#var:constants_nb}}{{#var:constants}}{{{constants|}}}|
{{!}}{{#var:constants_nb}}{{#if:{{#var:constants}}|  
{{!}}{{#var:constants_nb}}{{{constants|}}}{{#if:{{#var:constants}}|  
<div id="box"><h2>{{#if:{{#var:T_Constants}}|{{#var:T_Constants}}|Constants}}</h2>
<div id="box"><h2>{{#if:{{#var:T_Constants}}|{{#var:T_Constants}}|Constants}}</h2>
{{#var:constants}}
{{#var:constants}}
Line 210: Line 423:
<div style="padding: 0.5em">
<div style="padding: 0.5em">
{{#var:location}}
{{#var:location}}
</div></div>}}
{{!}}-
{{#if:{{#var:history}}|
{{!}}
<div id="box">
<h2>{{#if:{{#var:T_History}}|{{#var:T_History}}|History}}</h2>
<div style="padding: 0.5em">
{{#var:history}}
</div></div>}}
</div></div>}}
{{!}}}
{{!}}}
{{#var:footer}}<span id="sort" style="visibility:hidden">{{#var:sort}}</span>}}
{{#var:footer}} {{#if:{{#var:self}}|| {{#ifeq:{{#var:mode}}|request|| [[Category:LSL Functions]] {{#if:{{#var:examples}}||[[Category:LSL Needs Example]]}}}} {{#if:{{{cat1|}}}|[[Category:LSL {{{cat1}}}]]}} {{#if:{{{cat2|}}}|[[Category:LSL {{{cat2}}}]]}} {{#if:{{{cat3|}}}|[[Category:LSL {{{cat3}}}]]}} {{#if:{{{cat4|}}}|[[Category:LSL {{{cat4}}}]]}} {{#if:{{{cat5|}}}|[[Category:LSL {{{cat5}}}]]}} {{#if:{{{cat6|}}}|[[Category:LSL {{{cat6}}}]]}} {{#if:{{{cat7|}}}|[[Category:LSL {{{cat7}}}]]}} {{#if:{{{cat8|}}}|[[Category:LSL {{{cat8}}}]]}} }}</includeonly>
{{#if:{{{self|}}}||{{#ifeq:{{#var:mode}}|request||{{LSLC|Events|{{#var:sort}}}}}} {{#if:{{#var:examples}}||{{LSLC|Needs Example|{{#var:sort}}}}}} {{#if:{{{cat1|}}}|{{LSLC|{{{cat1}}}|{{#var:sort}}}}}} {{#if:{{{cat2|}}}|{{LSLC|{{{cat2}}}|{{#var:sort}}}}}} {{#if:{{{cat3|}}}|{{LSLC|{{{cat3}}}|{{#var:sort}}}}}} {{#if:{{{cat4|}}}|{{LSLC|{{{cat4}}}|{{#var:sort}}}}}} {{#if:{{{cat5|}}}|{{LSLC|{{{cat5}}}|{{#var:sort}}}}}} {{#if:{{{cat6|}}}|{{LSLC|{{{cat6}}}|{{#var:sort}}}}}} {{#if:{{{cat7|}}}|{{LSLC|{{{cat7}}}|{{#var:sort}}}}}} {{#if:{{{cat8|}}}|{{LSLC|{{{cat8}}}|{{#var:sort}}}}}} }}</includeonly>

Revision as of 19:22, 20 July 2007

See User:Strife Onizuka/Sandbox/Switch/Template:Test/docs for additional documentation.

{{LSL_Function
|func
|func_id
|func_sleep
|func_energy
|func_desc
|func_footnote
|return_type
|return_text
|p1_type|p1_name|p1_desc|p1_hover
|p2_type|p2_name|p2_desc|p2_hover
|p3_type|p3_name|p3_desc|p3_hover
|p4_type|p4_name|p4_desc|p4_hover
|p5_type|p5_name|p5_desc|p5_hover
|p6_type|p6_name|p6_desc|p6_hover
|p7_type|p7_name|p7_desc|p7_hover
|p8_type|p8_name|p8_desc|p8_hover
|p9_type|p9_name|p9_desc|p9_hover
|p10_type|p10_name|p10_desc|p10_hover
|p11_type|p11_name|p11_desc|p11_hover
|p12_type|p12_name|p12_desc|p12_hover
|constants
|spec
|caveats
|examples
|helpers
|also_header
|also_functions
|also_tests
|also_events
|also_articles
|also_footer
|notes
|mode
|deprecated
|location
|cat1
|cat2
|cat3
|cat4
|cat5
|cat6
}}

The LSL_Function template is a intermediate template for LSL_Generic, which handles the formating for both functions and events (LSL_Event is also an intermediate template). The main job of this template is to change the parameter, names & setup the right-side floater. Also makes permission requirements a part of the template.

parameter desc example
func Function name
func_id Function ID 1.0
func_sleep Delay 0.0
func_energy Energy 10.0
func_desc Function description text. Gives the monkey a banana
func_footnote Function footnote (appears after the parameters text). Has the side effect of causing the avatar to run in circles shouting like on fire.
return_type return type integer
return_text "Returns a return_type return_text" in most cases return_text can be used instead of func_desc. that is a monkey
p1_type first parameter type
p1_name first parameter name
p1_desc first parameter desc
p1_hover first parameter hover, if not included it defaults to p1_desc
p2_type second parameter type
p2_name second parameter name
p2_desc second parameter desc
p2_hover second parameter hover, if not included it defaults to p2_desc
...
p12_type twelfth parameter type
p12_name twelfth parameter name
p12_desc twelfth parameter desc
p12_hover twelfth parameter hover, if not included it defaults to p12_desc
constants constants area, no box, please use a table for this section.
spec spec box
caveats caveats box
examples examples box
helpers helper functions box
also_header also header
also_functions also functions indent
also_events also events indent
also_articles also articles indent
also_tests also tests indent
also_footer also footer
notes notes box
mode if mode equals 'god' then it is tagged as requiring godmode. if set to 'request' marks the page as a feature request.
deprecated Marks the function as deprecated. Set the value to the replacement functions name or 'none'. If it is not set to none and it is infact set, it will include a link to the replacement function.
self Special field that you only set if you don't want the function to be included in any categories.
cat1 An LSL specific category and sets the proper sort. (example would add the function to the "LSL Stub" category) Stub
cat2 "
cat3 "
cat4 "
cat5 "
cat6 "
sort not required but used to specify the sort order, if excluded the wiki will calculate this value for you.
location optional: location box, used to say which source file it is defined in.
history a box for function history

Summary

Function: void MyFunction( integer i, float f, string s, key k, list l, vector v, rotation r );

A fictitious function
Returns a void (aka nadda, nothing).

• integer i
• float f
• string s
• key k
• list l
• vector v
• rotation r

func_footnote

Specification

spec

constants

Caveats

  • This function causes the script to sleep for 100.5 seconds.caveats
All Issues ~ Search JIRA for related Bugs

Examples

examples

Useful Snippets

helpers

Notes

notes

See Also

also_header

Events

  • also_events

Functions

  • also_functions

Articles

  • also_articles

also_footer

Deep Notes

History

history
Search JIRA for related Issues

Tests

  • also_tests

Source

location

Signature

function void MyFunction( integer i, float f, string s, key k, list l, vector v, rotation r );