Discord Dice Roller Bot

By vampwood, in Star Wars: Edge of the Empire RPG

unfortunately installing java did not make the error disappear :(

6 hours ago, MaxXIII said:

Btw Thanks so much for helping me !!!!
I really appreciate it !

Github didn't include the nodes_module folder when it was first pushed it there. Not sure why. It's included now, please delete the bot you have and re-download with the new version. Alternatively, you could open command prompt, navigate to your bot folder, and type: npm install this will also install the node_modules folder that was missing.

Two other things, JavaScript and Java are completely different, you'll only ever need nodeJS. Don't run "Start.bat" as administrator, this opens to command prompt to the ROOT SYSTEM directory on your machine and the bot is not located there.

Edited by Astrydax

So I was having the same problem as MaxXIII. After searching the forums of Node and NPM I realized that I needed to manually install the discord.js module.

To do this I opened command prompt after successfully installing node.js 7.x and typed

"npm install discord.js"

I then had to make sure that config.json was actually a .JSON file using Notepad++.

And the final step for it to get it to work was to install the "chalk" module.

I installed that by entering in command prompt:

"npm install chalk"

After that the bot is working for me and I can get games set up through discord. Ya and thanks so much for the code

6 hours ago, MaxXIII said:

unfortunately installing java did not make the error disappear :(

Please try downloading the new version, it may of been fixed. http://puu.sh/urrFi/d092b89fd8.zip

or download it from the github link.

It is working!!!!!! Thank you all so much! :)
Unfortunately, there still seems to be sth wrong with the node mudule folder from the github link,
bc after reinstalling it told me first that a db.json file was missing (which i found in the node.js node modules folder under mimedb)
and after I fixed that a types.json file was missing (which I couldnt find :( )
In the end Vlagrikes method worked for me:
I dug up the old zip without the node module update and installed discord.js and chalk through the command prompt.

Another noob question:
Does evrune playing with me need to install node.js and get the bot activated or just me?

21 hours ago, MaxXIII said:

It is working!!!!!! Thank you all so much! :)
Unfortunately, there still seems to be sth wrong with the node mudule folder from the github link,
bc after reinstalling it told me first that a db.json file was missing (which i found in the node.js node modules folder under mimedb)
and after I fixed that a types.json file was missing (which I couldnt find :( )
In the end Vlagrikes method worked for me:
I dug up the old zip without the node module update and installed discord.js and chalk through the command prompt.

Another noob question:
Does evrune playing with me need to install node.js and get the bot activated or just me?

Nope, the bot software is essential a server, more specifically a node, (hence the name of the language NodeJS). The bot is just like a normal person logging into discord. When you run the server, the bot logs into discord and starts interacting with anyone that talks to him. Whenever you close the server, the bot will log off. So long as a single person is running the bot program, anyone in the Discord Server that bot is connected to will be able to interact with it.

After a bit of poking finally got it working and am very pleased with it and I've learnt a lot when getting it installed.
With Google Hangouts on it's way out this is a fine alternative.
Hopefully we'll see updates in the future, possibly using the dice symbols via custom emojjis.
Fantastic bot, thank you very much!

I have been putting around with this with no success for the past hour or so and I am not sure I can figure out why. I have installed an uninstalled NodeJS twice now (the 7.x.x version of course!), removed all the files, readded them, gone through all the hoops in the readme several times over and so on. The same issue I keep running into is where it throws up an error talking about being unable to find a particular module, "./types.json" and while I am still committed to get the thing working, I am at a bit of a loss!

For someone with all of no computer knowledge, what does "Error: Cannot find module './types.json'" mean? It's pretty arcane to me in all honesty.

Can I have some help? No matter what I try I keep getting this message when I click on start.bat or EotE Dice Roller:

module.js:472
throw err;
^

Error: Cannot find module './db.json'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\kyle\Desktop\SWEotE-Discord-Dice-Roller-master\node_modules\mime-db\index.js:11:18)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
Press any key to continue . . .

Any help would be greatly appreciated,

Thanks

This was a strange fix for me, but I poked around to look at other projects on github where users reported the same issue (mine was identical to @JonesyUSA ) and I seemed to find a solution!

"npm install mime"

I don't know what kind of sorcery was at work - maybe it was because I was in the coffee shop, maybe it was because I was just about to give up, maybe it was just because I overlooked something. Whatever the case, my issue was solved by running that command. Pretty odd if you ask me! I am super grateful for this bot script, and I hope it works well for other users in the future! Perhaps going forwards there could be a list of potential troubleshooting fixes that worked for users in the past?

1 hour ago, RixxyAGoGo said:

don't know what kind of sorcery was at work - maybe it was because I was in the coffee shop, maybe it was because I was just about to give up, maybe it was just because I overlooked something. Whatever the case, my issue was solved by running that command. Pretty odd if you ask me! I am super grateful for this bot script, and I hope it works well for other users in the future! Perhaps going forwards there could be a list of potential troubleshooting fixes that worked for users in the past?

I'm fond of saying, "if computers worked like they were supposed to, I'd be out of a job."

Speaking of working like they are supposed to, evidently the Force/Destiny dice cancel out when rolled in multiples. When looking at the console while people make rolls of multiple white dice, it reads as appropriate - Light 2x, Dark - but the result the bot spits out would be Light 1. It's not a huge issue but it is very strange.

I'm having the same problem as @JonesyUSA and @RixxyAGoGo . Error: Cannot find module './db.json'. Rixxy what was your solution exactly?I found the mime file, but can't find any place to modify/input the code there. Did you mess with the config file?

@Valik

I used the console present in the main folder for the dice bot. I first used the commands Vlagrike listed, and then mine and it seemed to work just fine. Unfortunately I don't really know anything about coding so it's beyond me what l these commands ACTUALLY do, so I am afraid I can't be of too much help if you still have problems.

On 3/8/2017 at 9:53 PM, RixxyAGoGo said:

Speaking of working like they are supposed to, evidently the Force/Destiny dice cancel out when rolled in multiples. When looking at the console while people make rolls of multiple white dice, it reads as appropriate - Light 2x, Dark - but the result the bot spits out would be Light 1. It's not a huge issue but it is very strange.

On 3/8/2017 at 3:54 PM, RixxyAGoGo said:

This was a strange fix for me, but I poked around to look at other projects on github where users reported the same issue (mine was identical to @JonesyUSA ) and I seemed to find a solution!

"npm install mime"

I don't know what kind of sorcery was at work - maybe it was because I was in the coffee shop, maybe it was because I was just about to give up, maybe it was just because I overlooked something. Whatever the case, my issue was solved by running that command. Pretty odd if you ask me! I am super grateful for this bot script, and I hope it works well for other users in the future! Perhaps going forwards there could be a list of potential troubleshooting fixes that worked for users in the past?

On 3/8/2017 at 1:28 AM, RixxyAGoGo said:

I have been putting around with this with no success for the past hour or so and I am not sure I can figure out why. I have installed an uninstalled NodeJS twice now (the 7.x.x version of course!), removed all the files, readded them, gone through all the hoops in the readme several times over and so on. The same issue I keep running into is where it throws up an error talking about being unable to find a particular module, "./types.json" and while I am still committed to get the thing working, I am at a bit of a loss!

For someone with all of no computer knowledge, what does "Error: Cannot find module './types.json'" mean? It's pretty arcane to me in all honesty.

On 3/8/2017 at 7:07 AM, JonesyUSA said:

Can I have some help? No matter what I try I keep getting this message when I click on start.bat or EotE Dice Roller:

module.js:472
throw err;
^

Error: Cannot find module './db.json'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\kyle\Desktop\SWEotE-Discord-Dice-Roller-master\node_modules\mime-db\index.js:11:18)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
Press any key to continue . . .

