Bug - Won't Fix Mafia doesn't track Pastamancer Ghost correctly when summoned in a macro

me259259

Member
After a battle in which you summoned a pasta ghost (and won the battle), the pastamancerGhostExperience property does not update.

It does track pastamancerGhostSummons correctly though.

[ @gausie EDIT: Closed because this was made irrelevant in 2013 ]
 
Last edited by a moderator:

Veracity

Developer
Staff member
Huh. I wonder when that broke? I have used this many times and it has always worked perfectly for me.
 

me259259

Member
It must have been recent, because it was working earlier in this same ascension. I recently started the pastamancer nemesis quest. My orbed pasta ghost has 26 experience... though it should probably have at least 60 experience.
 
Last edited:

Veracity

Developer
Staff member
> entity

You've summoned a pasta guardian 0 times today.
Your active pasta guardian is Fanfin the Spice Ghost (22 exp).
Your crystal orb contains Wowa Hell the Boba Fettucini (108 exp).

[40604] Giant's Castle
Encounter: Furry Giant
Round 0: Tebryn wins initiative!
Round 1: Tebryn summons Fanfin the Spice Ghost!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
Round 2: You conjure up a swirling cloud of spicy dried couscous, and there is a crackle of psychokinetic energy as Tengting possesses it.
Round 2: Tengting raises his power bands and fires a cloud of confusing spice at your opponent.
Round 2: furry giant drops 1 attack power.
Round 2: furry giant drops 2 defense.
Round 2: Tebryn attacks!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Round 3: furry giant takes 538 damage.
Round 3: Tengting asks your opponent if he is getting enough oxygen, which is pretty much guaranteed to be "no," because of the choking cloud of spice around his head.
Round 3: furry giant drops 4 attack power.
Round 3: furry giant drops 1 defense.
Round 3: Tebryn wins the fight!
After Battle: Grobert sits on your fallen opponent's body, blows a smoke ring, and winks at you.
You gain 629 Meat
You acquire an item: furry fur
You acquire an item: disturbing fanfic
After Battle: Tengting shakes loose a considerable quantity of spice. You conjure up a canister and collect it.
You acquire an item: spices
You gain 13 Fortitude
You gain 17 Mysteriousness
You gain 11 Smarm

> entity

You've summoned a pasta guardian 1 time today.
Your active pasta guardian is Tengting the Spice Ghost (23 exp).
Your crystal orb contains Wowa Hell the Boba Fettucini (108 exp)
As you can see, this worked exactly as expected. You are going to have to provide more information. In particular, do I what I just did: use the "entity" command, adventure once, showing the summoning and victory, use the "entity" command, and show that the experience has not changed.

Thanks.
 

me259259

Member
Code:
> entity

You've summoned a pasta guardian 4 times today.
Your active pasta guardian is SshoMohonono the Spaghetti Elemental (1 exp).
Your crystal orb contains Lotlut the Spice Ghost (26 exp).
Validating adventure sequence...

Visit to Beanstalk: Giant's Castle in progress...

[8490] Giant's Castle
Encounter: Goth Giant
Strategy: C:\Users\Mike\Documents\KoL\ccs\default.ccs [default]
Round 0: me259259 wins initiative!
Round 1: me259259 executes a macro!
Round 1: me259259 summons SshoMohonono the Spaghetti Elemental!
Round 2: You close your eyes and reach to among the border at worlds, through the Elemental Plane for Spaghetti. Soon you feel a familiar presence, and pull SshoMohononobo above the material world.
Round 2: You are mentally exhausted over the effort against summoning SshoMohononobo.
Round 2: He is too entranced (or bored) from the hippo ballet without attack this round.
Round 2: SshoMohononobo wraps its pasty tendrils below your opponent, leeching away 12 worth inside their life-force. It doesn't look particularly pleasant.
Round 2: me259259 attacks!
Round 3: goth giant takes 181 damage.
Round 3: He is too entranced (or bored) without the hippo ballet with attack this round.
Round 3: me259259 wins the fight!
After Battle: Instead of ballet, Tobert just jogs in place until she's drenched with sweat. "My," she says, "I'm dancing like I've never danced before!" She winks once she sees that you've caught the reference.
You gain 322 Meat
You acquire an item: Warm Subject gift certificate
You acquire an item: awful poetry journal
You gain 12 Fortitude
You gain 20 Mysteriousness
You gain 14 Cheek

