Some thoughts on faxbots

fronobulax

Developer
Staff member
Cheesefax has a last login of October 10, 2023. Is it time to retire Cheesefax from the list of available faxbots?

Easyfax does not work well via the GUI. (See here.) That is enough for me to suspend it until it works. Does anyone else share my opinion or do I need to let it go?

I use the fax network to collect missing factoids. Now that IO have gotten everything in the network what I want is a way to tell when there might be something new in the network. My script that iterates over monsters and looks for ones that are missing manual entries and in the network will tell me there is nothing of interest but it takes time and has server hits. If I could detect changes in the fax files then I would only run it when they might have changed.

If I don't have access to file system data then I could iterate over monsters, use can_faxbot and compute a hash on the results. I can just store the hash and only need to check the manual if something changes. But iterating over monsters can be noticeably slow.

I could tweak mafia to collect metadata about the faxbot files, perhaps hash the contents and set something that indicates that the files files just downloaded are changed compared to the versions they replaced.

Am I overthinking this? Is there something already there I could/should use? If I introduce _faxNetworkChanged or something similar would anyone else use it?
 
I don't know exactly how the Mafia faxbot support works, but I believe that Mafia gets an xml file from the faxbot that list all monsters available.
See 'KOLMafia\data\easyfax.xml' that should be in your data folder.

You should be able to iterate by parsing this for all faxbots without server hits.
 
I don't know exactly how the Mafia faxbot support works, but I believe that Mafia gets an xml file from the faxbot that list all monsters available.
See 'KOLMafia\data\easyfax.xml' that should be in your data folder.

You should be able to iterate by parsing this for all faxbots without server hits.

I probably had embedded assumptions.

Mafia reads a data file, faxbots.txt. That file is under mafia control. It is only changed/edited by commit to the mafia repository or by someone who unpacks and rebuilds the mafia jar file locally.

The file contains a short name for a faxbot and a link to an xml file that has a list of what the faxbot is offering.

So one question is whether cheesfax should be removed from faxbots.txt.

The various faxbot xml files include a monster name and a command to send the faxbot that will fetch the monster. As documented in the link in the OP using the name and command provided by faxbot does not actually result in a fax. So until the provider fixes the file you cannot use the KoLmafia GUI to get a fax from easyfax. Does that bother anyone else?

The server hits I am trying to avoid are those associated with refreshing Manuel. If the fax files have not changed then I have no reason to refresh Manuel.

If json were easier in ash I could parse the faxbot files as fetched and placed in data/. But if I have to deal with JavaScript to do the parsing then my solution would be implemented more robustly in Java as part of mafia.

If there are two versions of a file, Before and After, then the question becomes whether they are the same or different? Sometimes file system metadata can be used to get a good enough answer - size, created timestamp and last modified timestamp are usually good indicators. If those items are the same for Before and After then it is reasonable to assume the files are identical. Since the content doesn't matter, reading each file as a byte stream and computing some kind of hash should also be "good enough". If Before and After have the same hash value then they are probably the same. But with the tools in my toolbox getting the metadata or getting a byte stream are easier and more straightforward as a Java implementation in mafia. Implicit in my question are the questions - is anyone going to object if I add something to mafia? and is somebody going to tell me that they can do this in three lines of JavaScript?

Thank you.
 
Back
Top