Bug - Fixed Do we handle Machine Elf free fights correctly?

Veracity

Developer
Staff member
The Wiki says this:

Against a monster from The Deep Machine Tunnels, first 5 times per day:
<name> clucks his tongue and time starts passing again. This makes you realize that no time had passed while you were fighting that weird monster.
So, is a "monster from The Deep Machine Tunnels" ANY monster you encounter there?

I automated five turns in the DMT with my Machine Elf. Here is what I saw:

Code:
[16963] The Deep Machine Tunnels
Encounter: Candied Yam Golem

[16963] The Deep Machine Tunnels
Encounter: GT1

[16963] The Deep Machine Tunnels
Encounter: Navy Into Your Consciousness

[16964] The Deep Machine Tunnels
Encounter: Thinker of Theories

[16964] The Deep Machine Tunnels
Encounter: Appreciator of Tastes
1) A Holiday wanderer. No turns were consumed.
2) A Time-spinner prank. No turns were consumed - but they never are. Did my Machine elf cluck its tongue? I.e., did this consume one of my five "free combats"?
3) The DMT choice adventure. This did consume a turn.
4) A DMT monster
5) A DMT monster.

At the end of this, KoLmafia reported that I had used 4/5 of my free Machine Elf fights.

Clearly, the Holiday Monster counted as a "monster from the Deep Machine Tunnels" since it did not use up a turn, although it normally would have. But, I'm wondering if the Time Prank "wasted" one of my free turns.

I can try getting a DEBUG log tomorrow, assuming somebody pranks me, and see if "I realize no time has passed".

That would be a nice thing to log as a familiar action, anyway. Since we don't, perhaps it is not marked with the usual familiaraction HTML comment. I'll get a log of adventuring in the DMT tomorrow and will see what can be done.
 

Veracity

Developer
Staff member
FightRequest.java:

Code:
			case FamiliarPool.MACHINE_ELF:
				if ( responseText.contains( "time starts passing again" ) )
				{
					Preferences.increment( "_machineTunnelsAdv", 1, 5, false );
				}
				break;
So, we increment the setting if you have the Machine Elf equipped and we see the message. That tells me that the Time Prank (already a free fight) became a free fight via the Machine Elf.
 

lostcalpolydude

Developer
Staff member
Yes, time-spinner pranks in DMT are a good way to lose out on a free fight. If that matters, then a Hidden City shrine is a good place to start the day.

I'm pretty sure all of KoLmafia's tracking is correct there.
 

Veracity

Developer
Staff member
I believe it. I think I would like to see the Machine Elf's message in the session log, however.

I'll get a log tomorrow and see why we're not interpreting it as a familiarmessage.
 
Yeah, the same happens when you run DMT fights with eldritch attunement equipped: the free tentacle fights eat up machine elf charges, so I can do only 3 of those each day. (making the first two tentacles doubly free).

Speaking of the DMT though, currently mafia doesn't track free runaways from the boots in the DMT, because of the altered chat messages. I'm not sure if that even can be fixed (I dunno if there are separate messages for free and nonfree messages). However, when I then have to drop some meat (from the bittycar meatcar, probably) because of the free run, mafia also parses that loss of meat incorrectly as a gain, which causes all the tracking to be off. The values are small, of course, but it might be a good thing to look into that in general.

Also, currently there is no error correction for the machine elf free fights, so if it misses one of the messages for some reason, it doesn't correct when finishing a fight with the machine elf equipped but without getting the clucking message. (As I found out when my free fights script encountered that error and ended up spending 15 turns in the DMT trying to get that last free fight before I stopped it).
 
Last edited:

Veracity

Developer
Staff member
Code:
      <!--familiarmessage-->
      <center>
        <table>
          <tbody>
            <tr>
              <td align="center" valign="center">
                <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/lb_cricket.gif" width="30" height="30">
              <td valign="center">
                <table>
                  <tbody>
                    <tr>
                      <td valign="center" align="left">
                        A small flashing opaque viridian-throbbing, scintillating teal rectangle does something incomprehensible.
      <!--familiarmessage-->
      <center>
        <table>
          <tbody>
            <tr>
              <td align="center" valign="center">
                <img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/machelf.gif" width="30" height="30">
              <td valign="center">
                Gruddeus Grrl clucks his tongue and time starts passing again.  This makes you realize that no time had passed while you were fighting that weird monster.
