chatbotScript and Faxbot

I am... horribly perplexed by some behavior I am seeing.

I have a bot. This bot handles faxbot requests for our clan. (he accepts a (partial) monster name and turns it into the appropriate faxbot command).

Something is not working out properly, but in a way I cannot being to grasp.

My first few lines of code are
Code:
void main(string sender, string message, string channel){
 if (sender=="faxbot") {
  chat_private(get_property("_lastFax"),message);
  return;
 }
 if (sender=="wangbot") return;

So, as you can see... nothing more of the code should ever execute when faxbot pms us.

Further, the word "help" appears once in the entire source, and not as part of a string variable nor inside a chat_private();

But, from the looks of my chat window...
[00:02] ominous buffer: help
[00:02] FaxBot: I do not understand your request. For help, look at my Display Case or /w FaxBot help

Which suggests that my bot has become self aware and decided to respond to the PM by his own free will.

Any ideas as to what is going on?
 

lostcalpolydude

Developer
Staff member
That is the response faxbot sends to any message it doesn't understand. to_monster("help") gives Hellseal pup, which probably got forwarded to faxbot. I don't think faxbot has that monster, so it would have replied with the message you see there.
 

Winterbay

Active member
It does have hellseal pups. I used that when doing my last basement run as a SC to level up quickly at the volcano.
 
That's just it... I'm not sending "help" or "hellseal pup".

I (myself, personally) sent "fax sex" to OB.
He then attempted to find a suitable faxbot command. Not having one, he defaulted to sending the message straight as "sex" to faxbot.
Faxbot, enraged (I like bots to have feelings) sent back his stardard error. To which my bot replied (even the code strictly doesn't support the possibility of this happening) with "help".
 

Winterbay

Active member
It's interesting because him sending "help" should've triggered FaxBot's help-message shouldn't it? I mean it states "/w Faxbot help" and that is what seems to have been sent, no? So why did it get the standard message back again?
Or am I reading that in the wrong order?
 
When a chatbot script acts on something and responds to the user in process, the response appears before the trigger.
So the entire string is the trigger, and "help" is my response.

Now, I know mafia has some buggy behavior when it comes to trying to use /w and other commands in the normal chat interface... but I see no reason why an incoming pm (and I've tested this manually and it doesn't happen... just for faxbot) would cause the "/w Faxbot help" to just sort of... magically happen.
 

slyz

Developer
When I do this from the gCLI:
Code:
ash chat_private("faxbot", "I do not understand your request. For help, look at my Display Case or /w FaxBot help");
I only see this in the FaxBot tab of my chat window:
Code:
[11:35] slyz: help
[11:35] [COLOR="green"]New message received from FaxBot[/COLOR]

The same happens if I simply paste the message in the chat window.

In your case, whatever get_property("_lastFax") returns, Mafia tries to send the "I do not understand your request. For help, look at my Display Case or /w FaxBot help" message, but only the "/w FaxBot help" is passed on in the process.

I don't know if it's KoL doing that (that would be surprising since FaxBot manages to send the exact same message to people instead of PMing "help" to itself), or if Mafia is somehow using only the "/w FaxBot help" bit of the message.

EDIT: it's Mafia, since I can pm the whole message to faxbot through the Relay Browser chat pane.
 
Last edited:
Oookay.
That makes sense. I knew mafia would hijack a command in the actual chat window, but I figured chat_private (having a field for a name) would be safe from that grab. Stupid mafia.
 

slyz

Developer
I posted a Feature Request (although it should probably be a Bug Report since that behavior doesn't look like it's intended).
 
Top