Skip to content

RSLookup enables easier integration with the RS, OSRS, and third party clients, leveraging Semantic MediaWiki.

License

Notifications You must be signed in to change notification settings

weirdgloop/mediawiki-extensions-RSLookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSLookup

The RSLookup extension helps create integrations between the wiki and RuneScape clients. It is intended exclusively for use on, and developed for, the RuneScape and Old School RuneScape wikis.

Demo: https://oldschool.runescape.wiki/w/Special:Lookup?type=item&id=4151&name=Abyssal_whip

Requirements

LocalSettings.php:

// SMW
$wgRSLookupBackend = 'smw';
$wgRSLookupSMWProps = [
    'item' => 'Item ID',
    'npc' => 'NPC ID',
    'object' => 'Object ID'
];

// Bucket
$wgRSLookupBackend = 'bucket';
$wgRSLookupBucketNames = [
    'item' => 'item_id',
    'npc' => 'npc_id',
    'object' => 'object_id'
];

Usage

This information is also found on the Old School RuneScape Wiki

Special:Lookup is a page that redirects users to articles based on the ID provided. We currently support looking up items, NPCs/monsters, and objects. The special page takes advantage of IDs defined in infoboxes, and uses Semantic MediaWiki to query for pages with matching IDs. If the page includes a switch infobox, the pane with the right ID will be selected.

Parameters

  • type (string) - one of $wgRSLookupTypes keys - the type of entity to lookup
  • id (int) - the ID of the entity to lookup
  • name (string) - the page that will be shown/searched if the ID query returns no results

Case: ID match

If the specified ID is found on the wiki, the user will be redirected to the page/section with the matching ID. If multiple pages match the specified ID, then the one with the lowest page ID (usually earliest-created wiki article) will be shown. However, this should be avoided.

Case: no ID match, fallback

If the specified ID cannot be found on the wiki (or the query is malformed, perhaps due to a missing type parameter), the user will be redirected to the fallback page. If the fallback page is found on the wiki, the user will be redirected to the page. If the fallback page is not found, it is treated as a search query.

This is to hedge against cases when the ID mapping might not be fully complete, especially after new updates or reshuffling of NPC ids.

Case: no ID match, no fallback

If the ID cannot be found, and no fallback is provided, the user is redirected to the main page.

Caveats

Requires canonical IDs

The extension will not play nicely with the IDs of noted or placeholder items, as those are not recorded by the wiki. In all cases, we strongly recommend converting an ID to the "canonical" (non-noted, non-placeholder) version before sending it off to Special:Lookup.

For example, convert 1334 (noted Rune scimitar) to 1333 (regular Rune scimitar) before querying the wiki.

The same holds true for so-called "multi-NPCs", which show one version or another depending on player varbits. We recommend converting to the version that the player is actually shown, as there is no guarantee that the wiki will have coverage of the base NPC ID.

About

RSLookup enables easier integration with the RS, OSRS, and third party clients, leveraging Semantic MediaWiki.

Resources

License

Stars

Watchers

Forks

Languages