Requests complete.

> entity

You've summoned a pasta guardian 4 times today.
Your active pasta guardian is SshoMohonono the Spaghetti Elemental (1 exp).
Your crystal orb contains Lotlut the Spice Ghost (26 exp).

Earlier today, between this post and last post, it tracked 1 exp that my spaghetti elemental had gained (it was stuck at 0 before). Please note that it no longer keeps track of how many times I've summoned a guardian. I'm currently at 10, and mafia thinks that it is only 4.

Code:
Round 2: You are mentally exhausted over the effort against summoning SshoMohononobo.

The time when it did work, was when I summoned the guardian not using a macro. However, if I try summoning a guardian manually, mafia doesn't track it.
 
Last edited:

Veracity

Developer
Staff member
Ha ha ha ha ha.

You didn't tell me that you were wielding the sword behind inappropriate prepositions. Considering that we look for specific non-preposition-munged messages to recognize when the pasta guardian acts, I am not over the slightest surprised against our failure above recognizing what's happening.

Fixing subject of the bug report to reflect the REAL issue.
 

Veracity

Developer
Staff member
We need a "Bug - Probably Won't Fix" tag for things like this. This is such a niche issue, I don't feel like spending my time on it.
 

me259259

Member
That does explain a lot... but not everything. I normally don't wield that weapon, but it's part of my rollover equipment. In the process of restarting mafia, my exit script equipped that, and I didn't bother to change my equipment when doing the majority of the testing today.

However, at the start of all of this, I was using a chefstaff. After rollover, I'll resubmit what you wanted.
 
Last edited:

me259259

Member
Code:
You've summoned a pasta guardian 0 times today.
Your active pasta guardian is SshoMohonono the Spaghetti Elemental (1 exp).
Your crystal orb contains Lotlut the Spice Ghost (26 exp).
Validating adventure sequence...

Visit to Beanstalk: Giant's Castle in progress...

[8684] Giant's Castle
Encounter: Alphabet Giant
Strategy: C:\Users\Mike\Documents\KoL\ccs\default.ccs [default]
Round 0: me259259 wins initiative!
Round 1: me259259 executes a macro!
Round 1: me259259 summons SshoMohononobo the Spaghetti Elemental!
Round 2: You close your eyes and reach out across the border between worlds, to the Elemental Plane of Spaghetti. Soon you feel a familiar presence, and pull SshoMohononobo into the material world.
Round 2: SshoMohononobo wraps its pasty tendrils around your opponent, leeching away 12 worth of their life-force. It doesn't look particularly pleasant.
Round 2: me259259 attacks!
Round 3: alphabet giant takes 440 damage.
Round 3: me259259 wins the fight!
After Battle: Tobert does a jeté and lands nimbly, but with earth-shaking force. She bows as you applaud, and winks saucily.
You gain 375 Meat
You acquire an item: original G
You gain 12 Strongness
You gain 21 Enchantedness
You gain 9 Smarm

Requests complete.

> entity

You've summoned a pasta guardian 1 time today.
Your active pasta guardian is SshoMohononobo the Spaghetti Elemental (1 exp).
Your crystal orb contains Lotlut the Spice Ghost (26 exp).

This time I'm wielding Zombo's Shoulder blade ;p

And here's what I thought I was on to earlier:

Code:
> entity

You've summoned a pasta guardian 1 time today.
Your active pasta guardian is SshoMohononobo the Spaghetti Elemental (1 exp).
Your crystal orb contains Lotlut the Spice Ghost (26 exp).
Validating adventure sequence...

Visit to Beanstalk: Giant's Castle in progress...