Any help would be greatly appreciated,

Thanks

On 3/9/2017 at 1:23 PM, Valik said:

I'm having the same problem as @JonesyUSA and @RixxyAGoGo . Error: Cannot find module './db.json'. Rixxy what was your solution exactly?I found the mime file, but can't find any place to modify/input the code there. Did you mess with the config file?



This bug is my fault. When I first put the bot up on Github, I failed to include the node-modules folder, the folder that contain a few pre-built libraries the bot depends on. Those commands fixed the issue because they created the node-module folder and installed the two modules the bot requires (and probably some that it doesn't need). Typing "npm install" into the console will install only what the bot needs. I've since fixed this issue and you should be able to download the latest version of the bot here https://github.com/Astrydax/SWEotE-Discord-Dice-Roller

Note, that link will always have the most up to date version of the bot. The bot was a quick project and I'm constantly working to make it more user friendly. Expect auto-updates and not having to dig around in the files to setup the bot in the near future.

Again, I apologize for the bug.

On 3/8/2017 at 9:53 PM, RixxyAGoGo said:

Speaking of working like they are supposed to, evidently the Force/Destiny dice cancel out when rolled in multiples. When looking at the console while people make rolls of multiple white dice, it reads as appropriate - Light 2x, Dark - but the result the bot spits out would be Light 1. It's not a huge issue but it is very strange.

I was under the impression light and dark were suppose to cancel each other. Is this not the case? I'm not extremely savvy on the rules of the game apart from what Vampwood has explained to me. If this isn't how those dice are suppose to work that's a quick fix I can push out.

Edited by Astrydax

Thank you for your efforts and your generosity, Vamp wood! The entire FFG Star Wars community thanks you for your efforts.....

11 hours ago, Astrydax said:

I was under the impression light and dark were suppose to cancel each other. Is this not the case? I'm not extremely savvy on the rules of the game apart from what Vampwood has explained to me. If this isn't how those dice are suppose to work that's a quick fix I can push out.

Dark and Light, and Despair and Triumph, are the two cases where 'opposites' do not cancel out.

On 3/15/2017 at 7:26 AM, Darzil said:

Dark and Light, and Despair and Triumph, are the two cases where 'opposites' do not cancel out.

Ok, I'll update the bot with that functionality. Will probably be on github tomorrow. Maybe sooner. Currently, Triumph and despair do not cancel. Just need to fix dark and light. Is it common for DMs to change this rule based on their preference? If it is, I'll add a setting into the config file where you can set whether or not you want dark/light to cancel out

Edited by Astrydax

I don't think so, from memory it's basically you get force equal to the light ones, but you can give into the dark side at the cost of a destiny point and get the dark ones in force too. So they don't cancel.

I'm still getting that 'db.json' error. Any ideas regarding what I could try?

I just wanted to say thank you for taking the time to create this bot. It has streamlined our online games immensely and your work is greatly appreciated by all!

I look forward to the update fixing the cancelling of Light/Dark points.

On 3/18/2017 at 0:36 PM, Arctanaar said:

I'm still getting that 'db.json' error. Any ideas regarding what I could try?

I am also getting this.

I've tried deleting node (v7) and the roller bot files, reinstalling both and even the 'npm install x' solutions posted above. Still nothing.
:(

On 3/15/2017 at 7:26 AM, Darzil said:

Dark and Light, and Despair and Triumph, are the two cases where 'opposites' do not cancel out.

The update is now live, download the newest version from github

On 3/18/2017 at 5:49 PM, Boisterous Bothan said:

I just wanted to say thank you for taking the time to create this bot. It has streamlined our online games immensely and your work is greatly appreciated by all!

I look forward to the update fixing the cancelling of Light/Dark points.