New Content - Implemented Inline item descriptions

lostcalpolydude

Developer
Staff member
This broke our equipped items parsing from inventory. The fix can't be committed now, but updating src/net/sourceforge/kolmafia/request/EquipmentRequest.java starting at line 76 to have this updated regex fixes it. Tested with inline descriptions on and off (a KoL setting).
Code:
	private static final Pattern HAT_PATTERN =
		Pattern.compile( "Hat</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=hat" );
	private static final Pattern WEAPON_PATTERN =
		Pattern.compile( "Weapon</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=weapon" );
	private static final Pattern OFFHAND_PATTERN =
		Pattern.compile( "Off-Hand</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>([^<]+)</b> *(<font[^>]*>[^<]*</font>)? *<a[^>]*unequip&type=offhand" );
	private static final Pattern CONTAINER_PATTERN =
		Pattern.compile( "Back</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=container" );
	private static final Pattern SHIRT_PATTERN =
		Pattern.compile( "Shirt</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=shirt" );
	private static final Pattern PANTS_PATTERN =
		Pattern.compile( "Pants</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=pants" );
	private static final Pattern ACC1_PATTERN =
		Pattern.compile( "Accessory</a>(?: 1)?:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>([^<]+)</b> *<a[^>]*unequip&type=acc1" );
	private static final Pattern ACC2_PATTERN =
		Pattern.compile( "Accessory</a>(?: 2)?:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>([^<]+)</b> *<a[^>]*unequip&type=acc2" );
	private static final Pattern ACC3_PATTERN =
		Pattern.compile( "Accessory</a>(?: 3)?:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>([^<]+)</b> *<a[^>]*unequip&type=acc3" );
	private static final Pattern FAMILIARITEM_PATTERN =
		Pattern.compile( "Familiar</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=familiarequip\"" );
 
Last edited:

AlbinoRhino

Active member
Does anyone want to build a jar with this change and post it in the unofficial builds forum like we used to do before fewyn automated the daily builds system?

I guess I could post the one I am using. It includes the diff that veracity posted earlier as well as lost's fix above. The only change of my own is a very minor edit to make my cli scrollbar more sticky than the default. It breaks it's stickiness too easily to suit me, so I always use a local build just for that one minor change.
 

Bale

Minion
Thank you. At this time I'm not even set up to make my own build so I would be very happy to use yours.
 
For this specific bug, does turning off the inline descriptions help? I'm not sure what the symptoms are.

Edit: oh - blank equipment in the gear changer? It appears that turning the inline descriptions off does resolve that, but I'm not sure I can reproduce this correctly.
 
Last edited:

Veracity

Developer
Staff member
The only change of my own is a very minor edit to make my cli scrollbar more sticky than the default. It breaks it's stickiness too easily to suit me, so I always use a local build just for that one minor change.
I'd like to see this.
 

lostcalpolydude

Developer
Staff member
Slight regex update, which should both be negligibly faster (I think) and, more importantly, works with "Show Individual Accessory Slot Equip Links" disabled.

Code:
	private static final Pattern HAT_PATTERN =
		Pattern.compile( "Hat</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=hat" );
	private static final Pattern WEAPON_PATTERN =
		Pattern.compile( "Weapon</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=weapon" );
	private static final Pattern OFFHAND_PATTERN =
		Pattern.compile( "Off-Hand</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>([^<]+)</b> *(<font[^>]*>[^<]*</font>)? *<a[^>]*unequip&type=offhand" );
	private static final Pattern CONTAINER_PATTERN =
		Pattern.compile( "Back</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=container" );
	private static final Pattern SHIRT_PATTERN =
		Pattern.compile( "Shirt</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=shirt" );
	private static final Pattern PANTS_PATTERN =
		Pattern.compile( "Pants</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=pants" );
	private static final Pattern ACC1_PATTERN =
		Pattern.compile( "Accessory</a>(?: 1)?:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>([^<]+)</b> *<a[^>]*unequip&type=acc1" );
	private static final Pattern ACC2_PATTERN =
		Pattern.compile( "Accessory</a>(?: 2)?:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>([^<]+)</b> *<a[^>]*unequip&type=acc2" );
	private static final Pattern ACC3_PATTERN =
		Pattern.compile( "Accessory</a>(?: 3)?:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>([^<]+)</b> *<a[^>]*unequip&type=acc3" );
	private static final Pattern FAMILIARITEM_PATTERN =
		Pattern.compile( "Familiar</a>:</td>(<td><img[^']*'descitem\\(([\\d]+)[^>]*></td>)?<td><b[^>]*>(.*?)</b>.*?unequip&type=familiarequip\"" );
 
Top