Feature Speculation for faxbot()

zarqon

Well-known member
I've recently discovered the faxbot() ASH command, which actually accepts a monster as a parameter -- it's fabulous! We don't need to keep a list anymore of what the actual name is vs. the name we're supposed to send to Faxbot (or the others, now).

I'm in the middle of writing a relay factoid manager, and find myself wishing I could test the faxability of the various monsters for which factoids are yet lacking -- to provide a quick link to fax the monster should you so desire. However, calling faxbot() on each monster would be a horrible way to do this, because although it would return false for unavailable monsters (desired), it would actually request one fax per possible monster (undesired). Likewise, keeping a manual list of available monsters seems silly now that the list is a) flexible, and b) mafia is already building this list for faxbot().

I could see this being implemented either as a new ASH command or as an additional parameter in faxbot(). The new command could be named something like is_faxbottable( monster ) -- which in addition to having an awesome name is quite straightforward. I suppose a less comical name like can_faxbot() would also work. Or, an optional boolean flag for faxbot a la faxbot( monster m, [ boolean justcheckdontactuallyfax ] ). In either case, the function would simply return true if one of the online faxbots claimed to have the monster available.

tl;dr: It would be nice to use mafia's faxbot savvy to see if a monster could be faxed without actually faxing it.
 
So if you really want to know if a monster can be faxed, you want to make sure the bot is online. If you're doing this check for hundreds of monsters, you don't want to check if the bot is online hundreds of times.

Just brainstorming about how this would be implemented.
 
r14605 adds can_faxbot( monster )

Edit - Hmm, you're right. Maybe availability could be cached for a while?
 
The script would be checking can_faxbot() on each monster for which factoids are missing, which could easily be over a thousand for faxing newbies. When making this request I called faxbot() several times on known unfaxable monsters to see if the list was regenerated each time. When it wasn't, I (apparently mistakenly) assumed bot availability was also cached.

I'll hold off on releasing the script until I can be sure it won't abuse the server. Part of the reason for my writing this script was that the script I used to use (turing's excellent missingManuel) scrapes all the Manuel pages each time it's run, and I wanted to avoid all those hits for cases where no factoids were gained between runs. Then I realized that since BatBrain already tracks factoid gain, I could tie the tracking in there too and have a super quick-loading script that only needs to hit Manuel if 1) BatBrain sees a factoid gained but can't find the monster in the factoid data file (fairly rare), or 2) the user triggers a data refresh manually. Then I realized I could also add factoid information to BatMan RE's Adventure Again box! And its semirare helper! I may have gone a little mad.
 
Temporary workaround which should let you release the script, as I don't have time for a proper fix. can_faxbot() doesn't check if bot is online in r14612, so won't abuse the server.
 
Back
Top