Feature - Implemented Check incoming kmails for attached items

antimarty

Member
Mafia doesn't put kmailed items into inventory; I get burned by this once in a while. Yesterday, somebody looking for help in a couple of dreadsylvania instances kmailed me a pair of skeleton keys; my dreadsylvania script wasted one collecting freddies because it thought I had no keys in inventory, and accidentally unlocked something.

So, request: when mafia sees the you've-got-mail event notice from the system, check the incoming kmail for attached items.
 

fronobulax

Developer
Staff member

lostcalpolydude

Developer
Staff member
Checking the kmail for attachments would be the hard way to do it. Refreshing inventory is a lot easier, and much less of a server load (I think) than it used to be now that api.php can be used. That probably removes most of the argument against this.

This request assumes the user is in chat to get the notification immediately. Otherwise, the notification might show up after inventory has been refreshed for another reason, such as logging in.
 

fronobulax

Developer
Staff member
Checking the kmail for attachments would be the hard way to do it. Refreshing inventory is a lot easier, and much less of a server load (I think) than it used to be now that api.php can be used. That probably removes most of the argument against this.

This request assumes the user is in chat to get the notification immediately. Otherwise, the notification might show up after inventory has been refreshed for another reason, such as logging in.

"assumes the character is in chat" is probably another reason why it was not done. I have an illiterate character to thwart such assumptions :)

I'm beginning to recall suggestion/discussion that this not be implemented because there were no "push" notifications of mail arrival without chat.

I'm reluctant to require chat on general principles, but it is true adding some kind of inventory refresh would not change my experience.

It is a source of mild frustration that faxes do not respond success or failure correctly unless a chat window is open when they are requested. Perhaps this request would spur development of the ability for KoLmafia to silently open a chat channel (i.e. no GUI) so notifications can be responded to.

I stopped having chat windows open by default and/or at startup. I had some system instability - specifically mafia would appear to freeze and not display the main GUI - and my much atrophied debugging skills suggested a threading issue involving the chat thread. The problem was frequent but not reliably repeatable and it has not reoccurred since I stopped opening chat at startup.

If someone wanted this badly enough and it was not baked into KoLmafia, would a chatbot be a workaround?

I'm just thinking out loud. I'm not necessarily opposed but I am not motivated to implement it myself, either.
 

Magus_Prime

Well-known member
Veracity already does something like this in her meatfarming script. It silently opens a chat window to handle a fax request.
 

lostcalpolydude

Developer
Staff member
It is a source of mild frustration that faxes do not respond success or failure correctly unless a chat window is open when they are requested. Perhaps this request would spur development of the ability for KoLmafia to silently open a chat channel (i.e. no GUI) so notifications can be responded to.

If someone normally uses chat but chooses not to for a session, it would lead to PMs mysteriously never showing up. For people that never use chat, others might expect them to receive PMs because KoL now reports that they are in chat. So auto-entering chat as default behavior is a bad idea.
 

fronobulax

Developer
Staff member
Veracity already does something like this in her meatfarming script. It silently opens a chat window to handle a fax request.

She uses the cli command "chat" which will switch to a chat tab or window OR open a chat window. But if the script opens a chat window, it does not - AFAIK - close the window when done which was part of my definition of "silent". My concern is with an opened chat window that is not actually being used by me. My personal urban myth is that caused me some problems, which disappeared when chat was closed as soon as possible.
 
I didn't know you could do that with chat.

I use manual checking upon fax failure and some sort of horrible loop to avoid the chat requirement in my scripts. It can take an extra minute but has worked without requiring any chat. I highly approve of illiteracy.
 

Darzil

Developer
r18420 updates inventory via API if you see a message arrive in chat.
If you aren't in chat, tough, we have no idea !
 
Top