Help:Data

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

Search for a module


Create a new data module



Create a new schema module


This is a basic guide on the data project. The idea is that users will be able to submit data with the aim to calculate accurate drop rates.

The project is made up of schema and data modules.

Data[edit source]

The data should be created as a module with the name Module:Data/Name, for example, Module:Data/Crystal geode.

The below is the only content that should be placed in the new module on creation.

return {
}

Schema[edit source]

The schema should be created as a module with the name Module:Schema/Name, for example, Module:Schema/Crystal geode.

What a schema looks like[edit source]

return {
	["title"] = "Crystal geode",
	["sample"] = "shattered",
	["dropsLine"] = "DropsLineRW",
	["fields"] = {
		{
			["name"] = "total",
			["type"] = "number",
			["icon"] = null,
			["label"] = "Total shattered",
			["placeholder"] = "# shattered",
			["info"] = "The amount of geodes you have shattereed",
			["required"] = true
		},
		...Additional fields...
		{
			["name"] = "weaponSeed",
			["type"] = "number",
			["icon"] = "Crystal weapon seed.png",
			["label"] = "Crystal weapon seed",
			["info"] = "The amount of crystal weapon seeds you earned",
			["required"] = true,
			["quantity"] = 1,
			["page"] = "Crystal weapon seed",
			["estimatedRarity"] = "Very rare",
			["rarityNotes"] = "{{Refn|group=d|name=crystal weapon seed|Completion of [[Roving Elves]] required.}}"
		},
		{
			["name"] = "evidence",
			["type"] = "text",
			["icon"] = null,
			["label"] = "Evidence",
			["placeholder"] = "Optional",
			["info"] = "Any notes or a link to an image",
			["required"] = false
		}
	}
}

Syntax[edit source]

  1. title: The title on the form. i.e. A value of Crystal geode will give Crystal geode data on the form.
  2. sample: The sample size text at the bottom of an aggregated table. i.e. A value of shattered will give Based on a sample of 1,330 shattered.
  3. dropsLine: The DropsLine template to use for the drops view.
  4. fields: Contains the definitions for each field on the form. Each schema must contain both total and evidence fields as well as fields for each item.
    1. name: The identifier for the field. This should be in lowerCamelCase format.
    2. type: The form field type. Only number and text is supported.
    3. icon: The image file that is displayed on the form and on the aggregated tables. This should not include the File: prefix.
    4. label: The label that is displayed on the form for each field.
    5. placeholder: The placeholder in each input field. This should only be used for text fields.
    6. info: The info helper that is displayed on the form.
    7. required: A boolean value that defines if the field is required to be completed.
    8. quantity: The number of that item received at once. This can be a single quantity (5) or a range ("2-5").
    9. noted: A boolean value that defines if the drop is noted. If not included, the drop will be unnoted.
    10. page: The page that the image links to in the aggregated tables.
    11. nameNotes: Reference for the name when using the drops view.
    12. rarityNotes: Reference for the rarity when using the drops view.
    13. estimatedRarity: When under 1000 samples, this is the ratity that will be used if supplied.
    14. overrideRarity: Regardless of what have been submitted, this rarity will be used.

Troubleshooting[edit source]

What is a script error? A script error means something went wrong. If you understand Lua, you can take a chance yourself, or you can post a message to RS:A/RS:UH or User talk:BlackHawk.

By default, you will be prevented from saving a change to these pages if your edit has a syntax error. You may need to start from scratch and follow the instructions more obediently. If you think you did as described perfectly and still can't save, then post a message to RS:A/RS:UH or User talk:BlackHawk.

If something isn't displaying correctly, that's not good. Post a message to RS:A/RS:UH or User talk:BlackHawk.