Bug - Fixed Item manager not updating (clovers)

jwylot

Member
Using r9710 although I noticed this a few days ago too but decided it might just be me.

Item manager general tab shows 2 disassembled clovers. I use one from item manager and it still shows 2 disassembled covers. Using the refresh button updates correctly.
 

matt.chugg

Moderator
Using r9710 although I noticed this a few days ago too but decided it might just be me.

Item manager general tab shows 2 disassembled clovers. I use one from item manager and it still shows 2 disassembled covers. Using the refresh button updates correctly.

Cannot reproduce, if this happens everytime for you, can you provide a debug log.

just in case:
1: Log into mafia
2: Click help-->Start debug log
3: do whatever you did to get the error
4: Click help-->Stop debug log
4: Upload the created log (in the same folder as kolmafia) to this thread as an attachement.
 

lostcalpolydude

Developer
Staff member
This was happening for me yesterday. It isn't happening today. When it was happening, disassembling the clover was properly handled. I didn't think to get a debug log.
 

jwylot

Member
It's still happening today for me. Item manager shows 2 disassembled clovers. On using one, it still shows 2 disassembled clovers and one ten leaf. Oh, on using the ten leaf from item manager, I ended up with 3 disassembled clovers (not logged).

Debug log attached as requested.
 

Attachments

  • DEBUG_20110809-1.txt
    4.8 KB · Views: 101
Last edited:

bumcheekcity

Active member
Disassembled Clover not being Removed when Used

Code:
The hermit kept his stuff.
bcasc_lastHermitCloverGet     => 20110810
BCC: We've already got Clovers Today
BCC:     Going to use clovers to level.
BCC: We have     4 clovers and are using one to level.
Using 1 disassembled     clover...
You acquire an item: ten-leaf clover
Finished using 1     disassembled clover.

[605] Haunted Ballroom
Encounter: Forward     to the Past
You gain 251 Chutzpah
You gain a Moxie point!
BCC:     We have 4 clovers and are using one to level.
Using 1     disassembled clover...
You acquire an item: ten-leaf clover
Finished     using 1 disassembled clover.

[606] Haunted Ballroom
Encounter:     Forward to the Past
You gain 215 Roguishness
You gain some Moxie     points!
BCC: We have 4 clovers and are using one     to level.
Using 1 disassembled clover...
You acquire an item:     ten-leaf clover
Finished using 1 disassembled clover.

[607]     Haunted Ballroom
Encounter: Forward to the Past
You gain 237     Roguishness
You gain a Moxie point!
BCC: We     have 4 clovers and are using one to level.
Using 1 disassembled     clover...
You acquire an item: ten-leaf clover
Finished using 1     disassembled clover.

[608] Haunted Ballroom
Encounter: Forward     to the Past
You gain 273 Smarm
You gain a Moxie point!
BCC:     We have 4 clovers and are using one to level.
Using 1     disassembled clover...
You don't have that many     disassembled clovers

So using a disassembled clover from an ASH script apparantly doesn't remove it from inventory.
 

BleedingFingers

New member
I'm also getting this problem when using the bumcheekascend script, it eventually gets stuck trying to use clovers that don't exist anymore. I refresh and all the clover counts get updated. So seems ASH use of clovers isn't changing the count.
 
I also noticed a clover miscounting during my fist bang run. Listed me as having 6, then I refreshed and it showed 4. No debug log, so kind of useless, but another hat in the ring for "something is actually going on here".
 

BleedingFingers

New member
Just noticed another thing with this... If I select disassembled clovers in the Item Manager and click "use item", the listbox then lists all the disassembled clovers plus the same amount of ten-leaf clovers.
If I then refresh, the disassembled clovers disappear and only the ten-leaf clovers remain.

This works fine when using ten-leaf clovers... The clovers are removed from the list and replaced with disassembled clovers.
 

Ferdawoon

Member
Disassembled clovers not reduced when assembling them.

Noticed this when using BCCAscend, that the script wanted to use clovers that it could not find. I thought that maybe it was something with the script and thought nothing more of it, until now when I manually assembled some clovers for Epic weapons.

Using r9738 but have been like this for 2-3 days I think. When in Item manager, General section, clicking Use on a disassembled clover to make it a 10-leaf clover the finished one appear in the list, but the number of disassembled clovers do not go down. I have used 3 clovers today and I still have 4 disassembled clovers.

