Coder Social home page Coder Social logo

dexpiper / tabletopdicebot Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 54 KB

Telegram bot for rolling dices in RPG-like games. Supports advanced features: multiple dices and dice-types in one roll command, positive and negative modifiers and roll descriptions. Also user can create chars, add custom modifiers and use them in rolls, make custom predefined rolls.

License: MIT License

Python 72.54% Procfile 0.05% Jinja 27.41%
rolling-dices rpg telegram roll-descriptions telegram-bot dnd dungeons-and-dragons dicebot dice-roller tabletop tabletop-rpgs tabletop-games dice-rolls roleplaying roleplaying-game dice dice-game dnd-tools

tabletopdicebot's Introduction

Tabletop DiceBot

Telegram bot for rolling dices in RPG-like games with some handy advanced features. Currently available at https://t.me/tabletop_dice_bot, deployed at Heroku.

Table of contents

Introduction

In spite of dozens dice bot exist in Telegram, few of them are suitable for online implementation of classic RPG-games that heavily depend on dice rolls. First of all, user (and Game Master) wants to roll a bunch of dices, not only 6-side cubes (d6), but also a 4-side, 8-side, 10-side etc., and such requirement cuts off the majority of simple Telegram dicebots. Furthermore, one wants to roll a handful of distinct dices and dicetypes sometimes, and get the sum. Additionally, it is useful to add some number to the result or remove some fine (positive or negative modifiers).

All this issues are taken in account in this bot. It supports multiple rolls with multiple dices and dicetypes, modifiers (+ n and - n) and roll descriptions.

New version of the bot has been presented in June, 2022. Now it can store your character attributes and modifiers and use them in rolls. Also pre-defined rolls supported.

Basic example: /roll 3d20 d4 + 2 Dexterity

🧝Ann rolled 3d20 d4 + 2 Dexterity:

    🎲 rolling 3d20:
    ⚑️20 + 9 + 5 = 34

    🎲 rolling 1d4:
    3 = 3

βž• 2
πŸ“‹ Result: 39     -----> Dexterity

Advanced example: /roll 2d20 d6 + $STR - 2

🧝Tall rolled 2d20 d6 + $STR - 2:

    🎲 rolling 2d20:
    2 + 7 = 9

    🎲 rolling 1d6:
    4 = 4

βš™οΈ Strength 5
βž– 2
πŸ“‹ Result: 16

Technologies and libraries

Project is created with:

Basic command syntax

Command Syntax:

/roll {dice} {dice} {dice}... +/- {modifier} Description,

where dice has a classic form like 2d20: the first number is the number of dices (up to 99), and the second - the amount of sides (up to 999).

Basic single dice rolls can be performed with /roll d20 or simple /roll20, number of dices (aka 1d20) is optional. d4, d6, d8, d10, d12, d20 supported as basic dices for /roll{dice} commands.

Addition modifiers can be positive or negative: /roll d20 - 2, /roll d20 + 2

Descriptions should be added in the end of the command string after a space character. A description should be a single word or multiple words separated with any char from the list: @*&%$#:. "?" and "!" also accepted.

Advanced features

With bot you can create a character, add your custom modifiers and use them in your throws. No need to look to your charsheet for Dexterity modifier of your char every time you roll a throw using it - just put it like:

/roll 2d20 + $DEX

Also you can save your time for rolling the same formula. Just save your custom throw and use it like:

/rollme Dexterity - 2

Chars

To create a char, use /createchar command + the name of your char. To delete a char, use /deletechar. After char created, you can check your charlist with /chars command.

🧝 Name: Ann 

    Throws:

    Attributes:

🧝 Name: Tall  β™Ÿ 

    Throws:
            🎲 MyThrow: 2d20 + 1d8 + $DEX -2

    Attributes:
            βš™οΈ Strength Alias:  $STR  Value: 20 Modifier: 5

Chess emoji indicates the active char. You can use only your active char's attributes and modifiers. To change active char, use /activechar command.

Modifiers

To create a modifier for your char, use /addmod command.

The command takes 3 or 4 arguments:

* NameOfAttribute -- single world, "-" and "_" allowed. Max 25 characters long, should not start with a digit.
* Alias -- single word, uppercase, "-" and "_" allowed. Max 8 characters long, should not start with a digit.
* Value -- integer. Would not be used in your throws directly.
* Modifier, optional -- integer. By default, it is computed from value with the DnD5 rule set (6 -> -2; 12 -> 1;, 25 -> 7, 30 -> 10 etc.). If you would like to apply other rules, you may specify your modifier directly from the command.

Arguments must be separated with spaces.

You may excess the modifiers:

πŸ’² by alias (like $STR) πŸ“Ž by attribute name (like &NameOfAttribute).

Some examples: /roll 2d20 + 1d6 + $STR - 2 /roll 1d12 + 1d4 + &Dexterity + 1

Custom throws

/createroll - use to create new throws (custom rolls) for your character /rollme - to roll your custom throws

  • First argument should be the name of your throw. Single word, "-" and "_" are allowed. You would type your throw name after /rollme command, so please be advised to make it short and distinguishable, so you can easily use it in your game session.
  • After your argument goes your roll formula. You may use the common syntax as for the /roll command, inculding your modifiers' aliases (like $DEX).

πŸ“Ž Note that you would have access only for custom rolls defined for your active character.

You can delete your custom throws with /deleteroll.

Contribution

Dear friends, you are welcome to contribute for this project. Just create a fork and make a pull request.

Chat group

Telegram chat group: https://t.me/dicebot_community

  • Chat, suggestions, bugs and maintenance

tabletopdicebot's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tabletopdicebot's Issues

Paid help

The result of the telegram dice thrown out shows that it can be preset in advance?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.