Discord Dice App

Lord of Chaos

Elder Member
Supporter
Here is an installer for a Discord Dice App. After installing it, a shortcut will be created on your desktop. The first time you run it, it will ask for your discord bot token. It will store these in config.json in the install directory in case you need to change them.


CHANGE LOG 3.0.0:


+ Added support for FFG Star Wars. They are used (sw*) where * is a list of dice (b: boost, s: setback, a: ability, d: difficulty, p: proficiency, c: challenge, f: force). For instance, (swbbd) would roll two Boost dice and one Difficulty die, displaying the totals in chat


+ Added support for multiple types of basic dice at once. For instance, (1d10+1d6+1d4) would roll a d10, d6, and d4 in that order and display the results


+ The dice roller now uses bots instead of users. Simply tell it your bot token instead of your login credentials, and make sure your bot is invited to the channel. This is both more secure and more stable


+ The bot will remember which channels it is Started and which it is Stopped on even when restarted.


Download Link: MEGA


While it is running, any channel with that bot invited to it can run the !startDice command to start listening, or the !stopDice command to stop listening. While the bot is listening, you can enter any roll commands and it will display them in the chat channel.


This app has support for the following systems:


Generic Dice


Exalted


New World of Darkness


Legend of the Five Rings


Shadowrun


Fudge


One Ring


FFG Star Wars


If you want additional dice systems added, either contact me or submit a pull request here.


Basic Dice:


(XdY+Z)


Exalted:


(Xe)


optional parameters:

  • XeY adds the double-Y property, default 10
  • rZ rerolls all values in the list of Z (treats 0 as 10), defaults to none
  • tA sets target number to N, default 7
  • cB counts the number of times result B appears, listing it in parentheses. Defaults to all successful dice
  • ! creates a cascading reroll of all successes
  • +S adds S automatic successes


World of Darkness:


(XwY+Z) rolls X dice, rerolling all values Y or higher (defaults to 10), and adds Z successes


Legend of the Five Rings:


(XkY+Z) Rolls X dice, keeping the highest Y. Unless another value is provided, 10s will explode. Adds Z to the final value

  • eA all values greater than or equal to A will explode. Defaults to 10
  • rB any dice that roll B will be rerolled a single time


Shadowrun:


(Xs+Y) Rolls X dice, counting all dice that show a 5 or 6. Adds Y hits to the final total

  • e adding e to the end will add an additional die for every 6 rolled


Fudge:


(fudge) Rolls four fudge dice, and adds up the total


Additionally, this roller includes an initiative tracker. While it is designed for Exalted 3rd Edition, and most of its features are only useful for that, it can also be used to track any simple initiative system by just ignoring the other features.


The tracker starts empty. Anyone in the channel can add actors, or modify existing ones. The commands are below, any parameter in ALL CAPS is required, and should be replaced by the appropriate value. Any parameter [iN BRACKETS] is optional. Each command must be prefixed with ! (for example: !next or !list). Anywhere it requires a trait, init can be substituted for initiative to make for easier typing.


Commands:


reset - Resets the initiative tracker by deleting all actors in the list


next - Displays the actor with the highest initiative who has not acted yet this turn. If motes are tracked, will add 5 to their current pool


add NAME [iNITIATIVE] [MAXMOTES] - Adds an actor named NAME to the list. If provided, their initiative and maximum motes will also be set. When added, motes will equal maxMotes


list - Lists all actors currently tracked. Their initiative scores and mote totals (if provided) will also be displayed. Whoever's turn it is currently will be bolded, while actors who have already gone will be italicized.


check NAME - Lists the information about the actor named NAME


set NAME TRAIT VALUE - Sets NAME's TRAIT to equal VALUE (e.g. !set LordOfChaos init 5 will set LordOfChaos's initiative to be 5, regardless of its prior value)


modify NAME TRAIT AMOUNT - Modify NAME's TRAIT by AMOUNT. Amount can be negative to subtract


withering ATTACKER DEFENDER AMOUNT - Subtracts AMOUNT initiative from DEFENDER, and adds AMOUNT+1 to ATTACKER. If this reduces the defender to 0 or fewer initiative, the attacker gains 5 additional initiative.


delete NAME - Removes NAME from the tracker


undo - Undoes the previous command, if it changed anything (i.e. !delete LordOfChaos will be undone, but not !list)


