4,683
edits
No edit summary |
(Updated script for v1.3; Changed from h3 to h2) |
||
Line 29: | Line 29: | ||
} | } | ||
let results = []; | let results = []; | ||
if (returnEquipmentTemplate) results.push(`{{V|${gameVersion.substr(1)}}}\n\n | if (returnEquipmentTemplate) results.push(`{{V|${gameVersion.substr(1)}}}\n\n=${searchTerm} Equipment=\n==Melee Weapons==\n{{EquipmentTableFromList\n\n}}\n==Ranged Weapons and Ammo==\n{{EquipmentTableFromList\n\n}}\n==Armour==\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(game.items.weapons.filter(x => search(x) && !x.validSlots.includes('Quiver')), ' | pushResults(game.items.weapons.filter(x => search(x) && !x.validSlots.includes('Quiver')), '==Equipment==', 'ItemIcon'); | ||
pushResults(game.items.equipment.filter(x => search(x) && x.validSlots.includes('Quiver')), ' | pushResults(game.items.equipment.filter(x => search(x) && x.validSlots.includes('Quiver')), '==Equipment==', 'ItemIcon'); | ||
pushResults(game.items.equipment.filter(x => search(x) && !(x instanceof WeaponItem) && !x.validSlots.includes('Quiver')), ' | pushResults(game.items.equipment.filter(x => search(x) && !(x instanceof WeaponItem) && !x.validSlots.includes('Quiver')), '==Equipment==', 'ItemIcon'); | ||
pushResults(game.items.filter(x => x.validSlots | pushResults(game.items.filter(x => x.validSlots == undefined && !(x instanceof OpenableItem) && !(x instanceof BoneItem) && !(x instanceof FoodItem) && search(x)), '==Items==', 'ItemIcon'); | ||
pushResults(game.items.openables.filter(x => search(x)), ' | pushResults(game.items.openables.filter(x => search(x)), '==Openables==', 'ItemIcon'); | ||
pushResults(game.items.bones.filter(x => search(x)), ' | pushResults(game.items.bones.filter(x => search(x)), '==Bones==', 'ItemIcon'); | ||
pushResults(game.items.food.filter(x => search(x)), ' | pushResults(game.items.food.filter(x => search(x)), '==Food==', 'ItemIcon'); | ||
pushResults(game.monsters.filter(x => search(x)), ' | pushResults(game.monsters.filter(x => search(x)), '==Combat==', 'MonsterIcon'); | ||
pushResults( | pushResults(game.combatAreas.filter(x => search(x)), '==Combat==', 'ZoneIcon'); | ||
pushResults([...game. | pushResults([...game.attackSpells.allObjects, ...game.curseSpells.allObjects, ...game.auroraSpells.allObjects, ...game.altMagic.actions.allObjects].filter(x => search(x)), '==Spells==', 'SpellIcon'); | ||
pushResults(game.shop.purchases.filter(x => search(x)), ' | pushResults(game.shop.purchases.filter(x => search(x)), '==Purchases==', 'UpgradeIcon'); | ||
pushResults(game.prayers.filter(x => search(x)), ' | pushResults(game.prayers.filter(x => search(x)), '==Prayers==', 'PrayerIcon'); | ||
pushResults([...game.township.buildings.allObjects, ...game.township.seasons.allObjects, ...game.township.biomes.allObjects, ...game.township.resources.allObjects].filter(x => search(x)), ' | pushResults([...game.township.buildings.allObjects, ...game.township.seasons.allObjects, ...game.township.biomes.allObjects, ...game.township.resources.allObjects].filter(x => search(x)), '==Township==', 'TownshipIcon'); | ||
pushResults(game.skills.filter(x => search(x)), ' | pushResults(game.skills.filter(x => search(x)), '==Others==', 'Skill'); | ||
pushResults(game.pets.filter(x => search(x)), ' | pushResults(game.pets.filter(x => search(x)), '==Others==', 'PetIcon'); | ||
pushResults(game.astrology.actions.filter(x => search(x)), ' | pushResults(game.astrology.actions.filter(x => search(x)), '==Others==', 'ConstellationIcon'); | ||
pushResults(game.agility.actions.filter(x => search(x)), ' | pushResults(game.agility.actions.filter(x => search(x)), '==Others==', 'AgilityIcon'); | ||
pushResults(game.thieving.actions.filter(x => search(x)), ' | pushResults(game.thieving.actions.filter(x => search(x)), '==Others==', 'Icon', '|type=thieving'); | ||
if (cloudManager.hasAoDEntitlementAndIsEnabled) | if (cloudManager.hasAoDEntitlementAndIsEnabled) | ||
pushResults(game.cartography.worldMaps.getObjectByID('melvorAoD:Melvor').pointsOfInterest.filter(x => search(x)), ' | pushResults(game.cartography.worldMaps.getObjectByID('melvorAoD:Melvor').pointsOfInterest.filter(x => search(x)), '==Others==', 'POIIcon'); | ||
let outputString = ``; | let outputString = ``; | ||
results.forEach((str, i) => { outputString += (returnEquipmentTemplate ? i > 0 ? `\n|${str}` : `${str}` : `${str}\n`) }); | results.forEach((str, i) => { outputString += (returnEquipmentTemplate ? i > 0 ? `\n|${str}` : `${str}` : `${str}\n`) }); |