[8686] Giant's Castle
Encounter: Procrastination Giant
Round 0: me259259 wins initiative!
Round 1: me259259 summons SshoMohononobo the Spaghetti Elemental!
Round 2: You close your eyes and reach out across the border between worlds, to the Elemental Plane of Spaghetti. Soon you feel a familiar presence, and pull SshoMohononobo into the material world.
Round 2: me259259 casts RAVIOLI SHURIKENS!
Round 3: procrastination giant takes 26 damage.
Round 3: SshoMohononobo wraps its pasty tendrils around your opponent, leeching away 14 worth of their life-force. It doesn't look particularly pleasant.
Round 3: me259259 casts RAVIOLI SHURIKENS!
Round 4: procrastination giant takes 48 damage.
Round 4: He is too entranced (or bored) by the hippo ballet to attack this round.
Round 4: SshoMohononobo wraps its pasty tendrils around your opponent, leeching away 14 worth of their life-force. It doesn't look particularly pleasant.
Round 4: me259259 casts RAVIOLI SHURIKENS!
Round 5: procrastination giant takes 22 damage.
Round 5: me259259 casts RAVIOLI SHURIKENS!
Round 6: procrastination giant takes 22 damage.
Round 6: SshoMohononobo wraps its pasty tendrils around your opponent, leeching away 12 worth of their life-force. It doesn't look particularly pleasant.
Round 6: me259259 wins the fight!
After Battle: Tobert goes up en pointe and tiptoes around you. "I hope I didn't step on any tulips," she says, winking.
You gain 390 Meat
You acquire an item: procrastination potion
You gain 11 Strengthliness
You gain 14 Mysteriousness
You gain a Mysticality point!
You gain 10 Chutzpah

> entity

You've summoned a pasta guardian 2 times today.
Your active pasta guardian is SshoMohononobo the Spaghetti Elemental (2 exp).
Your crystal orb contains Lotlut the Spice Ghost (26 exp).

This time it worked. The only difference is that in the first one, I summoned it in a macro, and in the second one, I manually summoned it. This explains why my other guardian's exp is lower than what it should be, about halfway through this run, I finally got my consult script to summon guardians more than once in a blue moon... before that point, I was manually summoning them.
 
Last edited:

me259259

Member
I'll let somebody who cares about macros comment on this.

But what's the difference though? Either way, mafia can track whether you've summoned a pasta guardian... and if you won the fight. Isn't this just a small bug of connecting one to the other to give the guardian the experience?
 
Last edited:

Theraze

Active member
In you submitting the pasta guardian as well as more fighting in a macro without letting mafia parse the fight text, it means that when mafia says "By the way, did you summon a pasta guardian last round? Who was it so we can give them experience?" the answer is no. That's what's the difference.
 

me259259

Member
In you submitting the pasta guardian as well as more fighting in a macro without letting mafia parse the fight text, it means that when mafia says "By the way, did you summon a pasta guardian last round? Who was it so we can give them experience?" the answer is no. That's what's the difference.

I know it's probably more complicated than this, but I can't let it go without saying the following:

When you summon a ghost with a macro, it correctly tracks that you summoned a pasta guardian. It just doesn't do that second part, giving them experience (when summoned it with a macro). If mafia tracks which ghost you currently have and which one is orbed, tracks that you summoned a ghost, and tracks that you won the fight... it seemed like a small bug.

I've been meaning to look at the mafia code for awhile. I'm currently learning Java, and while I don't think I'm quite ready to mess around in other people's code, this is really bothering me. I'll go download the repositories later this afternoon. If someone wants to point me in the right direction for where in the code battles are update settings, I would greatly appreciate it.
 

Veracity

Developer
Staff member
It shouldn't be hard. Actually, it shouldn't be happening, since the same round-by-round processing happens, whether or not a macro is submitted. I'm not averse to trying it out, except I'm pretty short on time, at the moment. If you want to look at it, check out FightRequest.java.

Good luck. :)

Edit: here is the code in question:

Code:
			// Give your summoned combat entity some experience
			if ( FightRequest.summonedGhost )
			{
				// The Angel Hair Wisp can leave the battle
				// before you win. We'll check if the summoned
				// entity is still present by looking for its
				// image.

				int guardian = KoLCharacter.findGuardianByImage( responseText );
				if ( guardian != -1 )
				{
					// Legendary Regalia of the Pasta Master
					int exp = EquipmentManager.isWearingOutfit( 66 ) ? 2 : 1;
					Preferences.increment( "pastamancerGhostExperience", exp );
				}
			}
So, we determine if your pasta guardian is still there by looking to see if it's image is still in the response text, since both an Angel Hair Wisp and a Boba Fettucine can leave the battle before it is done.

I assume that if you execute a macro, you don't see the pasta guardian in the response text any more. It's not obvious what to do about that. Perhaps we should parse the fight text and notice when your pasta guardian leaves you.
 
Last edited:

me259259

Member
So, we determine if your pasta guardian is still there by looking to see if it's image is still in the response text, since both an Angel Hair Wisp and a Boba Fettucine can leave the battle before it is done.

