RuneScape:Calculators/Form calculators/Examples

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
This page contains examples for RuneScape:Calculators/Form calculators.

Param Examples[edit source]

Templates
Templates used
FormCalcExamples/params

An overview of the available parameter types.

 template = Template:FormCalcExamples/params
 form = parameExForm
 name = Display Name for Calculator
 result = paramExResults
 suggestns = 0,1,14,15
 param = strinp|String (Default)|Default value|string|||inline=Some inline help text
 param = artinp|Article||article|||This is regular help text
 param = numino|Number (0 to ifinity)|1.2|number|0-
 param = intinp|Integer (-Inf to Inf)|-10|int|-Infinity-Infinity
 param = checkinp|Check (produces values of ischecked and notchecked via range)||check|ischecked,notchecked
 param = toginp|Toggle (toggles group below)|true|toggleswitch||group1|inline=Press toggle to hide group below
 param = group1|Group||group|togbut,selinp
 param = togbut|Button toggle||togglebutton
 param = selinp|Select|Option 1|select|Option 1,Option 2,Option 3
 param = butsel|Button select|Option B|buttonselect|Option A,Option B,Option C|Option A=combinp;Option B=combinp|inline=Options A and B show the following Combobox input while C hides it.
 param = combinp|Combobox||combobox|First item,Second item,Third item||Start typing to display options
 param = highinp|Highscore Input (populates following field)|Zezima|hs|fixinp,4,1
 param = fixinp|Fixed input (Displays constitution level of player above)||fixed
 param = rsnimp|Runescape name||rsn
The JS calculator was not able to load.

Hiding fields[edit source]

Templates
Templates used
FormCalcExamples/hidden

Example of hiding other fields/groups based on another input. Toggle the top toggle Toggle a Group to toggle a group containing 2 text inputs. Change the button selector Select an input to display to display one of 3 fixed inputs. Change the number Change number to show/hide field between 0 and any other number to display one of 2 toggle buttons.

 template = Template:FormCalcExamples/hidden
 form = hideExForm
 name = Example of toggled fields
 result = hideExResult
 param = tog1|Toggle a Group|true|toggleswitch||togroup|inline=Toggle to show/hide a group of inputs
 param = togroup|Toggled Group||group|inp1,inp2
 param = inp1|Input1||string
 param = inp2|Input2||string
 param = sel1|Select an input to display|Item 1|buttonselect|Item 1,Item 2,Item 3|Item 1=fix1;Item 2=fix2;Item 3=fix3
 param = fix1|Fixed input 1|Example 1|fixed
 param = fix2|Fixed input 2|Example 2|fixed
 param = fix3|Fixed input 3|Example 3|fixed
 param = num1|Change number to show/hide field|0|int||0=but1;not0=but2
 param = but1|Button for 0||togglebutton
 param = but2|Button for not 0||togglebutton
The JS calculator was not able to load.

Code[edit source]

<!-- Parameters to pass to the calculator.  This part is hidden on the page.  -->
<!-- param=Parameter Name|Displayed Name|Default Value|Input Type|Range|Toggles|Help -->
<pre class="jcConfig">
 template = Template:FormCalcExamples/hidden
 form = hideExForm
 name = Example of toggled fields
 result = hideExResult
 param = tog1|Toggle a Group|true|toggleswitch||togroup|inline=Toggle to show/hide a group of inputs
 param = togroup|Toggled Group||group|inp1,inp2
 param = inp1|Input1||string
 param = inp2|Input2||string
 param = sel1|Select an input to display|Item 1|buttonselect|Item 1,Item 2,Item 3|Item 1=fix1;Item 2=fix2;Item 3=fix3
 param = fix1|Fixed input 1|Example 1|fixed
 param = fix2|Fixed input 2|Example 2|fixed
 param = fix3|Fixed input 3|Example 3|fixed
 param = num1|Change number to show/hide field|0|int||0=but1;not0=but2
 param = but1|Button for 0||togglebutton
 param = but2|Button for not 0||togglebutton
</pre>

<!-- Here is the visible part of the calculator: the form and result -->
{| cellspacing="15" cellpadding="0" width="100%"
| valign="top" min-width="350" width="70%" | <div id="hideExForm">The JS calculator was not able to load.</div>
| valign="top" | <div id="hideExResult"></div>
|}

Expression Calculator[edit source]

Templates
Templates used
FormCalcExamples/expr

Enter a mathematical expression in the field. Any expression that works with the #expr parser function is valid.

 template  = Template:FormCalcExamples/expr
 form      = exprCalcForm
 result    = exprCalcResult
 param     = Expression||2 + 2|string|
The JS calculator was not able to load.

Code[edit source]

<!-- Parameters to pass to the calculator. This part is hidden on the page. -->
<!-- param=Parameter Name|Displayed Name|Default Value|Input Type -->
<pre class="jcConfig">
 template  = Template:FormCalcExamples/expr
 form      = exprCalcForm
 result    = exprCalcResult
 param     = Expression||2 + 2|string|
</pre>

<!-- Here is the visible part of the calculator: the form and result -->
{| cellspacing="15" cellpadding="0" width="100%"
| valign="top" min-width="350" width="33%" | <div id="exprCalcForm">This text will disappear if the form is loaded properly.</div>
| valign="top" | <div id="exprCalcResult">This text will disappear if the form is submitted.</div>
|}

GE Value Calculator[edit source]

Templates
Templates used
FormCalcExamples/GE

Enter an item on the Grand Exchange to check the current price. Optionally, enter a quantity to find the total value of the item.

 template  = Template:FormCalcExamples/GE
 form      = geCalcForm
 result    = geCalcResult
 suggestns = 112
 param     = Item|Item Name||article
 param     = qty|Quantity||int|1-
The JS calculator was not able to load.

Code[edit source]

<!-- Parameters to pass to the calculator. This part is hidden on the page. -->
<!-- param=Parameter Name|Displayed Name|Default Value|Input Type -->
<pre class="jcConfig">
 template  = Template:FormCalcExamples/GE
 form      = geCalcForm
 result    = geCalcResult
 suggestns = 112
 param     = Item|Item Name||article
 param     = qty|Quantity|1|int|1-
</pre>

<!-- Here is the visible part of the calculator: the form and result -->
{| cellspacing="15" cellpadding="0" width="100%"
| valign="top" min-width="350" width="33%" | <div id="geCalcForm">This text will disappear if the form is loaded properly.</div>
| valign="top" | <div id="geCalcResult">This text will disappear if the form is submitted.</div>
|}

Player Hiscores[edit source]

Templates
Templates used
FormCalcExamples/hiscores

View the hiscores of the given player. This uses the RSHiscores extension by TehKittyCat.

 template  = Template:FormCalcExamples/hiscores
 form      = hsCalcForm
 result    = hsCalcResult
 param     = Player|Player Name|Zezima|rsn
The JS calculator was not able to load.

Code[edit source]

<!-- Parameters to pass to the calculator. This part is hidden on the page. -->
<!-- param=Parameter Name|Displayed Name|Default Value|Input Type -->
<pre class="jcConfig">
 template  = Template:FormCalcExamples/hiscores
 form      = hsCalcForm
 result    = hsCalcResult
 param     = Player|Player Name|Zezima|rsn
</pre>

<!-- Here is the visible part of the calculator: the form and result -->
{| cellspacing="15" cellpadding="0" width="100%"
| valign="top" min-width="350" width="33%" | <div id="hsCalcForm">The JS calculator was not able to load.</div>
| valign="top" | <div id="hsCalcResult"></div>
|}