User:Stewbasic/calc

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search

This page demonstrates a proposed new version of the javascript calculators. It aims to

See RuneScape:WikiGuilds/Calculators#Ideas_for_extending_the_calculators for more details.

Specification[edit | edit source]

A javascript calculator consists of inputs and subs.

Inputs[edit | edit source]

Any html element (eg a div, span, td) can be marked as an input by giving it the class "jcInput". The contents of the element should specify parameters for the input in the following format.

param1=value1|param2=value2|...|paramN=valueN

This contents will be replaced by an input element once the page is loaded. The following parameters may be specified.

Parameter Description Default
name The name of the variable to which this field is tied. Two fields should not share the same variable. It should follow the variable naming conventions described below in Subs. 'x' followed by a number
type The type of input field. The following are allowed:
  • string - Input box for string input.
  • number - Input box for numeric input.
  • int - Input box for integer input.
  • select - Drop-down box for selecting between a set of possible choices. Value passed to subs is the position of the option in the list specified by range, starting at 0.
  • radio - A column of labelled radio buttons, also for selecting between a set of possible choices. Value passed to subs is the position of the option in the list specified by range, starting at 0.
  • check - A checkbox for a yes/no input. Value passed to subs is 1 for checked and 0 for unchecked.
  • button - A button which may be clicked to execute a calculation. For this field the "name" parameter has no effect other than on the caller variable.
  • output - Displays the value of the variable to which the field is tied. Can't be edited by the user.
  • img - Displays the image whose name on the wiki is the value of the variable (the value may optionally begin with "File:"). It is recommended to cache the image in an image bank.
string
value The default value of the variable. For button field types, this determines the text displayed in the button. empty (for string and output fields)

0 (for other fields)

range For number and int fields, this specifies a range of allowed numbers, in the form min,max. inf and -inf may be used to specify infinity.

For string fields, this is a comma-separated set of suggestions used to autocomplete the user's input.

For select and radio fields, this is a comma-separated set of choices.

default (for select and radio fields)

unset (for other fields)

namespaces A string field with this parameter set will autocomplete the user's input to an article name. The value of the parameter should be a comma-separated list of namespace IDs from the table below,

indicating which namespaces to search. This parameter overrides the range parameter.

unset
size For string, number, and int field types, this specifies the width of the input box.

For a select field, setting this greater than one changes the box to a scrollable box displaying this many rows.

For an img field type this should take the form w,h or w, where w and h are the desired width and height of the image in pixels. If left unspecified, the default size of the image is used.

1 (for select fields)

Use default size of image (for img fields) 20 otherwise

style Specifies the CSS styling to be applied to the control. blank
sublist A sequence of sub names, separated by commas, which will be executed in order when the input interacted with. This happens on click for check, button, img, output and radio fields, on change for select fields and on keyup for string, number and int fields. See Subs for more details. blank
entersublist A sequence of sub names, separated by commas, which will be executed in order when enter is pressed. Applies to string, int and number fields. Note that any subs in sublist will also be run. blank
Namespace IDs
Namespace Article ID Talk ID
Media -2 N/A
Special -1 N/A
(main) 0 1
User 2 3
RuneScape 4 5
File 6 7
MediaWiki 8 9
Template 10 11
Help 12 13
Category 14 15
Update 100 101
Forum 110 111
Exchange 112 113

See Woodcutting calculator for a simple example.

Image banks[edit | edit source]

Any html element (such as a div) may be given the class "jcImageBank". This will cause it to be hidden. The intended use of this is as follows.

If an image is to be used by an img field, it is advised to have it appear somewhere on the page. Otherwise the calculator will need to query the wiki for both the url of the image and the image itself when it runs. If the image would not otherwise appear on the page, it should be placed in an image bank so as to be loaded and cached, but not shown to the user until the calculator displays it.

See Runecrafting calculator for an example.

Cookies[edit | edit source]

Calculators can indicate that certain variables should be saved to a cookie. Thus when a user returns to the calculator, or even a different calculator with the same variable names, the data that they entered can be restored. To achieve this, some html element (such as a div) should be given the class "jcCookies". The contents, which will be hidden, should take the form

expiry=Days|variables=Variable1,Variable2,...

Here Days is an integer representing the number of days before the cookie should expire (it can be written as a product, eg 52*7), and variables is a comma separated list of variables to save and load. See Penguin list for an example. It is recommended that the following standard variable names are used for inputs which are likely to appear in different calculators.

Variable name Meaning
skillstat_Skillname_level The player's skill level in some skill, where Skillname is the name of the skill such as Attack, Defence...
skillstat_Skillname_XP The player's experience in some skill, where Skillname is the name of the skill such as Attack, Defence...
skillstat_Skillname_rank The player's rank in some skill, where Skillname is the name of the skill such as Attack, Defence...
character_name The character name of the player.

Panes[edit | edit source]

Panes also act as input to the calculator, but are created differently. Any html element (eg a div, span, td) can be marked as a pane by giving it the class "jcPane". The contents of the pane will not be changed. A variable may be tied to the pane by setting the ID of the element to the variable name (again, the variable should not be shared by any other field). This allows the show method to be used on the pane, as in Max hit calculator.

A pane may also be set to cycle through a number of colours when clicked. The variable to which the pane is tied will take a numerical value indicating the current colour of the pane. Like other fields, the pane may also be set to execute subs when clicked. To achieve this, a colour group should first be defined by giving an html element the class "jcColours". The contents of this element should take the form

name=GroupName|colours=colour1,colour2,...|highlight=colour|sublist=sub1,sub2,...

