View Full Version : inventory.ash quality coloring
lostcalpolydude
07-23-2011, 11:12 AM
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).
There is some discussion about such RegEx in this thread.
I think you could adapt this one in particular:
<b>([^<]*(?:<i>[^<]*</i>[^<]*)*)</b>
lostcalpolydude
07-23-2011, 02:27 PM
I found that
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...
Powered by vBulletin® Version 4.2.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.