Bug - Not A Bug Monster ID and Fax

fronobulax

Developer
Staff member
Using the GUI I ask easyfax for a Knob Goblin Embezzler. It lists the monster as "Knob Goblin Embezzler<!-- monsterid: 530 --> [Knob Goblin Embezzler&lt;!-- monsterid: 530 --&gt;]" in the GUI, asks, and then times out. I expected a faxed monster.

The chat window shows

[08:23] fronobulax: Knob Goblin Embezzler&lt;!-- monsterid: 530 --&gt;

After it times out I type "Knob Goblin Embezzler" and one is received almost immediately.
[08:23] fronobulax: Knob Goblin Embezzler&lt;!-- monsterid: 530 --&gt;
[08:24] fronobulax: Knob Goblin Embezzler
[08:24] Easyfax: Your fax is ready.

It is quite likely the problem was introduced with r27923. It could be argued that easyfax needs to accommodate the change or that KoLmafia needs to change and send easyfax what was expected.
 
I expect it was reading the monster name from the photocopy, and thus it's the KoL change, not the Mafia change. But yes, I expect it's automated.
 
Yes, Not a Bug. It is automated and yes it should have automatically handed this KoL change. However, easyfax has one and only one special character. The colon ( : ) is not allowed in monster names. This is why messages are being dropped with no response. I'll switch characters.
 
Okay, switching characters got things working right again. As more faxes are looked at the problem with ambiguous monster names should be fixed.
 
Okay, switching characters got things working right again. As more faxes are looked at the problem with ambiguous monster names should be fixed.

I'm not seeing any fixes. Maybe it is because I only look at the first few monsters displayed as options?
 
I never use the fax GUI, but I just brought it up and I see monster ids for most (not all monsters).
This is the file mafia uses to populate that list and it also has monster ids.
 
I never use the fax GUI, but I just brought it up and I see monster ids for most (not all monsters).
This is the file mafia uses to populate that list and it also has monster ids.

See the first post.

Compare the GUI renditions for EasyFax and OnlyFax if desired.

Using
<name>1335 HaXx0r&amp;lt;!-- monsterid: 141 --&amp;gt;</name>
<actual_name>1335 HaXx0r&amp;lt;!-- monsterid: 141 --&amp;gt;</actual_name>
<command>1335 HaXx0r&amp;lt;!-- monsterid: 141 --&amp;gt;</command>
<category>None</category>

as an example, mafia appears to display <actual name> in the GUI. When <actual name> is requested mafia sends <command> and the request fails.

When I eliminated the GUI and typed <command> I got nothing but when I stripped out the monster id and typed the command I got a fax.

So my observations are two - there are cases when sending <command> do not return a fax AND it is difficult to compare monsters across faxbots and Monster Manual when the monster ID in present.

This is not a big deal in that I don't think EasyFax has any monster than Only Fax doesn't.

There could be some impatience on my part since I'm pretty sure a month ago all monsters had IDs and now some of them don't, i.e. actual orcish frat boy, so things are perhaps gradually changing.
 
In the GUI I noticed some duplication today. Adventurer echo was one, but not the only. There were entries both with and without the monster id. I confirmed that there were two entries in the JSON.
 
I noticed that Easyfax was not accepting my request. I tested this manually:

In Easyfax chat tab

Code:
Veracity: pumpkin spice wraith<!-- monsterid: 2486 -->
Easyfax: I couldn't find that monster. Please look here [link] http:// sourceforge.net/p/ easyfax/code/HEAD/ tree/list for a list of monster names.
[code]
Looked at the file at that link. I see this:
[code]
pumpkin spice wraith&lt;!-- monsterid: 2486 --&gt;

OK. Perhaps it really wants the entity encoding.
Back in chat:

Code:
Veracity: pumpkin spice wraith&lt;!-- monsterid: 2486 --&gt;
Easyfax: Your fax is ready.
Veracity: pumpkin spice wraith
Easyfax: Your fax is ready.

OK. Easyfax will accept a verbatim entry from its data file and also the name with the HTML comment stripped out.
In the data file, I see:

Code:
Astronomer&lt;!-- monsterid: 184 --&gt;
Astronomer&lt;!-- monsterid: 354 --&gt;

That would be ambiguous without the HTML entity.

In the Request a Fax GUI, I see this entry:

Code:
pumpkin spice wraith<!-- monsterid: 2486 --> [pumpkin spice wraith&lt;!-- monsterid: 2486 --&gt;]

which looks like a monster with a monsterId comment and the "command" in [] to get it.
I requested a Fax vis the GUI with KoLmafia's chat window open.
gCLI says:

Code:
Visiting Fax Machine in clan VIP lounge
Asking Easyfax to send a fax of pumpkin spice wraith<!-- monsterid: 2486 -->: pumpkin spice wraith<!-- monsterid: 2486 -->
Receiving a fax.
You acquire an item: photocopied monster
You receive a photocopied pumpkin spice wraith from the fax machine.