where GroupName is an identifying name for the colour group, each colour is in a format recognisable by html (examples are #F00, #FF0000, red, transparent), and sublist is a comma separated list of sub names to execute when a pane is clicked, just as for an input field. Finally highlight is a colour to be displayed when the mouse moves over the pane. All parameters except name are optional. To make a pane part of this colour group, it should be given the class "jcPaneGroupName" rather than "jcPane". GroupName should follow the same naming convention as variables, as described in Subs. See Flip puzzle for an example.

Subs[edit | edit source]

A sub can be defined by creating a div with class "jcSub". The contents, which will automatically be hidden, should take the form

SubName|CommandList

where SubName is the name by which the sub is referred to in the sublist parameter of an input field or colour group. CommandList should be a sequence of commands of the following form. They should not be separated by any character, though whitespace (spaces, tabs and newlines) will be ignored.

If multiple subs are defined with the same name, their code will be concatenated in the order they appear on the page. This is particularly useful if multiple calculators on the same page each need init subs.

Command Description
let(VariableName,Expression) Evaluates the Expression and sets VariableName equal to the result. If VariableName is tied to an input field or pane, it will be updated accordingly.
letarray(ArrayName,Expression1,Expression2,...,ExpressionN) For I ranging from 1 to N, evaluates ExpressionI and sets ArrayName_I to the result. Also sets ArrayName_Length to N.
letarrays(ArrayName1,ArrayName2) Sets ArrayName1_Length to ArrayName2_Length (capped at 100). For I ranging from 1 to ArrayName1_Length, sets ArrayName1_I to ArrayName2_I.
if(Expression){CommandList1}

if(Expression){CommandList1}{CommandList2}

Evaluates the Expression. If the result is nonzero, executes CommandList1. If the result is zero and there is a CommandList2, those are executed. Note that the curly braces are mandatory.
show(VariableName,Expression) Evaluates the Expression. Makes the input field or pane tied to VariableName invisible if the result is zero, and visible otherwise.
enable(VariableName,Expression) Evaluates the Expression. Makes the input field tied to VariableName disabled if the result is zero, and enabled otherwise.
parse(OutputVariable,Expression) Evaluates the Expression, and asks the wiki to parse the result, intepreted as wiki markup. Puts the result in OutputVariable.
get(TemplateName,OutputVariable,InputVariable1,InputVariable2,...) Asks the wiki to parse the template titled TemplateName (a string, quotes not required), and puts the result in OutputVariable. The InputVariables will be passed as arguments to the template. This is similar to the calculators which use the current code. This functionality is encompassed by the more general parse command.

The parameters passed to the template are named the variable name with the value of the variable. For example

let(a,1)
let(b,2)
let(c,"Hello")
get(Example,output,a,b,c)
will attempt to parse {{Example|a=1|b=5|c=Hello}} and store the result in variable output.
hiscores(CharacterName)

hiscores(CharacterName,Prefix)

Takes the contents of the variable CharacterName to be the character name of a player, and queries Jagex's hiscores page for their skill levels, XP and rank. Puts the results into the variables Prefix_Attack_level, Prefix_Attack_XP, Prefix_Attack_rank, Prefix_Defence_level, and so on. Prefix must follow the variable name conventions, and defaults to "skillstat" if omitted.

All variable names should start with a letter, and contain only numbers, letters and underscores. Also they should not coincide with the names of any of the operators listed below.

The syntax of expressions is for the most part standard, and the same as those of JavaScript (which ultimately is used to evaluate the expressions). They may contain the following operators.

Operator Meaning (if not standard)
+ As in JavaScript, denotes concatenation of strings (as well as addition of numbers)
Identical to + (but with much lower precedence)
-
*
&& Identical to * (but with much lower precedence)
/
& Bitwise AND
Bitwise OR
^ Bitwise XOR
>> Bit shift right
<< Bit shift left
^^ Raise to a power
= Test equality - "a=b" is 1 if a and b are equal, and 0 otherwise
!= Test inequality - "a!=b" is 0 if a and b are equal, and 1 otherwise
< Test less than - "a<b" is 1 if a is less than b, and 0 otherwise
> Test greater than - "a>b" is 1 if a is greater than b, and 0 otherwise
mod
! negation - "!a" is 1 if a is 0, and 0 otherwise

They may also include the functions floor, ceil, sin, cos, tan, exp and log, all of which have their usual meanings. Also the functions uc and lc put strings in upper and lower case respectively, and the function cc capitalizes the first letter of each word. Finally they may include parentheses, variables, and numerical and string constants. The latter should be delimited by quotation characters ("). Any quotation characters inside the string should be prefixed by a backslash (\").

Variable name substitution[edit | edit source]

A variable used in an expression or command (but not one tied to an input field or pane) may contain a substring of the form $Name, where Name is a regular variable name containing no underscores. When the expression is evaluated or the command run, this substring will be replaced by the value of the variable Name. Note that if the character $ appears in the value of Name, it will be removed to prevent recursion. This allows for array-like expressions. For example,

let(a0,1)
let(a1,3)
let(a2,4)
let(i,1)
let(output,a$i)

will set the variable output to 3. See Array example and POH planner for examples.

Special variables[edit | edit source]

Any errors encountered during the parsing or execution of the calculator will be appended to the special variable error. It is recommended to have an output field tied to this variable, especially during the calculator's development.

When interaction with an input field or pane causes a sub to be run, the special variable caller will be set to the name of the variable tied to the input field or pane. Moreover if this variable name contains any underscores, it will be split into substrings not containing underscores, and these parts will be assigned to the variables caller0, caller1, and so on. See Array example for an example.

The sub named init will be run once when the page is loaded.

An input with the range parameter set (such as a string, number, int, select or radio input) will have associated variables x_range_0, x_range_1 and so, as well as x_range_length, where x is the name of the variable tied to the input. These may be changed using let or letarray commands, and for select and radio inputs, they may be hidden and disabled using the show and enable commands.

Examples[edit | edit source]

To see the examples, you will need to enable javascript.

name=error|type=output

Max hit calculator[edit | edit source]

The three form tables are shown and hidden depending on which style the user chooses. Note that selecting either salve amulet excludes the beserker necklace and slayer helm, and vice versa.

variables=skillstat_Strength_level,skillstat_Ranged_level
Combat style type=select|name=style|range=Melee,Range,Magic|value=0|sublist=showpane,calcmaxhit|style=width:400;
Strength level name=skillstat_Strength_level|type=int|value=1|range=1,99|sublist=calcmaxhit Strength bonus name=strbonus|type=int|value=0|range=0,inf|sublist=calcmaxhit
Salve Amulet? name=salve|type=radio|range=No,Salve amulet,Salve amulet(e)|sublist=salve,calcmaxhit Berserker necklace with obsidian weapon? name=berserker|type=check|sublist=nosalve,calcmaxhit
Slayer helm/black mask? name=slayer|type=check|sublist=nosalve,calcmaxhit
Range level name=skillstat_Ranged_level|type=int|value=1|range=1,99|sublist=calcmaxhit Range strength bonus name=rangestrbonus|type=int|value=0|range=0,inf|sublist=calcmaxhit
Spell name=spell|type=select|range=Wind Strike,Water Strike,Earth Strike,Fire Strike|sublist=calcmaxhit
name=maxhit|type=output
showpane|

show(meleepane,style=0) show(rangepane,style=1)

show(magicpane,style=2)
salve|if(salve){let(berserker,0) let(slayer,0)}
nosalve|if(berserker+slayer){let(salve,0)}
calcmaxhit|

if(style=0){ let(mystr,skillstat_Strength_level) if(salve=1){let(mystr,mystr*1.15)} if(salve=2){let(mystr,mystr*1.2)} if(slayer){let(mystr,mystr*1.15)} let(damage,(mystr+8)*(strbonus+64)/64+5) if(berserker){let(damage,damage*1.2)} let(damage,floor(damage)) let(maxhit,"Your max hit is "+damage+" lp in melee") }{if(style=1){ let(maxhit,"Your max hit is "+(5+floor((skillstat_Ranged_level+8)*(rangestrbonus+64)/64))+" lp in range") }{ if(spell=0){let(m,20)} if(spell=1){let(m,40)} if(spell=2){let(m,60)} if(spell=3){let(m,80)} let(maxhit,"Your max hit is "+m+" lp in magic") } }

init|show(rangepane,0)show(magicpane,0)

Lower case and upper case[edit | edit source]

Lower case Upper case Capitalized
name=stringin|sublist=uclc name=stringin_lc|type=output name=stringin_uc|type=output name=stringin_cc|type=output
name=intin|type=int|sublist=uclc name=intin_lc|type=output name=intin_uc|type=output name=intin_cc|type=output
uclc|

let($caller_lc,lc($caller)) let($caller_uc,uc($caller)) let($caller_cc,cc($caller))

Hiding and disabling inputs[edit | edit source]

It's also possible to show and hide input textboxes, checkboxes, select boxes and radio buttons by referring to the corresponding variable name. This may or may not be useful...

type=button|value=Toggle display|sublist=togglestuff name=stuff1|type=radio|range=option 1,option 2,option 3 name=stuff2 name=stuff3|type=check name=stuff4|type=select|range=option 1,option 2,option 3 togglestuff|

show(stuff1,showstuff) show(stuff2,showstuff) show(stuff3,showstuff) show(stuff4,showstuff) let(showstuff,10-showstuff)

Here we enable and disable some inputs with the magic word "please".

What's the magic word? name=please|sublist=sayplease
name=disable_1|value=I'm a button!|type=button|sublist=dosomething name=disable_2|sublist=dosomething
Please indicate whether you are awesome. name=disable_3|type=check|sublist=dosomething
How awesome, exactly? name=disable_4|type=radio|range=Only a little bit awesome\, really,Rather awesome indeed|sublist=dosomething
Please select your awesomeness level from the following list. name=disable_5|type=select|range=Insignificant,Average,Quite significant,Over 9000|sublist=dosomething
name=disable_output|type=output
init|

enable(disable_1,0) enable(disable_2,0) enable(disable_3,0) enable(disable_4,0) enable(disable_5,0)

sayplease|

let(en,please="please") enable(disable_1,en) enable(disable_2,en) enable(disable_3,en) enable(disable_4,en) enable(disable_5,en)

dosomething|

if(caller1=1){let(disable_output,"You pressed a button!")} if(caller1=2){let(disable_output,"You typed "+$caller)} if(caller1=3){if($caller){let(disable_output,"You are awesome!")}{let(disable_output,"You are not awesome.")}} if(caller1=4){let(index,$caller) let(disable_output,"You are: "+$caller_range_$index)} if(caller1=5){let(index,$caller) let(disable_output,"Your awesomeness level is: "+$caller_range_$index)}

Setting range example[edit | edit source]

Input to change name=inputnum|type=select|range=Select,Radio,String|sublist=setinputnum,setrangeindex
Range length name=range_length|type=int|sublist=setrangelength
Index name=index|type=int|sublist=setrangeindex
Value name=range_value|sublist=setrangevalue
Disable type=check|sublist=disablerange
Hide type=check|sublist=hiderange
type=Button|value=Reset|sublist=resetrange,setinputnum,setrangeindex
Select name=rangeinput_0|type=select|range=Option A,Option B,Option C,Different option
Radio name=rangeinput_1|type=radio|range=x
String name=rangeinput_2|range=x|sublist=setrangeoutput
name=rangeoutput|type=output
setinputnum|let(range_length,rangeinput_$inputnum_range_length) let(index,0)
setrangelength|let(rangeinput_$inputnum_range_length,range_length)
setrangeindex|let(range_value,rangeinput_$inputnum_range_$index)
setrangevalue|let(rangeinput_$inputnum_range_$index,range_value)
resetrange|letarrays(rangeinput_$inputnum_range,range_default)
setrangeoutput|let(rangeoutput,$caller)
disablerange|enable(rangeinput_$inputnum_range_$index,1-$caller)
hiderange|show(rangeinput_$inputnum_range_$index,1-$caller)
init|

letarrays(range_default,rangeinput_0_range) letarrays(rangeinput_1_range,range_default) letarrays(rangeinput_2_range,range_default) let(range_length,rangeinput_0_range_length) let(range_value,rangeinput_0_range_0)

Woodcutting calculator[edit | edit source]

Just to show how the GEP template would fit in...

Experience needed: name=xpwanted|type=int|range=0,inf|sublist=calcwc calcwc|

let(magiclogs,ceil(xpwanted/250)) let(magiccash,magiclogs*566) let(yewlogs,ceil(xpwanted/175)) let(yewcash,yewlogs*299) let(wcoutput,"Cut "+magiclogs+" magic logs and earn "+magiccash+"gp or cut "+yewlogs+" yew logs and earn "+yewcash+"gp")

type=output|name=wcoutput

Flip puzzle[edit | edit source]

This solves the tile flipping puzzle in Dungeoneering (it's ported from a tool I made and hosted off the wiki). Primarily this illustrates "toggle inputs".

name=GY|colours=#E0E0B0,#709070|sublist=calcflippuzzle
name=b00|type=output|value=  name=b01|type=output|value=  name=b02|type=output|value=  name=b03|type=output|value=  name=b04|type=output|value= 
name=b10|type=output|value=  name=b11|type=output|value=  name=b12|type=output|value=  name=b13|type=output|value=  name=b14|type=output|value= 
name=b20|type=output|value=  name=b21|type=output|value=  name=b22|type=output|value=  name=b23|type=output|value=  name=b24|type=output|value= 
name=b30|type=output|value=  name=b31|type=output|value=  name=b32|type=output|value=  name=b33|type=output|value=  name=b34|type=output|value= 
name=b40|type=output|value=  name=b41|type=output|value=  name=b42|type=output|value=  name=b43|type=output|value=  name=b44|type=output|value= 
value=Reset|type=button|sublist=resetflippuzzle,calcflippuzzle
name=flipresult|type=output|value=
resetflippuzzle|

let(a00,0)let(a01,0)let(a02,0)let(a03,0)let(a04,0) let(a10,0)let(a11,0)let(a12,0)let(a13,0)let(a14,0) let(a20,0)let(a21,0)let(a22,0)let(a23,0)let(a24,0) let(a30,0)let(a31,0)let(a32,0)let(a33,0)let(a34,0)

let(a40,0)let(a41,0)let(a42,0)let(a43,0)let(a44,0)
calcflippuzzle|

let(x,(a00+a02+a04+a10+a12+a14+a30+a32+a34+a40+a42+a44)mod 2) let(y,(a01+a02+a03+a10+a12+a14+a20+a21+a23+a24+a30+a32+a34+a41+a42+a43)mod 2) let(c02,a02) let(b00," ") let(b01," ") let(b02," ") if(x){ if(y){ let(c02,1-c02) let(b02,"F") }{ let(b00,"F") } }{ if(y){ let(b01,"F") } } if((a03+a10+a11+a13+a14+a23+a30+a31+a32+a41)mod 2){if(b02="F"){let(b02,"FT")}{let(b02,"T")}} if((c02+a03+a04+a22+a23+a24+a31+a33+a40+a41+a42)mod 2){let(b03,"T")}{let(b03," ")} if((a03+a04+a10+a12+a14+a20+a22+a23+a32+a40+a41)mod 2){let(b04,"T")}{let(b04," ")} if((c02+a04+a10+a12+a14+a30+a32+a34+a40+a42+a44)mod 2){let(b10,"T")}{let(b10," ")} if((c02+a11+a12+a13+a20+a21+a24+a31+a34+a42+a43)mod 2){let(b11,"T")}{let(b11," ")} if((a04+a10+a11+a13+a14+a22+a24+a30+a32+a33+a40+a42)mod 2){let(b12,"T")}{let(b12," ")} if((c02+a11+a12+a13+a20+a23+a24+a30+a33+a41+a42)mod 2){let(b13,"T")}{let(b13," ")} if((c02+a04+a10+a12+a14+a20+a24+a31+a32+a33+a42)mod 2){let(b14,"T")}{let(b14," ")} if((a04+a11+a13+a14+a20+a21+a24+a30+a31+a32+a40+a43+a44)mod 2){let(b20,"T")}{let(b20," ")} if((a11+a20+a21+a22+a31+a33+a42+a43+a44)mod 2){let(b21,"T")}{let(b21," ")} if((a03+a04+a12+a21+a22+a24+a30+a34+a40+a42+a43)mod 2){let(b22,"T")}{let(b22," ")} if((c02+a03+a04+a13)mod 2){let(b23,"T")}{let(b23," ")} if((a03+a11+a12+a13+a14+a20+a22+a30+a31+a40)mod 2){let(b24,"T")}{let(b24," ")} if((c02+a10+a12+a13+a20+a22+a24+a33+a34+a44)mod 2){let(b30,"T")}{let(b30," ")} if((c02+a03+a11+a14+a20+a21+a24+a31+a32+a33+a42)mod 2){let(b31,"T")}{let(b31," ")} if((c02+a04+a10+a12+a14+a20+a31+a32+a34+a42+a44)mod 2){let(b32,"T")}{let(b32," ")} if((a03+a12+a13+a14+a21+a30+a31+a33+a34+a41+a43)mod 2){let(b33,"T")}{let(b33," ")} if((a10+a11+a22+a30+a32+a33+a40+a42)mod 2){let(b34,"T")}{let(b34," ")} if((a03+a04+a10+a12+a20+a22+a24+a34+a40+a42+a43)mod 2){let(b40,"T")}{let(b40," ")} if((c02+a03+a04+a13+a33+a42+a43+a44)mod 2){let(b41,"T")}{let(b41," ")} if((a03+a10+a11+a12+a13+a14+a21+a22+a31+a32+a34+a40+a41+a42+a44)mod 2){let(b42,"T")}{let(b42," ")} if((a11+a20+a21+a22+a33+a40+a41+a43+a44)mod 2){let(b43,"T")}{let(b43," ")} if((a10+a20+a21+a30+a32+a41+a42+a43)mod 2){let(b44,"T")}{let(b44," ")} let(flipresult,"Toggle the tiles marked 'T'.") if(x+y){let(flipresult,flipresult+" Force the tile marked 'F'.")}

Dungeoneering herblore boosts[edit | edit source]

This demonstrates the get command, which asks the wiki to parse a template, and the parse command, which asks the wiki to parse arbitrary wiki markup.

Level in skill name=level|type=int|value=1|range=1,99|entersublist=getherbtemplate
Skill type name=skilltype|type=radio|range=Noncombat,Combat (not prayer or summoning),Stat restore (not prayer or summoning),Rejuvenation
name=get_button|value=Calculate (using get)|type=button|sublist=getherbtemplate
name=parse_button|value=Calculate (using parse)|type=button|sublist=getherbtemplate
name=herboutput|type=output
getherbtemplate|

let(type,skilltype_range_$skilltype) enable(get_button,0) enable(parse_button,0) if(caller0="get"){ let(get_button,"Loading...") get(User:Stewbasic/DungeoneeringHerbloreBoosts,herboutput,level,type) let(get_button,"Calculate (using get)") }{ let(parse_button,"Loading...") parse(herboutput,"{"+"{DungeoneeringHerbloreBoosts|level="+level+"|type="+type+"}}") let(parse_button,"Calculate (using parse)") } enable(get_button,1) enable(parse_button,1)

Runecrafting calculator[edit | edit source]

Actually I'm not sure what this one should do. Anyway it demonstrates the img field type.

Soul rune.pngBlood rune.pngDeath rune.pngNature rune.pngCosmic rune.pngChaos rune.png Astral rune.pngMind rune.pngBody rune.pngFire rune.pngEarth rune.pngWater rune.pngAir rune.png
name=runeselect|type=select|range=Air,Water,Earth,Fire,Mind,Chaos,Death,Blood,Body,Cosmic,Nature,Soul|sublist=showrune name=runeimg|type=img|size=20|sublist=clickedrune|value=Air Rune.png name=runeoutput|type=output
showrune|

if(runeselect=0){let(runeimg,"Air Rune.png")} if(runeselect=1){let(runeimg,"Water Rune.png")} if(runeselect=2){let(runeimg,"Earth rune.png")} if(runeselect=3){let(runeimg,"Fire Rune.png")} if(runeselect=4){let(runeimg,"Mind rune.png")} if(runeselect=5){let(runeimg,"Chaos rune.png")} if(runeselect=6){let(runeimg,"Death Rune.png")} if(runeselect=7){let(runeimg,"Blood rune.png")} if(runeselect=8){let(runeimg,"Body rune.png")} if(runeselect=9){let(runeimg,"Cosmic rune.png")} if(runeselect=10){let(runeimg,"Nature Rune.png")} if(runeselect=11){let(runeimg,"Soul rune.png")}

clickedrune|let(runeoutput,"You clicked on "+runeimg+"!")

Image viewer and page getter[edit | edit source]

Note that setting an img field to an image that is elsewhere on the page, or has been set already, is much faster; otherwise the calculator must query the wiki for the url of the image, and after that request the image itself.

name=imagename|value=Enter name of image on wiki|size=40|namespaces=6|entersublist=loadimage value=Load|type=button|sublist=loadimage
Thumb: name=imagethumb|type=img
name=image|type=img
loadimage|

let(imagethumb,imagename+"|thumb") let(image,imagename)

name=articlename|value=Enter name of article on wiki|size=40|namespaces=0,1,4,5|entersublist=loadpage name=loadpage|value=Load|type=button|sublist=loadpage
name=pageout|type=output
loadpage|

enable(loadpage,0) let(loadpage,"Loading...") parse(pageout,"{"+"{:"+articlename+"}}") enable(loadpage,1) let(loadpage,"Load")

Array example[edit | edit source]

Index: name=i|type=select|range=0,1,2,3,4,5|sublist=read Value: name=input|sublist=change Show: name=showhide|sublist=showhide|type=check|value=1
name=a_0|type=output|sublist=setindex,read name=a_1|type=output|sublist=setindex,read name=a_2|type=output|sublist=setindex,read name=a_3|type=output|sublist=setindex,read name=a_4|type=output|sublist=setindex,read name=a_5|type=output|sublist=setindex,read
change|let(a_$i,input)
read|let(input,a_$i)
showhide|show(a_$i,showhide)
setindex|let(i,caller1)

POH planner[edit | edit source]

This is based on the POH room template and an idea of User:Coaster4321.

init|

letarray(menagerie_types,"Garden","Jungle","Desert","Volanic","Polar") letarray(pohdefaultdoors,0,7,3,7,10,3,15,7,7,15,7,2,3,2,2,0,15,15,10,15,15,15,2,15,15,15,15,15,15,15)

Version 1 - using the existing template and the get command.

Room type: name=poh_1_roomtype|type=select|sublist=roomchange|range=None,Parlour,Kitchen,Dining Room,Workshop,Bedroom,Skill Hall,Games Room,Combat Room,Quest Hall,Study,Costume Room,Chapel,Portal Chamber,Throne Room,Roof,Oubliette,Dungeon,Dungeon Corridor,Dungeon Junction,Dungeon Stairs,Dungeon Pit,Treasure Room,Garden,Formal Garden,Menagerie (garden),Menagerie (jungle),Menagerie (desert),Menagerie (volanic),Menagerie (polar) x: name=poh_1_x|type=output y: name=poh_1_y|type=output
name=POH1|highlight=#F94
name=poh_1_0_0|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_0_1|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_0_2|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_0_3|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_0_4|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_0_5|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_0_6|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_1_0|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_1_1|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_1_2|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_1_3|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_1_4|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_1_5|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_1_6|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_2_0|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_2_1|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_2_2|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_2_3|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_2_4|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_2_5|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_2_6|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_3_0|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_3_1|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_3_2|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_3_3|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_3_4|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_3_5|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_3_6|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_4_0|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_4_1|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_4_2|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_4_3|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_4_4|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_4_5|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_4_6|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_5_0|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_5_1|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_5_2|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_5_3|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_5_4|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_5_5|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_5_6|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_6_0|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_6_1|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_6_2|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_6_3|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_6_4|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_6_5|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png
name=poh_1_6_6|type=output|sublist=clickpoh|value=
House filler.png
House vfiller.png House vfiller.png
House filler.png

Version 2 - using img fields. This is faster since it doesn't need to query the wiki for the template each time.

name=POH|colours=transparent,#FAA,#FAA,#CCC,#C96,#9C9,#360,#FF9,#300,#CFF|sublist=clickpoh|highlight=#F94

House hwall.pngHouse hdoor.pngHouse filler.png House h2wall.pngHouse h2door.png House vwall.pngHouse vdoor.pngHouse vfiller.png

Room type: name=poh_2_roomtype|type=select|sublist=roomchange,poh_setdoors|range=None,Parlour,Kitchen,Dining Room,Workshop,Bedroom,Skill Hall,Games Room,Combat Room,Quest Hall,Study,Costume Room,Chapel,Portal Chamber,Throne Room,Roof,Oubliette,Dungeon,Dungeon Corridor,Dungeon Junction,Dungeon Stairs,Dungeon Pit,Treasure Room,Garden,Formal Garden,Menagerie (garden),Menagerie (jungle),Menagerie (desert),Menagerie (volanic),Menagerie (polar) x: name=poh_2_x|type=output y: name=poh_2_y|type=output name=pohrotate_2|value=CW|type=button|sublist=poh_setdoors name=pohrotate_8|value=CCW|type=button|sublist=poh_setdoors
name=poh_up_0_0|type=img|value=House filler.png
name=poh_left_0_0|type=img|value=House vfiller.png name=poh_text_0_0|type=output name=poh_right_0_0|type=img|value=House vfiller.png
name=poh_down_0_0|type=img|value=House filler.png
name=poh_up_0_1|type=img|value=House filler.png
name=poh_left_0_1|type=img|value=House vfiller.png name=poh_text_0_1|type=output name=poh_right_0_1|type=img|value=House vfiller.png
name=poh_down_0_1|type=img|value=House filler.png
name=poh_up_0_2|type=img|value=House filler.png
name=poh_left_0_2|type=img|value=House vfiller.png name=poh_text_0_2|type=output name=poh_right_0_2|type=img|value=House vfiller.png
name=poh_down_0_2|type=img|value=House filler.png
name=poh_up_0_3|type=img|value=House filler.png
name=poh_left_0_3|type=img|value=House vfiller.png name=poh_text_0_3|type=output name=poh_right_0_3|type=img|value=House vfiller.png
name=poh_down_0_3|type=img|value=House filler.png
name=poh_up_0_4|type=img|value=House filler.png
name=poh_left_0_4|type=img|value=House vfiller.png name=poh_text_0_4|type=output name=poh_right_0_4|type=img|value=House vfiller.png
name=poh_down_0_4|type=img|value=House filler.png
name=poh_up_0_5|type=img|value=House filler.png
name=poh_left_0_5|type=img|value=House vfiller.png name=poh_text_0_5|type=output name=poh_right_0_5|type=img|value=House vfiller.png
name=poh_down_0_5|type=img|value=House filler.png
name=poh_up_0_6|type=img|value=House filler.png
name=poh_left_0_6|type=img|value=House vfiller.png name=poh_text_0_6|type=output name=poh_right_0_6|type=img|value=House vfiller.png
name=poh_down_0_6|type=img|value=House filler.png
name=poh_up_1_0|type=img|value=House filler.png
name=poh_left_1_0|type=img|value=House vfiller.png name=poh_text_1_0|type=output name=poh_right_1_0|type=img|value=House vfiller.png
name=poh_down_1_0|type=img|value=House filler.png
name=poh_up_1_1|type=img|value=House filler.png
name=poh_left_1_1|type=img|value=House vfiller.png name=poh_text_1_1|type=output name=poh_right_1_1|type=img|value=House vfiller.png
name=poh_down_1_1|type=img|value=House filler.png
name=poh_up_1_2|type=img|value=House filler.png
name=poh_left_1_2|type=img|value=House vfiller.png name=poh_text_1_2|type=output name=poh_right_1_2|type=img|value=House vfiller.png
name=poh_down_1_2|type=img|value=House filler.png
name=poh_up_1_3|type=img|value=House filler.png
name=poh_left_1_3|type=img|value=House vfiller.png name=poh_text_1_3|type=output name=poh_right_1_3|type=img|value=House vfiller.png
name=poh_down_1_3|type=img|value=House filler.png
name=poh_up_1_4|type=img|value=House filler.png
name=poh_left_1_4|type=img|value=House vfiller.png name=poh_text_1_4|type=output name=poh_right_1_4|type=img|value=House vfiller.png
name=poh_down_1_4|type=img|value=House filler.png
name=poh_up_1_5|type=img|value=House filler.png
name=poh_left_1_5|type=img|value=House vfiller.png name=poh_text_1_5|type=output name=poh_right_1_5|type=img|value=House vfiller.png
name=poh_down_1_5|type=img|value=House filler.png
name=poh_up_1_6|type=img|value=House filler.png
name=poh_left_1_6|type=img|value=House vfiller.png name=poh_text_1_6|type=output name=poh_right_1_6|type=img|value=House vfiller.png
name=poh_down_1_6|type=img|value=House filler.png
name=poh_up_2_0|type=img|value=House filler.png
name=poh_left_2_0|type=img|value=House vfiller.png name=poh_text_2_0|type=output name=poh_right_2_0|type=img|value=House vfiller.png
name=poh_down_2_0|type=img|value=House filler.png
name=poh_up_2_1|type=img|value=House filler.png
name=poh_left_2_1|type=img|value=House vfiller.png name=poh_text_2_1|type=output name=poh_right_2_1|type=img|value=House vfiller.png
name=poh_down_2_1|type=img|value=House filler.png
name=poh_up_2_2|type=img|value=House filler.png
name=poh_left_2_2|type=img|value=House vfiller.png name=poh_text_2_2|type=output name=poh_right_2_2|type=img|value=House vfiller.png
name=poh_down_2_2|type=img|value=House filler.png
name=poh_up_2_3|type=img|value=House filler.png
name=poh_left_2_3|type=img|value=House vfiller.png name=poh_text_2_3|type=output name=poh_right_2_3|type=img|value=House vfiller.png
name=poh_down_2_3|type=img|value=House filler.png
name=poh_up_2_4|type=img|value=House filler.png
name=poh_left_2_4|type=img|value=House vfiller.png name=poh_text_2_4|type=output name=poh_right_2_4|type=img|value=House vfiller.png
name=poh_down_2_4|type=img|value=House filler.png
name=poh_up_2_5|type=img|value=House filler.png
name=poh_left_2_5|type=img|value=House vfiller.png name=poh_text_2_5|type=output name=poh_right_2_5|type=img|value=House vfiller.png
name=poh_down_2_5|type=img|value=House filler.png
name=poh_up_2_6|type=img|value=House filler.png
name=poh_left_2_6|type=img|value=House vfiller.png name=poh_text_2_6|type=output name=poh_right_2_6|type=img|value=House vfiller.png
name=poh_down_2_6|type=img|value=House filler.png
name=poh_up_3_0|type=img|value=House filler.png
name=poh_left_3_0|type=img|value=House vfiller.png name=poh_text_3_0|type=output name=poh_right_3_0|type=img|value=House vfiller.png
name=poh_down_3_0|type=img|value=House filler.png
name=poh_up_3_1|type=img|value=House filler.png
name=poh_left_3_1|type=img|value=House vfiller.png name=poh_text_3_1|type=output name=poh_right_3_1|type=img|value=House vfiller.png
name=poh_down_3_1|type=img|value=House filler.png
name=poh_up_3_2|type=img|value=House filler.png
name=poh_left_3_2|type=img|value=House vfiller.png name=poh_text_3_2|type=output name=poh_right_3_2|type=img|value=House vfiller.png
name=poh_down_3_2|type=img|value=House filler.png
name=poh_up_3_3|type=img|value=House filler.png
name=poh_left_3_3|type=img|value=House vfiller.png name=poh_text_3_3|type=output name=poh_right_3_3|type=img|value=House vfiller.png
name=poh_down_3_3|type=img|value=House filler.png
name=poh_up_3_4|type=img|value=House filler.png
name=poh_left_3_4|type=img|value=House vfiller.png name=poh_text_3_4|type=output name=poh_right_3_4|type=img|value=House vfiller.png
name=poh_down_3_4|type=img|value=House filler.png
name=poh_up_3_5|type=img|value=House filler.png
name=poh_left_3_5|type=img|value=House vfiller.png name=poh_text_3_5|type=output name=poh_right_3_5|type=img|value=House vfiller.png
name=poh_down_3_5|type=img|value=House filler.png
name=poh_up_3_6|type=img|value=House filler.png
name=poh_left_3_6|type=img|value=House vfiller.png name=poh_text_3_6|type=output name=poh_right_3_6|type=img|value=House vfiller.png
name=poh_down_3_6|type=img|value=House filler.png
name=poh_up_4_0|type=img|value=House filler.png
name=poh_left_4_0|type=img|value=House vfiller.png name=poh_text_4_0|type=output name=poh_right_4_0|type=img|value=House vfiller.png
name=poh_down_4_0|type=img|value=House filler.png
name=poh_up_4_1|type=img|value=House filler.png
name=poh_left_4_1|type=img|value=House vfiller.png name=poh_text_4_1|type=output name=poh_right_4_1|type=img|value=House vfiller.png
name=poh_down_4_1|type=img|value=House filler.png
name=poh_up_4_2|type=img|value=House filler.png
name=poh_left_4_2|type=img|value=House vfiller.png name=poh_text_4_2|type=output name=poh_right_4_2|type=img|value=House vfiller.png
name=poh_down_4_2|type=img|value=House filler.png
name=poh_up_4_3|type=img|value=House filler.png
name=poh_left_4_3|type=img|value=House vfiller.png name=poh_text_4_3|type=output name=poh_right_4_3|type=img|value=House vfiller.png
name=poh_down_4_3|type=img|value=House filler.png
name=poh_up_4_4|type=img|value=House filler.png
name=poh_left_4_4|type=img|value=House vfiller.png name=poh_text_4_4|type=output name=poh_right_4_4|type=img|value=House vfiller.png
name=poh_down_4_4|type=img|value=House filler.png
name=poh_up_4_5|type=img|value=House filler.png
name=poh_left_4_5|type=img|value=House vfiller.png name=poh_text_4_5|type=output name=poh_right_4_5|type=img|value=House vfiller.png
name=poh_down_4_5|type=img|value=House filler.png
name=poh_up_4_6|type=img|value=House filler.png
name=poh_left_4_6|type=img|value=House vfiller.png name=poh_text_4_6|type=output name=poh_right_4_6|type=img|value=House vfiller.png
name=poh_down_4_6|type=img|value=House filler.png
name=poh_up_5_0|type=img|value=House filler.png
name=poh_left_5_0|type=img|value=House vfiller.png name=poh_text_5_0|type=output name=poh_right_5_0|type=img|value=House vfiller.png
name=poh_down_5_0|type=img|value=House filler.png
name=poh_up_5_1|type=img|value=House filler.png
name=poh_left_5_1|type=img|value=House vfiller.png name=poh_text_5_1|type=output name=poh_right_5_1|type=img|value=House vfiller.png
name=poh_down_5_1|type=img|value=House filler.png
name=poh_up_5_2|type=img|value=House filler.png
name=poh_left_5_2|type=img|value=House vfiller.png name=poh_text_5_2|type=output name=poh_right_5_2|type=img|value=House vfiller.png
name=poh_down_5_2|type=img|value=House filler.png
name=poh_up_5_3|type=img|value=House filler.png
name=poh_left_5_3|type=img|value=House vfiller.png name=poh_text_5_3|type=output name=poh_right_5_3|type=img|value=House vfiller.png
name=poh_down_5_3|type=img|value=House filler.png
name=poh_up_5_4|type=img|value=House filler.png
name=poh_left_5_4|type=img|value=House vfiller.png name=poh_text_5_4|type=output name=poh_right_5_4|type=img|value=House vfiller.png
name=poh_down_5_4|type=img|value=House filler.png
name=poh_up_5_5|type=img|value=House filler.png
name=poh_left_5_5|type=img|value=House vfiller.png name=poh_text_5_5|type=output name=poh_right_5_5|type=img|value=House vfiller.png
name=poh_down_5_5|type=img|value=House filler.png
name=poh_up_5_6|type=img|value=House filler.png
name=poh_left_5_6|type=img|value=House vfiller.png name=poh_text_5_6|type=output name=poh_right_5_6|type=img|value=House vfiller.png
name=poh_down_5_6|type=img|value=House filler.png
name=poh_up_6_0|type=img|value=House filler.png
name=poh_left_6_0|type=img|value=House vfiller.png name=poh_text_6_0|type=output name=poh_right_6_0|type=img|value=House vfiller.png
name=poh_down_6_0|type=img|value=House filler.png
name=poh_up_6_1|type=img|value=House filler.png
name=poh_left_6_1|type=img|value=House vfiller.png name=poh_text_6_1|type=output name=poh_right_6_1|type=img|value=House vfiller.png
name=poh_down_6_1|type=img|value=House filler.png
name=poh_up_6_2|type=img|value=House filler.png
name=poh_left_6_2|type=img|value=House vfiller.png name=poh_text_6_2|type=output name=poh_right_6_2|type=img|value=House vfiller.png
name=poh_down_6_2|type=img|value=House filler.png
name=poh_up_6_3|type=img|value=House filler.png
name=poh_left_6_3|type=img|value=House vfiller.png name=poh_text_6_3|type=output name=poh_right_6_3|type=img|value=House vfiller.png
name=poh_down_6_3|type=img|value=House filler.png
name=poh_up_6_4|type=img|value=House filler.png
name=poh_left_6_4|type=img|value=House vfiller.png name=poh_text_6_4|type=output name=poh_right_6_4|type=img|value=House vfiller.png
name=poh_down_6_4|type=img|value=House filler.png
name=poh_up_6_5|type=img|value=House filler.png
name=poh_left_6_5|type=img|value=House vfiller.png name=poh_text_6_5|type=output name=poh_right_6_5|type=img|value=House vfiller.png
name=poh_down_6_5|type=img|value=House filler.png
name=poh_up_6_6|type=img|value=House filler.png
name=poh_left_6_6|type=img|value=House vfiller.png name=poh_text_6_6|type=output name=poh_right_6_6|type=img|value=House vfiller.png
name=poh_down_6_6|type=img|value=House filler.png
clickpoh|

if(caller1=2){ if((caller2!=poh_2_x)||(caller3!=poh_2_y)){ let(x,poh_2_x) let(y,poh_2_y) let(room,pohroom_2_$x_$y) if(room=0){let(poh_2_$x_$y,0)}{ if(room<16){let(poh_2_$x_$y,3)}{ if(room<23){let(poh_2_$x_$y,4)}{ if(room<26){let(poh_2_$x_$y,5)}{ let(poh_2_$x_$y,room-20) }}}} } let($caller,1) } let(poh_$caller1_x,caller2) let(poh_$caller1_y,caller3) let(poh_$caller1_roomtype,pohroom_$caller1_$caller2_$caller3)

roomchange|

let(x,poh_$caller1_x) let(y,poh_$caller1_y) let(room,poh_$caller1_roomtype) let(pohroom_$caller1_$x_$y,room) if(caller1=1){ if(room>25){ let(room,room-26) let(room,"Menagerie|habitat="+menagerie_types_$room) }{ let(room,poh_1_roomtype_range_$room) } get(POH room,poh_1_$x_$y,room) }{ let(pohdoors_$x_$y,pohdefaultdoors_$room) if(room<25){ let(poh_text_$x_$y,poh_2_roomtype_range_$room) }{ let(poh_text_$x_$y,"Menagerie") } }

poh_setdoors|

let(x,poh_2_x) let(y,poh_2_y) let(doors,pohdoors_$x_$y) if((caller0="pohrotate")&&doors<15){ let(doors,(doors*caller1) mod 15) let(pohdoors_$x_$y,doors) } if(pohroom_2_$x_$y=0){ let(poh_right_$x_$y,"House vfiller.png") let(poh_down_$x_$y,"House filler.png") let(poh_left_$x_$y,"House vfiller.png") let(poh_up_$x_$y,"House filler.png") }{ if(doors&1){let(poh_right_$x_$y,"House vdoor.png")}{let(poh_right_$x_$y,"House vwall.png")} if(doors&2){let(poh_down_$x_$y,"House h2door.png")}{let(poh_down_$x_$y,"House h2wall.png")} if(doors&4){let(poh_left_$x_$y,"House vdoor.png")}{let(poh_left_$x_$y,"House vwall.png")} if(doors&8){let(poh_up_$x_$y,"House hdoor.png")}{let(poh_up_$x_$y,"House hwall.png")} }

Penguin list[edit | edit source]

This shows how the penguin list could be achieved as a calculator.

expiry=7|variables=penguin_1,penguin_2,penguin_3,penguin_4,penguin_5,penguin_6,penguin_7,penguin_8,penguin_9,penguin_10,penguin_11
name=Penguins|colours=transparent,#CFC|highlight=#BBB
No. General Spawn Area Requirements Type Penguin Points
(after Cold War)
Confirmation
date
Maps
(Click to enlarge)
1 Lumber Yard None Crate 1 12 Oct PHS lumber.png
2 Wizards' Tower None Bush 1 12 Oct PHS wizard.png
3 Ice Mountain None Rock 1 12 Oct PHS ice.png
4 Death Plateau None Rock 1 12 Oct PHS death.png
5 Zanaris Completed Lost City Toadstool 1 12 Oct PHS zanaris.png
6 Wilderness
(SW of KBD)
None Rock 1 (2) 12 Oct PHS sw kbd.png
7 Wilderness
(North of KBD)
None Rock 1 (2) 12 Oct PHS n kbd.png
8 Wilderness
(Lava Maze)
None Rock 1 (2) 12 Oct PHS lava.png
9 Keldagrim Started The Giant Dwarf Rock 1 (2) 12 Oct PHS kelda.png
10 Neitiznot
(Northern grassy isle)
Started The Fremennik Isles Bush 1 (2) 12 Oct PHS neit bush.png
11 Rellekka well Completed Hunt for Red Raktuber Polar Bear 1 12 Oct PHS rellekka bear.png

Hiscores[edit | edit source]

This demonstrates the use of the hiscores command.

Character name name=character_name|entersublist=hiscores name=hiscores|type=button|value=Lookup|sublist=hiscores
hiscores|

enable(hiscores,0) let(hiscores,"Loading...") hiscores(character_name,hs) let(display_character_name,character_name) enable(hiscores,1) let(hiscores,"Lookup")

+type=output|name=display_character_name
Total level: type=output|name=hs_Total_level
Attack type=output|name=hs_Attack_level Constitution type=output|name=hs_Constitution_level Mining type=output|name=hs_Mining_level
Strength type=output|name=hs_Strength_level Agility type=output|name=hs_Agility_level Smithing type=output|name=hs_Smithing_level
Defence type=output|name=hs_Defence_level Herblore type=output|name=hs_Herblore_level Fishing type=output|name=hs_Fishing_level
Ranged type=output|name=hs_Ranged_level Thieving type=output|name=hs_Thieving_level Cooking type=output|name=hs_Cooking_level
Prayer type=output|name=hs_Prayer_level Crafting type=output|name=hs_Crafting_level Firemaking type=output|name=hs_Firemaking_level
Magic type=output|name=hs_Magic_level Fletching type=output|name=hs_Fletching_level Woodcutting type=output|name=hs_Woodcutting_level
Runecrafting type=output|name=hs_Runecrafting_level Slayer type=output|name=hs_Slayer_level Farming type=output|name=hs_Farming_level
Construction type=output|name=hs_Construction_level Hunter type=output|name=hs_Hunter_level Summoning type=output|name=hs_Summoning_level
Dungeoneering type=output|name=hs_Dungeoneering_level

Possible extensions[edit | edit source]

  • Allow two identical input fields to be tied to one variable; eg skillstat_Strength_level may appear twice on one page. But how to deal with invalid input - did the user intend to have them identical, or accidentally reuse a variable name?
  • Other control stuctures like switch statements, loops and calling subs, but with safeguards against malicious editors
  • Parse some wiki syntax (eg links) when setting the contents of an output field.