Class GearNames
A gear set is configured as names, and a name can change while the item does not. A glory teleport turns "Amulet of glory (4)" into "(3)"; barrows degrade in combat from "Ahrim's robetop 100" to "75". Comparing names exactly made the worn (3) "missing", found no (4) to put on, and threw the WHOLE set out — one teleport, and the bot could not switch style for the rest of the fight. Supplies never had this problem because they have always matched by containment ("Super restore" finds "Super restore(4)"); gear matched exactly, and that inconsistency was the bug.
The rules, surveyed against the Elorin cache's 14,296 wearable items on 2026-09-22 rather than assumed from OSRS:
- A trailing charge count in brackets is not part of the item's identity:
(4),(t4), and Elorin spells it both ways — the cache holds "Amulet of glory (3)" (1710) AND "Amulet of glory(3)" (31710). Uncharged "Amulet of glory" is the same amulet too. - A trailing bare degrade tier is not either: barrows go 100/75/50/25, battle and combat robes and d'hide coifs go 100/80/60/40/20. A fresh barrows piece has no number at all.
- Tier 0 IS part of the identity. A broken barrows piece has no Wear option; counting it as the set's piece would make the set "obtainable" and then fail every equip.
- Letters in brackets are different items: enchanted bolts
(e)have effects, and trims(t)/(g)are separate ids. Only digits (optionally aftert) go.
The exact name always wins: a set naming glory (4) with a (4) and a (1) carried puts the (4) on. A variant is the fallback that keeps the set alive, never the first choice.
Pure; no client reads, any thread. Lifted unchanged from ElorinPvP model/GearName.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe name with any charge count or degrade tier taken off — the item's identity, used as the key for anything learned about it (a glory's slot is learned once for every charge).static intThe index of the candidate to use forwanted: the exact name if it is there, otherwise the first variant of it, otherwise-1.static booleanWhether two names are the same piece of gear, ignoring charges and degrade tiers.The entries ofwantedthathavecannot cover, inwanted's order.
-
Method Details
-
sameItem
-
choose
-
unmatched
The entries ofwantedthathavecannot cover, inwanted's order. Each item covers exactly one requirement — a set can name the same item twice (Ghostly robe top and bottom are both "Ghostly robe") and one of them on is not both. Exact pairs are made first across the whole list, then variants, so an exact item is never spent on a requirement a variant could have met while another requirement goes short. -
base
-