redo - Redoes the last undone command. Both Undo and Redo can be called multiple times


help - Displays a list of commands
 
Last edited by a moderator:
SUPPORT:


The dice app itself (ran via node.js) is confirmed to work on the following:


Windows


Mac


Linux


The Installer provided in the link above only works on Windows at the moment
 
Wow, nicely done! Does it work with the website as well, or only with the apps?
 
works with the website as well. It does not work on mobile, but if someone else is running it a mobile user can still send commands
 
Yes, it is definitely possible. Why would you need this, though? Isn't () just as easy as /roll? Or is there some other use case?
 
Yeh its probably just as easy, its more that me, and my group are used to the other way but the Dice bot we used in our IRC channel cant be used on Discord, so when we decided to move to discord w ehoped there would be a Bot with the same prefix and such^^
 
Oh hey, neat! This is seriously useful- I was just planning on RPing in Discord with some peeps who might be interested in a dice roll mechanic. Thanks a ton.
 
@Lord of Chaos Heyyo. Just downloaded this, and not having much luck getting it working. Any chance I could get help with it? Can contact me on Discord, or if another method would be better, lemme know.
 
Last edited by a moderator:
@Lord of Chaos


Question for you - will the dice roller be updated for the new guidelines that were released with the April 8th update? Apparently we need to stop using accounts and switch them to apps with tokens instead of log in details, and the conversion has to happen by May 1st or they start harassing people. It sounds like it's just a simple switch in the code from having it use the username/password of an extra account to using the new app setting bot tokens, but frankly, the whole mess is a bit vague if you look at the OAuth page.


I figured I'd ask if there'd be a formal update before I started hacking about with things. My group likes the programme and we'd hate to lose it over the new API system.


Thanks for your time in advance!
 
Last edited by a moderator:
There's more information at the official announcement, which leads to a whole new set of developer pages. The majority of the API seems to have remained the same, they've just added the actual application system now, from what I can tell. Mostly, I think it's to cut down on the extra accounts that have been needed to have bots, since the new system has them running off a more internal system. In a lot of ways, it's less of a hassle since we won't have to keep track of extra e-mails and extra accounts, but it is kinda butts that everyone has to take a moment to update their bots.


I'm glad I said something, since they're gonna start grouching at people who don't move to the new system!
 
Hey, I've been enjoying the app, but can I request a small change? Your app emboldens when rolls achieve maximum value, could you write the same emboldening for results equal to 1? In my group a crit 1 is just as crucial for crit 20's and they'd like it if it had that little extra flair.


Thanks for posting the app again, works like a charm!
 
Alright, I just released an update. If you type !boldOnes into the channel, it will bold-italicize 1s as well as the max value. Typing !boldOnes again will turn it off. This way, people who don't want bolded ones don't have to use them, but it's easy to enable is you want. Are people using the installer or the github? I haven't updated the installer in quite some time, so if that's what people are using I'll release an updated version of that soon. For now, the changes are on github
 
I found this app to help my RP guild with making rolls since the game we RP in doesn't have a /roll feature (criminal, I know) and thus far it's worked amazingly. Recently, we've added in an NPC aspect to our system and I was wondering if you could explain which file(s) contains the code for how Discord chat commands are recognized and responded to. I don't expect you to add this little feature to the entire program since we're just one guild looking for something very specific, but your help would be greatly appreciated!
 
If you want to add it yourself, everything is currently in discorddice.js. The if block starting on line 788 identifies the various dice commands and calls the appropriate function, while the switch statement on line 720 identifies the ! commands. If you explain what your feature is, I might be able to add it if it's generally useful.


If you do add it yourself, I would appreciate it if you submit a pull request to the github page so I can merge it, but you are under no obligation to do so
 
I wouldn't say that it's generally useful, I want to be able to coordinate specific ! commands to generate specific roll codes to make it easier to generate NPCs with certain stats. I'll be sure to check out the github thing, though, so you can at least see what commands I've added once I get them working. Thanks for your help!
 
I just wanted to update @Lord of Chaos, I've submitted that pull request on the github page for you to see the little changes I made for my guild's convenience. Thank you again for your help and for creating such a wonderful bot.
 
Neat! Thanks for submitting it, it's always nice to see what other people do with your code. I see what you mean about it being really specific to your game, but I'm glad you were able to add it in. Let me know if you need any more help
 

Users who are viewing this thread

Back
Top