Code Monkey home page Code Monkey logo

ca.taffer.mm-rolly's Introduction

Moved

This repo is has been replaced by: https://codeberg.org/Taffer/ca.taffer.mm-rolly

Logo of the GiveUpGitHub campaign

Everything in this repo should be considered out of date.

Rolly

Dice rolling plugin for Mattermost.

Dice icon

Inspired by moussetc/mattermost-plugin-dice-roller and DiceBot for Slack.

Note that I don't actually know Go, so this could be rough...

Rolling Dice

Support "any" reasonable dice rolling request:

  • xdy or xDy to roll a y sided die x times
  • modifiers: xdy+z (supported modifiers: +, -, x or *, /)
  • exploding dice (for every max value, roll and add): xdy!
  • xd% - same as xd100
  • xdF - roll FUDGE dice
  • xdy<z - discards the lowest z rolls (so 4d6<1 would return a value between 3 and 18)
  • xdy>z - keeps the best z rolls (so 4d6>1 would return a value between 1 and 6)

If x isn't specified, it defaults to 1. If y is less than 2, it defaults to 2. If you specify a modifier, you must also specify a z value.

Nerd combos:

  • dnd - same as 3d6 six times (standard D&D or Pathfinder)
  • dnd+ - same as 4d6<1 six times (common house rule for D&D or Pathfinder)
  • open - roll d%, if it's >= 95, roll again and add, repeating if necessary

Rolly's dnd+ combo

Number of dice per roll will be limited to 100 so malicious users can't flood the channel with dice output.

Number of rolls per request (/roll 1d6 2d6 ... n) will be limited to 10 so malicious users can't flood the channel with dice output.

Changes Since 1.0

  • Cosmetic changes to the output.

Credits

ca.taffer.mm-rolly's People

Contributors

taffer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ca.taffer.mm-rolly's Issues

/roll 3d6+3 ... not valid die code ...

I get the following message ... '3d6+3' is not a valid die code See /roll help for examples.

Suggestions?

I just installed the latest version of Mattermost ...

Mattermost Version: 5.15.0
Database Schema Version: 5.15.0
Database: postgres

Make it do something.

Start implementing something.

  • Add code to handle a /roll command that just echoes its arguments.

Make `<` modifier work for values other than 1.

Currently only <1 is supported (technically, the modifier value is ignore); numbers up to (number of dice minus one) should work.

  • 3d6<1 - discard worst die
  • 3d6<2 - discard worst two dice
  • 3d6<3 or higher - nope

Plugin failed to start

Greetings, new issue here.

I downloaded v1.1 release and uploaded via the System Console. Upload is good, but when I enabled the plugin I get the following error ...

"This plugin failed to start. Check your system logs for errors."

In order I tried the following ... disabled the plugin and re-enabled it; no change. I restarted the server; no change. Removed the plugin, re-uploaded it, refreshed the page, enabled the plugin; no change.

Suggestions?

Screen Shot 2019-09-28 at 11 57 05 AM

Add "exploding" modifier.

Add an "exploding" modifier for !. When the max value for a die is rolled, roll again and add.

  • 3d6! - roll 3d6, if any sixes turn up, roll and add; repeat for any sixes.

Refactor for testing.

The ExecuteCommand() callback is monolithic and not very testable. Refactor everything so it can be tested.

Add "best" modifier.

Add a "best" modifier for >, similar to <.

  • 2d6>1 - return best roll of 2d6
  • 4d6>3 - same as 4d6<1, best three out of four 1d6 rolls

A few minor bugs

Bugs noticed at the office:

  • If a user has no nickname, it writes "throws the dice..." without a name.
  • "I have no idea what to do with", change to "I have no idea what to do with this:" then show the failed roll without quotes.
  • Multiple rolls need to be split up in the output. A "/roll dnd dnd+" resulted in:

๐ŸŽฒ D&D standard:
3d6 [1 2 4] = 7
3d6 [1 2 5] = 8
3d6 [3 4 6] = 13
3d6 [3 3 6] = 12
3d6 [1 5 5] = 11
3d6 [2 2 4] = 8D&D variant:
4d6<1 [2 2 3 4] = 9
4d6<1 [3 5 5 5] = 15
4d6<1 [4 5 5 6] = 16
4d6<1 [1 5 5 6] = 16
4d6<1 [1 2 3 3] = 8
4d6<1 [1 1 5 6] = 12

Customize the template.

All the code is currently just the Mattermost plugin template. Make it suitable for this plugin.

  • Plugin name
  • Icon
  • Etc.

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.