inventory.ash quality coloring

lostcalpolydude

Developer
Staff member
This script color codes consumables in your inventory according to KoL's quality definitions. This is my first time using regex for anything meaningful, and I just realized that my matcher will fail on "elven <i>limbos</i> gingerbread" and "marshmallow flambé". Since the script works for the majority of items, I'm posting it in the hopes that someone else can nudge me in the right direction. Including every character that could possibly be in the item name individually seems like the wrong way to go (and I couldn't get it to work for é anyway).
 

Attachments

  • inventory.ash
    766 bytes · Views: 74

slyz

Developer
There is some discussion about such RegEx in this thread.

I think you could adapt this one in particular:
Code:
<b>([^<]*(?:<i>[^<]*</i>[^<]*)*)</b>
 

lostcalpolydude

Developer
Staff member
I found that
Code:
matcher consumable = create_matcher("\>(.*?)\<" , page);
is at least an improvement over what I had, accounting for everything except html tags in the item name. The match is more complicated due to the difference between having inventory images on and off, but even with the simpler case of inventory images on I can't figure it out. Removing all the <i> tags from the page fixes it...
 
Top