chat GUI says this in the easyfax tab:

Code:
[15:17] Veracity: pumpkin spice wraith&lt;!-- monsterid: 2486 --&gt;
[15:17] Easyfax: Your fax is ready.

It appears that Easyfax is working fine.

What about via script?

Code:
> ash can_faxbot($monster[pumpkin spice wraith])

Returned: true

> ash can_faxbot($monster[pumpkin spice wraith], "Easyfax")

Returned: false

> ash can_faxbot($monster[pumpkin spice wraith], "OnlyFax")
Returned: true

> ash faxbot($monster[pumpkin spice wraith], "Easyfax")

Returned: false

So the issue is that although Easyfax advertises monsters - including monster Id - that it can send you, but the ASH function's can_faxbot and faxbot can't find them.

RuntimeLibrary:

Code:
  private static Value can_faxbot(MonsterData monster, String faxbot) {
...
    FaxBotDatabase.configure();

    String actualName = monster.getName();
...
      Monster monsterObject = bot.getMonsterByActualName(actualName);
      if (monsterObject == null) {
        continue;
      }
...
  }

Perhaps we want faxBot.getMonster(MonsterData) - which will allow access to both monster name and monsterId.
For requesting a fax:

Code:
  public static Value faxbot(
      ScriptRuntime controller, final Value monsterName, final Value botName) {
    MonsterData monster = (MonsterData) monsterName.rawValue();
...
    return DataTypes.makeBooleanValue(bot.request(monster));
  }

we can request a monster by MonsterData object.

I think FaxbotDatabase needs a little work.

How do the two working Faxbots configure monsters with ambiguous names?

Easyfax:

Code:
<name>Astronomer&amp;lt;!-- monsterid: 184 --&amp;gt;</name>
<actual_name>Astronomer&amp;lt;!-- monsterid: 184 --&amp;gt;</actual_name>
<command>Astronomer&amp;lt;!-- monsterid: 184 --&amp;gt;</command>
<category>None</category>
</monsterdata>
<monsterdata>
<name>Astronomer&amp;lt;!-- monsterid: 354 --&amp;gt;</name>
<actual_name>Astronomer&amp;lt;!-- monsterid: 354 --&amp;gt;</actual_name>
<command>Astronomer&amp;lt;!-- monsterid: 354 --&amp;gt;</command>
<category>None</category>
</monsterdata>

OnlyFax:

Code:
        <monsterdata>
            <name>Astronomer</name>
            <actual_name>Astronomer</actual_name>
            <command>[184]Astronomer</command>
            <category>Ambiguous</category>
        </monsterdata>
        <monsterdata>
            <name>Astronomer (obsolete)</name>
            <actual_name>Astronomer (obsolete)</actual_name>
            <command>[354]Astronomer (obsolete)</command>
            <category>Ambiguous</category>
        </monsterdata>
 
Something has changed.

In native KoL chat - not even the Relay Browser:

Code:
Veracity: pumpkin spice wraith<!-- monsterid: 2486 -->
Easyfax: I couldn't find that monster. Please look here [link] http:// sourceforge.net/p/ easyfax/code/HEAD/ tree/list for a list of monster names.
Veracity: pumpkin spice wraith&lt;!-- monsterid: 2486 --&gt;
Easyfax: I couldn't find that monster. Please look here [link] http:// sourceforge.net/p/ easyfax/code/HEAD/ tree/list for a list of monster names.
Veracity: pumpkin spice wraith&amp;lt;!-- monsterid: 2486 --&amp;gt;
Easyfax: I couldn't find that monster. Please look here [link] http:// sourceforge.net/p/ easyfax/code/HEAD/ tree/list for a list of monster names.

Going to the file that Easyfax linked me to, I see this:

Code:
pumpkin spice wraith&lt;!-- monsterid: 2486 --&gt;

That is precisely the second thing I typed in chat to Easyfax.

I removed easyfax.xml and logged in via KoLmafia and forced a new download.

easyfax.xml:
Code:
<monsterdata>
<name>pumpkin spice wraith&amp;lt;!-- monsterid: 2486 --&amp;gt;</name>
<actual_name>pumpkin spice wraith&amp;lt;!-- monsterid: 2486 --&amp;gt;</actual_name>
<command>pumpkin spice wraith&amp;lt;!-- monsterid: 2486 --&amp;gt;</command>
<category>None</category>
</monsterdata>

That command is precisely the third thing I typed in chat to Easyfax.

I no longer have any idea about how to make KoLmafia request a fax from Easyfax.
 
I no longer have any idea about how to make KoLmafia request a fax from Easyfax.
My limited experiments showed that if I typed <command> in chat nothing happened, but if I edited the command before sending so that the bracketed monster ID portion was no longer part of what was sent in chat, the fax arrived.
 
