Bug - Not A Bug maximiser doesn't include all requested equipment/outfit

Yvain

Member
Edit: Title should be "maximizer doesn't include all requested equipment/outfit". Sorry.

If I type "item +equip squeezebox +outfit filthy" into the maximiser it ignores the last +outfit part and will return my best item equipment and my squeezebox and not include the outfit. This also occurs if called from the CLI.
 
Last edited:

slyz

Developer
From the maximizer help:
If both +equip and +outfit are used together, either one will satisfy the condition - all of the items, or one of the outfits. This special case is needed to be able to specify the conditions for adventuring in the Pirate Cove.
 

Bale

Minion
Considering that this occasionally causes these bug reports and it contradicts common sense, even though this is a useful feature I sometimes think it should be removed and replaced with a +pirate modifier that works like the +sea modifier.
 

Nifft

Member
+1 to what Bale said. My ascension scripts would love to be able to use both options in several cases whereas now I only add special +equips if a +outfit wasn't passed to my maximizer building string.
 

slyz

Developer
If you have a maximizer string builder, you can replace the "+outfit" part by the corresponding "+equip" thanks to outfit_pieces(), like this:
PHP:
string input = "+equip squeezebox +outfit filthy";
string maxme;
foreach i, mod in split_string( input, "\\+" )
{
	if ( mod == "" ) continue;
	if ( mod.index_of( "outfit" ) == 0 )
	{
		foreach i, it in outfit_pieces( mod.substring( 7 ) )
		{
			maxme += "+equip " + it + " ";
		}
	}
	else maxme += "+" + mod;
}

print( maxme );
 
Last edited:

Bale

Minion
As slyz says, this is something that can be worked with so I only "sometimes think" that the feature should be removed and replace with +Pirates. Especially since some existing scripts would break if the feature was removed.
 

Theraze

Active member
Yeah... my current workaround for this is to manually run the equip first, then -part. So in the first example, "equip squeezebox", then run "maximize -weapon, +outfit filthy" to run maximize without removing the squeezebox... but it's kludgey.
 

Winterbay

Active member
You could run it with "maximize +equip squeezebox +equip filthy knitted dread sack +equip filthy corduroys" as well :)
 

Nifft

Member
Thanks, Slyz. Not quite as straight-forward a split as that... there could be -ML, -melee, -combat, etc in the string, not just +'s, but that gives a nice starting point.
~ Nifft
 

slyz

Developer
Maybe using a comma would be better, or you can use the Maximizer's own RexExp:
PHP:
"\\G\\s*(\\+|-|)([\\d.]*)\\s*((?:[^-+,0-9]|(?<! )[-+0-9])+),?\\s*"
// Groups: 1=sign 2=weight 3=keyword

*cleans his RegEx tongs*
 
Top