A refresh of the inventory solve the problem and the right number of clovers appear. A refresh solved the problem back when I first noticed this as well.
 

Winterbay

Active member
Had it happen just now as well, unscripted as well. Used 2 disasembled clovers to get a chef-in-the-box. Ran BCCAscend which after a while (some 33 turns later) wanted to level with them and exited because I didn't have the clovers it thought I had. A refresh solves the problem as per usual.

Edit: FWIW I used the clovers via "use 1 dis clo" in the CLI.

Edit, edit: Again today so addign CLI-output now:
Code:
> inv clov

disassembled clover

> use 1 dis clo

Using 1 disassembled clover...
You acquire an item: ten-leaf clover
Finished using 1 disassembled clover.

> inv clo

disassembled clover
ten-leaf clover
 
Last edited:
Attaching a debug log where I had a single disassembled clover, and after using it mafia listed me as having a ten-leaf and a disassembled. I started with a ten-leaf clover, converted that into a disassembled clover with no inventory errors, then turned it back to a ten-leaf clover and got the "dupe" listing.
 

Attachments

  • DEBUG_20110827.txt
    65.8 KB · Views: 37
Last edited:

slyz

Developer
I managed to track it down to this part of SingleUseRequest.registerRequest():
Code:
// Punt if don't have enough of any ingredient.
[B]RequestLogger.printLine( "going through ingredients ("+ingredients.length+")" );[/B]
for ( int i = 0; i < ingredients.length; ++i )
{
	AdventureResult ingredient = ingredients[ i ];
	int have = ingredient.getCount( KoLConstants.inventory );
	int need = count * ingredient.getCount();
	[B]RequestLogger.printLine( "ingredient " + ingredient.getName() + ", have " + have + ", need " + need );[/B]
	if ( have < need )
	{
		return true;
	}
}
This is right before the ingredients are removed from inventory, so returning at this point means that the ingredients stay in the inventory.

Here, the ingredient that has been used is the disassembled clover, and the concoction we are supposed to get is a ten-leaf clover.

I added the bolded code, and here is the result when I use a disassembled clover:
Code:
> inv clover

disassembled clover

> use 1 disas clov

Using 1 disassembled clover...
going through ingredients (2)
ingredient worthless item, have 0, need 1
You acquire an item: ten-leaf clover
Finished using 1 disassembled clover.

> inv clover

disassembled clover
ten-leaf clover

It looks like the recipe for ten-leaf clovers that is in concoctions.txt
Code:
ten-leaf clover	SUSE, NOBEE	disassembled clover
is overridden at some point:
Code:
> ashq foreach i,q in get_ingredients($item[ten leaf clover]) print(q+" "+i )

1 hermit permit
1 worthless item
So a disassembled clover is recognized as an ingredient for a ten-leaf clover, but a ten-leaf clover doesn't have a disassembled clover as ingredient.

I'm glad I figured out why this was happening, but I'm really stumped as to how it should be fixed without breaking anything else.
 

Veracity

Developer
Staff member
Thank you! This turns out to be the same issue which prevents Theraze from doing "acquire 1 ten-leaf clover" and getting it by using a disassembled clover rather than buying from the Hermit.

This code in CoinmastersDatabase.registerPurchaseRequest:
Code:
		// If we can create it any other way, prefer that method
		if ( concoction.getMixingMethod() == KoLConstants.NOCREATE )
		{
			concoction.setMixingMethod( KoLConstants.COINMASTER );
			concoction.addIngredient( request.getCost() );
		}

... attempts to only set the creation method of an item to COINMASTER if there is not another method already. It was done that way specifically to NOT override the ten-leaf clover. However, if you have not yet Hax0red the Hermit, the following code in HermitRequest.resetConcoctions:
Code:
		int count = Preferences.getBoolean( "hermitHax0red" ) ? 1 : 2;
		Iterator it = KoLConstants.hermitItems.iterator();
		while ( it.hasNext() )
		{
			AdventureResult item = (AdventureResult) it.next();
			Concoction c = ConcoctionPool.get( item.getItemId() );
			AdventureResult[] ingredients = c.getIngredients();
			if ( ingredients.length != count )
			{
				c.resetIngredients();
				c.addIngredient( HermitRequest.WORTHLESS_ITEM );
				if ( count == 2 )
				{
					c.addIngredient( HermitRequest.PERMIT );
				}
			}
		}
...will change the ingredients.

I'll make that method only change ingredients for items created with the COINMASTER creation method.
 
Top