Responding to Clan Chat

acsheets

New member
First, I apologize if this has been covered in another thread. I have looked and could not find anything on this topic.

I am working on a small clanbot. This is mainly a project to teach myself the scripting used within mafia. I was wondering if it was possible to respond to commands sent via clan chat (not pm). At the moment I've been playing with the pm trigger and was hoping to expand. Anything that points me in the right direction would be greatly appreciated.
 

Spiny

Member
From all that I've heard in regards to KoL bots that have the capability to chat... PyKoL is more apt than something done in mafia.
 

acsheets

New member
Thats what I had mainly read. It was actually earlier today that I stumbled upon chat_clan() and it peaked my interest. Finding that function got my gears turning, wondering if there was a way to parse the clan chat.
I was more interested in it being able to be given commands via clan chat.
 

Grotfang

Developer
chat_clan(string) is useful at posting messages into chat. It's a function I have used regularly. Unless Alhifar has updated his cagebot script, be careful using it. Some of the functions no longer exist.

Using mafia to respond to messages posted in clan chat is not something I believe is possible using its native abilities. What is it exactly you are wanting it to be able to do?
 

mredge73

Member
You cannot parse the chat box, mafia doesn't let you do that. I don't know the argument against parsing chat but I am sure there is a reason.

You are limited to responding to PM and can use chat_clan() or chat_private() to send messages through chat to clannies only. Unfortunately chat_reply() was removed for some reason, it allowed you to reply to anyone regardless if they were in your clan or not. I am still unsure why that was removed, it made building chat bots much easier.
 

acsheets

New member
Thank you all for the help. This basically lets me stop barking up the wrong tree and focus in on what I can do. Thanks to all.
 

Grotfang

Developer
I am still unsure why [chat_reply()] was removed, it made building chat bots much easier.

I don't buy that. I couldn't find much difference between chat_reply( string ) and chat_private( string , string )

In a chatbot, convention means main() starts with main( sender , message ), so I just swap all cases where I might have used chat_reply( string ) with chat_private( sender , string ). Exactly the same effect.

What I would like to see changed would be effective queuing of different commands. For example, if a chatbot is acting on a message and receives a new one, it will pause the original, start and complete the new, then return to finish the original.

This is not good behaviour, and is something I am currently trying to fix (slowly, though - as I don't have a huge amount of free time right now).
 
Top