Template:Disambiguation/doc: Difference between revisions

Fixed incorrect search array for Thieving npcs, sorted equipment by Weapons, Armors, Arrows
(Updated script to exclude any non-equipment items when returning equipment table template)
(Fixed incorrect search array for Thieving npcs, sorted equipment by Weapons, Armors, Arrows)
Line 9: Line 9:
// Settings //
// Settings //
let searchTerm = 'Siren'; // The proper capitalization of the search term
let searchTerm = 'Siren'; // The proper capitalization of the search term
let returnEquipmentTemplate = true; // returns a template for {{EquipmentTableFromList}} instead
let returnEquipmentTemplate = false; // returns a template for {{EquipmentTableFromList}} instead
// End of Settings //
// End of Settings //
let lcSearchTerm = searchTerm.toLowerCase();
let lcSearchTerm = searchTerm.toLowerCase();
Line 30: Line 30:
if (returnEquipmentTemplate) results.push(`{{V|${gameVersion.substr(1)}}}\n\n{{EquipmentTableFromList`);
if (returnEquipmentTemplate) results.push(`{{V|${gameVersion.substr(1)}}}\n\n{{EquipmentTableFromList`);
if (!returnEquipmentTemplate) results.push(`{{Disam}}{{V|${gameVersion.substr(1)}}}\n`, `'''${searchTerm}''' may refer to:`);
if (!returnEquipmentTemplate) results.push(`{{Disam}}{{V|${gameVersion.substr(1)}}}\n`, `'''${searchTerm}''' may refer to:`);
pushResults({arr: game.items.equipment.filter(x => search(x)), header: '===Equipment===', iconType: 'ItemIcon'});
pushResults({arr: game.items.weapons.filter(x => search(x)), header: '===Equipment===', iconType: 'ItemIcon'});
pushResults({arr: game.items.equipment.filter(x => search(x) && !(x instanceof WeaponItem) && !x.validSlots.includes('Quiver')), header: '', iconType: 'ItemIcon'});
pushResults({arr: game.items.equipment.filter(x => search(x) && x.validSlots.includes('Quiver')), header: '', iconType: 'ItemIcon'});
pushResults({arr: game.items.filter(x => x.validSlots === undefined && !(x instanceof OpenableItem) && !(x instanceof BoneItem) && !(x instanceof FoodItem) && search(x)), header: '===Items===', iconType: 'ItemIcon'});
pushResults({arr: game.items.filter(x => x.validSlots === undefined && !(x instanceof OpenableItem) && !(x instanceof BoneItem) && !(x instanceof FoodItem) && search(x)), header: '===Items===', iconType: 'ItemIcon'});
pushResults({arr: game.items.openables.filter(x => search(x)), header: '===Openables===', iconType: 'ItemIcon'});
pushResults({arr: game.items.openables.filter(x => search(x)), header: '===Openables===', iconType: 'ItemIcon'});
Line 46: Line 48:
pushResults({arr: game.astrology.actions.filter(x => search(x)), header: '', iconType: 'ConstellationIcon'});
pushResults({arr: game.astrology.actions.filter(x => search(x)), header: '', iconType: 'ConstellationIcon'});
pushResults({arr: game.agility.actions.filter(x => search(x)), header: '', iconType: 'AgilityIcon'});
pushResults({arr: game.agility.actions.filter(x => search(x)), header: '', iconType: 'AgilityIcon'});
pushResults({arr: game.skills.filter(x => search(x)), header: '', iconType: 'Icon', extras: '|type=thieving'});
pushResults({arr: game.thieving.actions.filter(x => search(x)), header: '', iconType: 'Icon', extras: '|type=thieving'});
if (cloudManager.hasAoDEntitlementAndIsEnabled)
if (cloudManager.hasAoDEntitlementAndIsEnabled)
pushResults({arr: game.cartography.worldMaps.getObjectByID('melvorAoD:Melvor').pointsOfInterest.filter(x => search(x)), header: '', iconType: 'POIIcon'});
pushResults({arr: game.cartography.worldMaps.getObjectByID('melvorAoD:Melvor').pointsOfInterest.filter(x => search(x)), header: '', iconType: 'POIIcon'});