buffbot command - how does it work?

Sandiman

Member
I've decided to try my hand at running a buffbot for my clan. I'll probably customize the bot later with a script, but right now I'm going for basics: the `buffbot` CLI command.

Here is my current understanding of the `buffbot` command:

- As described by the help function, "buffbot number - run buffbot for number iterations." I assume this means it will cast 'number' buffs and then exit, but I could be wrong.

- The buffbot is configured by editing buffs/[username].txt and buffs/[username].xml; the XML file is used as a human-readable version of the .txt file and as a way of informing mafia of the current configuration of published bots. Both files can be edited using mafia's internal configuration utility People -> Run a Buffbot.

- Once running, the buffbot will parse any new kmail messages for meat. If the meat received corresponds to one of the meat amounts given in the configuration files, it will attempt to cast the corresponding buff on the player that sent the message. I don't know what happens if it is unable to do due to restrictions on the player to be buffed, but I believe that MP restrictions are handled as described below.

- The buffbot auto-restores its own MP as necessary, using whatever restorers are on hand. MMJs seem to be popular amongst buffbot authors, as they're the most cost-effective way of restoring MP, but there isn't any way of telling the buffbot to prefer a particular restorer.

-------------------------------------------

That's my understanding of how the native buffbot command works. With that in mind, I have the following questions:

1. What happens at rollover? Does mafia know that rollover is coming and log the player out (calling any logout script), or does it simply exit once it is determined that rollover has occurred?

2. Under what circumstances will the `buffbot n` command exit without casting n buffs?

-------------------------------------------

If anyone can either answer a question or correct my "understanding," I'd appreciate it. Thanks!
 

jasonharper

Developer
The parameter is the number of times it checks kmail. There's a one minute delay after each check, so "buffbot 60" should run for at least an hour (probably longer, due to the time spent actually performing buffs). It can stop early if it runs out of restores - it will use anything you've configured as a MP restorative, but will only automatically buy MMJs (or phonics downs, if you don't have access to MMJ).

There appears to be no special handling for rollover. Perhaps it will start trying to log back in after hitting the "down for maintenance" message, I'm not really sure.
 
Top