thecraiggers / pathfinder-discord-bot Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Looks like I created the part to look for the command, but forgot to create the function it's calling. Oops!
Unhanded promise rejection is deprecated and will eventually kill the server instance in a future version of nodejs. Need to get them cleaned up before this happens.
Also, when it happens the user doesn't get an error (or anything) back from their command, and that's bad. :(
Problem: Even though trackers are pinned, they get buried and nobody looks at them.
Instead of a single pinned message, always display the current tracker after each command and delete all previous trackers. This way you can always tell at a glance what the game state is and there's not a ton of spam.
This also solves the problem of people typing commands in multiple (perhaps wrong) channels, and people getting confused about the gamestate because of the out-of-date non-pinned messages sent in response to commands.
Using this:
!omni set stat Chuck spellAttack:{{1d20}+T+WIS}
Caused the bot to show it was typing indefinitely.
Need to test for this.
Should only do so for player characters unless the user is a GM.
Need to find an easy way to allow users to do this. Prefixing property name with an !exclamation point is one way and probably only appeals to me because of CSS. Open to better methods.
This would not change time or anything like that. Need to consider how this will work with time, especially concerning the delay action.
Omnitracker has gotten big enough that regression bugs are popping up. Time for automated tests!
Considering the reliance on Discord for storing state, I'm not actually sure how to go about this, or if I can get even close to 100% test coverage. This may end up being a whole separate project in itself. :/
After moving to mathjs, all the math that is done is "hidden" to the player. They see their dice roll, and then a message saying what their skill was set to. But no mention of how it arrived at that number without looking up all their character's dynamic stats and doing the math themselves.
It should say something like:
!roll perception
Perception: {1d20}+Level+Trained = {14}+2+4 = 20
I wrote pretty much all of the code using arrays of objects, when an iterable map would have been way better.
Images should be deleted once they are sent to Discord, but they're not.
The DiceRoller library has problems with syntax that looks like '1d20+-5' as it doesn't know how to handle the +-.
If snapshots of the botdata can be taken at each save, I can give players the ability to undo mistakes.
Currently there appears to be a bug parsing/addressing some names (ones with spaces it seems) in some commands (Damage and Remove for example)
Duplication
!omni add enemy 'War Boss' AC:40 HP:300/300 Init:{1d20+10}
!damage 'War Boss' 5
!omni remove enemy 'War Boss'
I saw the previous issue (#55) on setting up the bot, but still having some trouble.
I installed GitHub, cloned the repo, installed node.js, created an application, created a bot, got the bot credential, set a Windows environment variable of DISCORD_TOKEN = to it (all of this took quite a while to figure out, although not complicated).
So now I can run the code and it logs in to my application, stupidbot1, on my server. Yay. But when I try to add a player, I get told to run !omni setup first. (I don't see that in !omni help) When I try running that, I get permission errors (50013) in /roles and /channels.
I've tried to pick what I think are the right permissions for the application: Role = Bot, View Channels, Send Messages, Read Message History (plus a bunch of others that seem unlikely but possible). Can you specify what permissions are needed? Or is that not the problem?
You also say that a hidden bot-data channel is needed in which the bot can save state. I created a #bot-data channel that is private to myself and stupidbot1, but still get the permissions error. Does it need some special name?
Thanks for any help! BTW, I'm going to use this to run Runners in the Shadows, a mod of Blades in the Dark for the Shadowrun setting.
This will provide a much friendlier and consistent user experience.
Provide a list of commands to use to get started adding the bot and their characters, and then show some examples on how to roll for init, heal, damage, etc.
If possible, I'd like to add a direct link to the PF Easy Tools website. Or possibly his Patreon. Since the bot is basically leaching from his website, he deserves additional recognition.
Each handler function currently has to implement its own detection and iteration of characters when commands with %groups are used. This is silly and could be better implemented.
!omni help
already exists, but users will have no idea that is a possibility, or that !omni / !lookup are commands either.
Should also put a message in the bot player's status to say something about using !help to get help.
Something like
!roll 1d20 //Rolling death save
!roll theivery //rolling to check for traps
Currently, the omni tracker assumes every player only has one character. I knew this would be a problem for GMs when I wrote it, but had no better ideas at the time.
One shortcut that should resolve most issues is if the User has more than one character, assume the character who's turn it is in initiative is who should be rolling.
Need to find a way around the 2000 character limit.
Hi, was really interested in using the bot (albeit for 3.5 game) and cant find a way to reach out to you. How should I get in touch?
When an enemydies, all info is removed from the data. However, that data is how the bot knows what imitative it should be on when going to the next turn, as the current turn is simply a reference to a character.
Perhaps not removing dead enemies would be better, and also allow for things like Trolls and other enemies that can come back from the dead. Better %groups handling to remove %enemies would help with this too, as the GM wouldn't need to remove them all by hand then.
Consider changing the propertiesRegex to the line below to allow for multiplication and division when adding properties as well as parentheses. This would allow automatic rolling for critical hits i.e. criticalbowdamage:=2*({1d6}+{1d6})+{1d10}
In the example below, I added "|*|/|(|)" to the existing regex to allow the other characters that math.js should be able to handle.
propertiesRegex = /(?!)?(?\w+):((?\d+)(/|\)(?\d+)|(?(=?(\w|[|]|{|}|+|-|*|/|(|))+)))/g;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.