FANDOM


I noticed that with the introduction of new creatures which have a large loot list, sometimes 20 to 30 items, it is quite a tedious task to edit all those item pages to add this new creature. This seems like a good example of something a bot could do automatically.

Background information

If a creature drops loot, it this is noted in the loot parameter. Let's take a Bear as an example:

| loot           = {{Loot Table
 |{{Loot Item|0-4|Meat}}
 |{{Loot Item|0-3|Ham}}
 |{{Loot Item|Bear Paw|rare}}
 |{{Loot Item|Honeycomb|very rare}}
}}

It links to 4 item pages: Meat, Ham, Bear Paw and Honeycomb.

All those 4 item pages link back to the creature in their droppedby parameter. Let's take the Bear Paw as an example:

| droppedby     = {{Dropped By|Bear|Werebear}}

As you can see the information "A Bear drops a Bear Paw" or "A Bear Paw is dropped by a Bear" is present in two places, on the Bear page and on the Bear Paw page. In some cases however, there are inconsistencies. If somebody places the information on one of the pages, it is not always placed in the other place as well.

Proposal

The bot will have to take two approaches.

First approach

  • Make a list of all Creatures.
  • Loop over every creature and check if it contains any Template:Loot Items.
  • If it does, make a list of the loot items.
  • Loop over every loot item and check if the creature name is present in the Template:Dropped By of that page.
  • If not, add it.
  • Else, move on.

Second approach

  • Make a list of all Items.
  • Loop over every item and check if it contains a Template:Dropped By.
  • If it does, make a list of creatures.
  • Loop over every creature and check if the item name is present in a Template:Loot Item on that page.
  • If not, add it.
  • Else, move on.

External links

Community content is available under CC-BY-SA unless otherwise noted.