We get two "familarmessage" comments, the second of which is the tongue clucking. I thought we logged those by default.

In any case, I have the log I need to investigate this.
 

Veracity

Developer
Staff member
Ha ha ha. FightRequest.java:

Code:
			// Don't log in Machine Elf Tunnels
			if ( status.logFamiliar && !FightRequest.machineElf )
			{
				FightRequest.logText( text, status );
			}
Well, maybe there is one Machine Elf action which could/should be logged.
 

Veracity

Developer
Staff member
OK. Even though I marked this fixed - because it does the thing I cared about when I created it - you report a couple of other issues.

Speaking of the DMT though, currently mafia doesn't track free runaways from the boots in the DMT, because of the altered chat messages. I'm not sure if that even can be fixed (I dunno if there are separate messages for free and nonfree messages).
I actually have never used the boots. I haven't used free runaways since the Bandersnatch. Just too casual a player. ;)

The boots are a familiar, so if you are in the DMT, that's because you went there with a snowglobe, not via the Machine Elf.

Perhaps a dev who understands the free runaways could comment on this.

However, when I then have to drop some meat (from the bittycar meatcar, probably) because of the free run, mafia also parses that loss of meat incorrectly as a gain, which causes all the tracking to be off. The values are small, of course, but it might be a good thing to look into that in general.
Same comment.

Also, currently there is no error correction for the machine elf free fights, so if it misses one of the messages for some reason, it doesn't correct when finishing a fight with the machine elf equipped but without getting the clucking message. (As I found out when my free fights script encountered that error and ended up spending 15 turns in the DMT trying to get that last free fight before I stopped it).
This should be fixable.

Code:
			case FamiliarPool.MACHINE_ELF:
				if ( responseText.contains( "time starts passing again" ) )
				{
					Preferences.increment( "_machineTunnelsAdv", 1, 5, false );
				}
				break;
This is done at the end of a fight that you win. Presumably, there could be something like:

Code:
				else if ( adventure == AdventurePool.DEEP_MACHINE_TUNNELS )
				{
					Preferences.setInteger( "_machineTunnelsAdv", 5 );
				}
We are using a Machine Elf, it didn't cluck when we won a fight, and we are in the Deep Machine Tunnels -> we must have used up the five free fights for the day.
 

lostcalpolydude

Developer
Staff member
Failure to see a free runaway message is difficult to handle. It could be garbled combat text (DMT, kloop content, haiku), or it could be that you are out of runaways for the day.

We currently don't even check that you were trying to run away, so that would require a change to the logic. I guess there's no need to worry about trying to run away but failing, since all of those things guarantee success even if they don't make it free.
 

heeheehee

Developer
Staff member
I thought the only thing that decremented remaining free fights is winning a fight, which can be checked via the presence of <!-- WINWINWIN -->.

http://kolmafia.us/showthread.php?1...ne-elf-capsule&p=130899&viewfull=1#post130899 confirms that it did work this way, at one point.

edit: oh wait, orthogonal issue. Boots runaways aren't parsed because we don't see the familiar text? And we could change that check to instead look at the POST params? Worth noting is priority of free runaway sources -- IIRC, boots (and probably bander) has priority over greatest american pants (and probably navel) in that if you're out of boots runs, and have both boots and pants equipped, then you'll get the failed boots runaway.
 
Last edited:

lostcalpolydude

Developer
Staff member
Also, if you are using a Bander with Ode, and you use CLEESH (or otherwise transform it? I would expect the same from a tangle of rat tails), then you will not get a free runaway.
 

Veracity

Developer
Staff member
Revision 17606 will note that you've used all your DMT free fights if your Machine Elf does not cluck after a won fight in the Deep Machine Tunnels.
 
Top