Feature - Implemented Bag O' Tricks charges

Linknoid

Member
Trying to keep track of Bag O' Tricks charges in combat using combat filters is a pain. Not every combat is guaranteed to have a filter, and not every response is sent to the combat filter (or at least I think the end of combat page is excluded). It would be nice if it kept track of charges automatically.

Charges are kept across rollover, range from 0 to 3, and reduce to 0 when you activate the buff. Buffs are limited to 3 times a day.

I think the code to support it is pretty simple. I added this to my local copy, FightRequest.java function updateRoundData:

Code:
			if ( KoLCharacter.hasEquipped( ItemPool.get( ItemPool.BAG_O_TRICKS, 1 ), EquipmentManager.OFFHAND ) )
			{
				if ( responseText.contains( "You reach into the bag and pull out " ) )
				{
					Preferences.increment( "_bagOTricksBuffs" );
					Preferences.setInteger( "bagOTricksCharges", 0 );
				}
				else if ( responseText.contains( "The Bag o' Tricks" ) )
				{
					if ( responseText.contains( "The Bag o' Tricks suddenly feels a little heavier." ) )
					{
						Preferences.setInteger( "bagOTricksCharges", 1 );
					}
					else if ( responseText.contains( "The Bag o' Tricks begins to wriggle around in your hand." ) )
					{
						Preferences.setInteger( "bagOTricksCharges", 2 );
					}
					else if ( responseText.contains( "The Bag o' Tricks begins squirming around more urgently." ) ||
							  responseText.contains( "The Bag o' Tricks continues to wriggle around in your hand." ) )
					{
						Preferences.setInteger( "bagOTricksCharges", 3 );
					}
				}
			}
 

zarqon

Well-known member
BatBrain tracks this for you if you're using a BatBrain-powered script such as SmartStasis or WHAM. If you're not, though, very tricky to track presently.

I'd be pleased as well if BatBrain could use a more reliable built-in property.
 
Top