Bot::Backbone::Service::OFun::Dice - Tools for rolling dice, flipping coins, choosing, and shuffling
version 0.142230
# in your bot config service dice => ( service => 'OFun::Dice', ); dispatcher chatroom => as { redispatch_to 'dice'; }; # in chat alice> !roll bot> Rolled 4 alice> !roll 2d4+3 bot> Rolled 7 alice> !flip bot> Flipped 1 times: heads alice> !flip 4 bot> Flipped 4 times: tails, tails, tails, heads alice> !choose 2 alice bob chuck dick ed bot> I choose ed, chuck alice> !choose alice bob chuck dick ed bot> I choose dick alice> !shuffle alice bob chuck dick ed bot> I choose bob, alice, ed, dick, chuck
This service provides a number of tools related to randomly generating numbers, coin flips, choosing items, etc.
!roll !roll 2d6 !roll 4d20+12
Generates a dice roll. If no arguments are given, it's the same as rolling a single 6-sided die. If you specify dice notation, it will roll the dice specified.
!flip !flip 5
Flips a coin or several. If no arguments are given, it will flip a single coin and report the outcome. If a number is given, it will flip that many coins.
!choose 3 a b c d e !choose a b c d e
Choose 1 or more items from a list. If the first argument is a number, it will choose that many items from the list. If the first argument is not a number, it will choose a single item.
!shuffle a b c d e
This is identical to:
!choose 5 a b c d e
It choose all items, but shuffles them in the process.
Implements the !roll and !flip commands.
!roll
!flip
Implements the !flip command by passing "d2" as the dice notation to "roll_dice".
Implements the !choose and !shuffle commands.
!choose
!shuffle
Implements the !shuffle command by counting the number of arguments and asking "choose_n" to pick that many items.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
This software is copyright (c) 2014 by Qubling Software LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Bot::Backbone::Service::OFun, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::Backbone::Service::OFun
CPAN shell
perl -MCPAN -e shell install Bot::Backbone::Service::OFun
For more information on module installation, please visit the detailed CPAN module installation guide.