Crowther:

Here are two monsters in easyfax.xml:

Code:
<name>Astronomer&amp;lt;!-- monsterid: 184 --&amp;gt;</name>
<actual_name>Astronomer&amp;lt;!-- monsterid: 184 --&amp;gt;</actual_name>
<command>Astronomer&amp;lt;!-- monsterid: 184 --&amp;gt;</command>
<category>None</category>
</monsterdata>

<monsterdata>
<name>Astronomer&amp;lt;!-- monsterid: 354 --&amp;gt;</name>
<actual_name>Astronomer&amp;lt;!-- monsterid: 354 --&amp;gt;</actual_name>
<command>Astronomer&amp;lt;!-- monsterid: 354 --&amp;gt;</command>
<category>None</category>
</monsterdata>

Notice the "command" tags. That specifies what KoLmafia will send to Easyfax to request that monster.
I requested each of them using the "Request a Fax" GUI.

Here is what appeared in chat.

Code:
[12:50] Veracity: Astronomer&amp;lt;!-- monsterid: 184 --&amp;gt;
[12:50] Easyfax: I couldn't find that monster. Please look here [link] http:// sourceforge.net/p/ easyfax/code/HEAD/ tree/list for a list of monster names.
[12:50] Veracity: Astronomer&amp;lt;!-- monsterid: 354 --&amp;gt;
[12:50] Easyfax: I couldn't find that monster. Please look here [link] http:// sourceforge.net/p/ easyfax/code/HEAD/ tree/list for a list of monster names.

Oh, so it wants a "monster name" - even though that file it links to shows a monster name with monsterId info in an HTL comment.
Let's try a "monster name":

Code:
[12:53] Veracity: Astronomer
[12:53] Easyfax: Your fax is ready.

Isn't that special. Which of the two Astronomers did it send me?

I received the fax and got a photocopied monster.

This is a sheet of copier paper with a grainy, blurry likeness of an Astronomer<!-- monsterid: 184 --> on it.

The faxbot config file is required to put the verbatim command to send to the faxbot into the "command" tag of a "monsterdata".
Easyfax is not doing that; if we send the exact command it advertises, it doesn't work.

Please advise.

Thank you.
 
I'm under the weather, so my debugging skills are slow at best.

Easyfax doesn't use anything other than the name it sees on the fax page. This is why all three fields contain the same text, which I'm sure you noticed.

Never mind. I see the problem. KoL is inserting spaces.
 
Nope that isn't it. Maybe it has something to do with entity_encode() etc. Those extra spaces are in the XML file, mafia sends those without extra spaces and easyfax responds correctly, when I test it from the GUI.
 
OK, this is in "list" on sourceforge:

Astronomer&lt;!-- monsterid: 354 --&gt;

This is in easyfax.xml:

<command>Astronomer&amp;lt;!-- monsterid: 354 --&amp;gt;</command>

Perhaps I need to do entityDecode on that command. Let me try that.
 
OK, I need to neither escape or unescape; the DOM parser leaves the command in the form Easyfax needs.
Fine.

I'm changing the faxbot code to store available monsters by monsterId, rather than by name - and both Easyfax and OnlyFax tag all monsters by monsterId, so, cool.

You need do nothing.

Thanks.
 
Cool, cool.

Code:
> ash can_faxbot($monster[Astronomer (obsolete)])

Returned: true

> ash can_faxbot($monster[Astronomer (obsolete)], "Easyfax")

Returned: true

> ash can_faxbot($monster[Astronomer (obsolete)], "OnlyFax")

Returned: true

> ash faxbot($monster[Astronomer (obsolete)], "Easyfax")

Visiting Fax Machine in clan VIP lounge
Sending a fax.
You load your photocopied monster in the fax machine.
Asking Easyfax to send a fax of Astronomer (obsolete): Astronomer<!-- monsterid: 354 -->
Receiving a fax.
You acquire an item: photocopied monster
You receive a photocopied Astronomer (obsolete) from the fax machine.
Returned: true

> ash faxbot($monster[Astronomer (obsolete)], "OnlyFax")

Visiting Fax Machine in clan VIP lounge
Sending a fax.
You load your photocopied monster in the fax machine.
Asking OnlyFax to send a fax of Astronomer (obsolete): [354]Astronomer (obsolete)
Receiving a fax.
You acquire an item: photocopied monster
You receive a photocopied Astronomer (obsolete) from the fax machine.
Returned: true

And in KoLmafia chat tabs:

Code:
[15:28] Veracity: Astronomer&lt;!-- monsterid: 354 --&gt;
[15:28] Easyfax: Your fax is ready.
Code:
[15:29] Veracity: [354]Astronomer (obsolete)
[15:29] OnlyFax: Your fax is ready: Astronomer (obsolete)
 
Back
Top