In mafia CLI, I do this:
> ash faxbot($monster[big creepy spider]);
Returned: false
So, although FaxBot advertises a "Big Creepy Spider", KoLmafia is not finding it when it looks up "big creepy spider", which is the actual KoLmafia name for that creature.
> ash faxbot($monster[completely different spider]);
Visiting Fax Machine in clan VIP lounge
Asking FaxBot to send a fax of Big Creepy Spider: spider
Receiving a fax.
You acquire an item: photocopied monster
You receive a photocopied completely different spider from the fax machine.
Returned: true
Interesting. So, KoLmafia is looking up "completely different spider" and finding it. We'll see why, shortly...
When this happens, I get this in my chat window:
private to FaxBot: spider
FaxBot (private): FaxBot has copied a Big Creepy Spider into your clan's Fax Machine.
Yes. When KoLmafia looks up "completely different spider", it finds FaxBot's config record with the "pretty" name of "Big Creepy Spider" and the command "spider".
And if you look at the photocopied monster, what do you get? I'll tell you, since I just did the whole process manually:
From chat:
private to FaxBot: spider
FaxBot (private): FaxBot has copied a Big Creepy Spider into your clan's Fax Machine.
At the fax machine, I "receive" the fax:
You hear the fax machine ringing, so you walk up to it to see what's coming in. The top half of a document prints out, but then the stupid thing jams and starts beeping at you.
You get the jam cleared and hit a bunch of buttons trying to get it to continue, but all you manage to do is print out a copy of the last thing somebody tried to fax out. Oh well.
photocopied monster You acquire an item: photocopied monster
and when I look at it, I get this:
This is a sheet of copier paper with a grainy, blurry likeness of a completely different spider on it.
I sent the "spider" command to FaxBot and it sent me a "completely different spider".
So, somewhere, Mafia knows faxbot has a $monster[completely different spider] but NOT a $monster[big creepy spider]. Based on the list from the 'Request a Fax' dialog and the returned chat dialog it is likely parsing the weas XML for the request and response, but clearly the ash command is doing something different, because it knows the difference between the spiders.
Wow, major assumptions there. "clearly" "the ash command is doing something different". Did you look at the code for the ash command - like I did, before I responded the first time? I didn't think so.
Runtime Library.java:
Code:
String monsterName = FaxBotDatabase.getFaxbotMonsterName( monster.getName() );
String command = FaxBotDatabase.getFaxbotCommand( monster.getName() );
monster.getName for $monster[completely different spider] is "completely different spider". Duh.
FaxBotDatabase.java:
Code:
private static final Map<String, String> monsterByActualName = new HashMap<String, String>();
private static final Map<String, String> commandByActualName = new HashMap<String, String>();
...
// Build actual name / command lookup
FaxBotDatabase.monsterByActualName.put( monster.actualName, monster.name );
FaxBotDatabase.commandByActualName.put( monster.actualName, monster.command );
...
public static final String getFaxbotMonsterName( String actualName )
{
return FaxBotDatabase.monsterByActualName.get( actualName );
}
public static final String getFaxbotCommand( String actualName )
{
return FaxBotDatabase.commandByActualName.get( actualName );
}
So, it is looking up strings in hash tables using the key "completely different spider" - and finding them.
Where did it get the strings that it used as the hash table key?
The "name" and "command" field are what you saw printed. But, what is that "actualname" field? Here is how we make a Monster object:
Code:
private Monster getMonster( Element el )
{
String monster = getTextValue( el, "name" );
String actualMonster = getTextValue( el, "actual_name" );
String command = getTextValue( el, "command" );
String category = getTextValue( el, "category" );
return new Monster( monster, actualMonster, command, category );
}
Ah ha. There is an "actual_name" field for each monster in the XML file. So, what is in the actual FaxBot config file?
Code:
<monsterdata>
<name>Big Creepy Spider</name>
<actual_name>completely different spider</actual_name>
<command>spider</command>
<category>Sorceress's Quest</category>
</monsterdata>
Isn't that interesting? FaxBot has a "completely different spider" in a fax, which it advertises as a "Big Creepy Spider", available via the "spider" command. For some reason, it is in the "Sorceress's Quest" category - because the spider web is a tower item, I assume, and it doesn't matter which spider you get it from.
If I do cli_execute("faxbot spider"); the result is a photocopied monster in my inventory with this description:
This is a sheet of copier paper with a grainy, blurry likeness of a completely different spider on it.
Exactly.
As I said, talk to weas about this; KoLmafia is treating FaxBot's XML config file exactly as intended - and the "completely different spider" (actual_name) is advertised as a "Big Creepy Spider" (name) obtainable via "spider" (command).
This continues to be "not a (KoLmafia) bug".