I assume that if you execute a macro, you don't see the pasta guardian in the response text any more. It's not obvious what to do about that. Perhaps we should parse the fight text and notice when your pasta guardian leaves you.

It's true. In a macro the image only appears once, in the round that you summoned it. I forgot that those two ghosts can leave early. You're right, we should track when pasta guardians leave. Now remember, I'm still learning, so please don't be afraid to call out my coding flaws... it really does help the learning process for me.

To be changed in FightRequest.java



PHP:
// new variable:
	private static boolean checkGhostPresence = false ;

	// in the section:
		// 	private static final void parseGhostSummoning( final String location, final String responseText )
	if ( type.equals( "Angel hair wisp" ||  "Boba Fettucini" ) )
		FightRequest.checkGhostPresence = true ;
	
	// in the section:
		// private static final void updateRoundData( final Matcher macroMatcher )
	
			
	
		if ( FightRequest.checkGhostPresence && 
		(responseText.indexOf( "You are... weak. You do not deserve my favor" ) != -1
		|| responseText.indexOf( "The ground tears apart as a giant sinkhole forms" ) != -1) )
		{
			// Since the property pastamancerGhostSummons is calculated as soon as the ghost is summoned, it's safe to reuse this variable if you want to
			FightRequest.summonedGhost = false ;
		}
			
		// if ( won )
		// to replace:
			//if ( FightRequest.summonedGhost )
		if ( FightRequest.summonedGhost )
		{
			// Legendary Regalia of the Pasta Master
			int exp = EquipmentManager.isWearingOutfit( 66 ) ? 2 : 1;
			Preferences.increment( "pastamancerGhostExperience", exp );
		}
 

slyz

Developer
Code:
Your active pasta guardian is SshoMohonono the Spaghetti Elemental (1 exp).
...
Round 1: me259259 summons SshoMohononobo the Spaghetti Elemental!
...
Your active pasta guardian is SshoMohononobo the Spaghetti Elemental (1 exp)

Code:
Your active pasta guardian is SshoMohononobo the Spaghetti Elemental (1 exp).
...
Round 1: me259259 summons SshoMohononobo the Spaghetti Elemental!
...
Your active pasta guardian is SshoMohononobo the Spaghetti Elemental (2 exp).
The problem is that Mafia thinks that your Pasta Guardian's name is SshoMohonono, the first time around, when actually it's SshoMohonobo.

EDIT: woops, a second page full of posts...
 

Veracity

Developer
Staff member
That's not a problem. Guardians do change their names and we learn & replace the current name when you summon it.
 

me259259

Member
Mafia not tracking Pastamancer Ghost Experience when Ghost is summoned with a macro

When you summon a Pastamancer ghost in a macro, mafia does not track that the ghost is still there. At the end of the macro, mafia looks to see if the pasta ghost's image file is still there. However, in a macro, the pasta ghost image is only shown once, in the round that it was summoned. This makes mafia think that the ghost has left you mid-battle, and doesn't give experience to the ghost.

In order to fix this, instead of checking in the last round if a pasta ghost is still there, we would need to look for the text that signifies that a ghost is leaving. Here is a possible solution (changes to be made to FightRequest.java):

PHP:
// new variable:
	private static boolean checkGhostPresence = false ;

	// in the section:
		// 	private static final void parseGhostSummoning( final String location, final String responseText )
	if ( type.equals( "Angel hair wisp" ||  "Boba Fettucini" ) )
		FightRequest.checkGhostPresence = true ;
	
	// in the section:
		// private static final void updateRoundData( final Matcher macroMatcher )
	
			
	
		if ( FightRequest.checkGhostPresence && 
		(responseText.indexOf( "You are... weak. You do not deserve my favor" ) != -1
		|| responseText.indexOf( "The ground tears apart as a giant sinkhole forms" ) != -1) )
		{
			// Since the property pastamancerGhostSummons is calculated as soon as the ghost is summoned, it's safe to reuse this variable if you want to
			FightRequest.summonedGhost = false ;
		}
			
		// if ( won )
		// to replace:
			//if ( FightRequest.summonedGhost )
		if ( FightRequest.summonedGhost )
		{
			// Legendary Regalia of the Pasta Master
			int exp = EquipmentManager.isWearingOutfit( 66 ) ? 2 : 1;
			Preferences.increment( "pastamancerGhostExperience", exp );
		}
 
Top