Friday, May 18, 2012

MF0 Dice Roller

New to the channel is mf0bot, a Python bot I've created using twisted.words and a large amount of code from Jokbot. Currently, it has rudimentary rolling capabilities for MF0. You can ask it for help too: "mf0bot: help" or just "!help".

There isn't much error handling currently, but it works like this. You roll the color of the dice you want by using their upper or lower case beginning letter. In the case of MF0, that means rbgywRG. Lower case are d6s and uppercase letters are d8s. Example syntax:

!mf0 rrRbbGww - Rolls 2d6 red, 1d8 red, 2d6 blue, 1d6 Green, and 2d6 white

And returns something like below (changes coming):

mf0bot> Rolls for rrRbbGww: Red (Attack) - [1, 4, 5], Blue (Defense) - [3, 3], Yellow (Spot) - [0], Green (Move) - [4], Whites (Wilds) - [5, 3]

It'll also accept:

mf0bot: mf0 rrRRRRgbyww

Currently, there's no check in place to see if the dice you roll are indeed valid, so remember to add your white dice and not feed it multiple Gs, etc.

It will however fail if you enter anything in the first field that isn't a MF0 dice. You CAN enter anything else at all that you want after that, the bot will ignore it.

!mf0 bgGyyww - I don't attack, I just jump around and spot stuff

I will post any changes to the bot here in the future, and the source code is available, if you want to scream and run in terror at my Pythonic stumblings.

No comments:

Post a Comment