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<!-- monsterid: 2486 -->
OK. Perhaps it really wants the entity encoding.
Back in chat:
Code:
Veracity: pumpkin spice wraith<!-- monsterid: 2486 -->
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<!-- monsterid: 184 -->
Astronomer<!-- monsterid: 354 -->
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<!-- monsterid: 2486 -->]
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<!-- monsterid: 2486 -->
[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&lt;!-- monsterid: 184 --&gt;</name>
<actual_name>Astronomer&lt;!-- monsterid: 184 --&gt;</actual_name>
<command>Astronomer&lt;!-- monsterid: 184 --&gt;</command>
<category>None</category>
</monsterdata>
<monsterdata>
<name>Astronomer&lt;!-- monsterid: 354 --&gt;</name>
<actual_name>Astronomer&lt;!-- monsterid: 354 --&gt;</actual_name>
<command>Astronomer&lt;!-- monsterid: 354 --&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>