Comments (6)
Sorry for the late answer.
It's easy to do that using macro.
You need to define something like that ( I'm assuming that the number of dice (1), the face count (d20) and the threshold (11) don't change at all).
Define this macro
!macro foo,([\s\w]+) 1d20i:[<11]{"\1 :|: Success: %1"}{"\1 :|: Fail: %1"} 1
Call it :
foo,Slough Perception (SV 10 + PER) Roll
The executed command:
1d20i:[<11]{"Slough Perception (SV 10 + PER) Roll :|: Success: %1"}{"Slough Perception (SV 10 + PER) Roll :|: Fail: %1"}
(be careful, with empty comment, it will not roll, as it will not match the macro)
from diceparser.
Brilliant, thanks oBi!!!
.... buttttt, it gives the following error with the () or [] brackets ...
Warning: Unexpected character at 78 - end of command was ignored "[SV10]"
Warning: Unexpected character at 78 - end of command was ignored "(SV10)"
Have you noticed that in other macro's, and is there a way round defined characters?
Thanks for all your effort! Walts.
from diceparser.
It is just because [\s\w]+ accept only letter and space, but adding (,),[,],+ should do the job
!macro foo,([\w\s\d\(\)\[\]\+\-]+) 1d20i:[<11]{"\1 :|: Success: %1"}{"\1 :|: Fail: %1"} 1
from diceparser.
Works a treat, thanks oBi!
Can i ask where the documentation is for macro building/ref? Give me something to play on
within our channels! ... Thanks, Walts
from diceparser.
It depends what you mean about documentation for macro.
There are three involved mechanisms, here:
- Add/Roll/Remove macro -> the bot's documentation
- Write macro command -> the bot's documentation
- Write macro pattern -> simple replacement or regular expression
If you want documentation about regular expression, take a look on perl regular expression.
from diceparser.
Thanks oBi, the Perl link is what I was looking for!
thanks for all your help, Walts
from diceparser.
Related Issues (20)
- Exploding Doubles HOT 1
- No valid value at index HOT 5
- Question re: Syntax for an IF statement based on an Entered Number and a Dice Roll. HOT 2
- Bot stopped working with Discord's latest version HOT 6
- Prefix not working HOT 3
- All dice prefix commands not working HOT 3
- Diceparser not working with webhook
- DiceParser not working September 2022 HOT 1
- /r works but ! does not HOT 5
- Help Noob please! Bot Setup steps for RPG HOT 2
- Weird handling of numbers in lists
- Bot frequently does not respond
- Bot Not Responding In Any Server
- bot does not allow users below the rank of admin to roll HOT 3
- Broken example in HelpMe.md HOT 1
- List weight doesn't seem to work
- Dice Parse offline? HOT 2
- Ambiguous licensing HOT 1
- Discord bot privacy information
- Possible bug: wrong macro called/rolled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diceparser.