-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macros activated from comment (#) and sentence display ("") #142
Comments
There are 2 methods of substitution to transform macro to real command. # Method 1 - Find and replace (when you put False at the end) The first substitution mode is very simple. It is simple find and replace. It is up to you to find solution and to use pattern which will only be present once in your command. Each macro is tested in the order of appearence when you send Example:If you have these 3 macros (in that order):
If you roll:
Now, you add these 3 macro (in that order):
If you roll:
This method is really simple and perfect if you have no changing part or if the changing part of your command is at the beginning or the end of your command.
in game: The 6 is number of roll dice and the 4 is the number of kept dice. In this case we are lucky there are at the beginning and the end of the command. As you see the order of command can help but in some cases it is simpler to use the second method. # The second method - Regular expression Regular expressions are a standardized way to find pattern in text. Example: As you see, in this case we have changing part at the beginning, at the end and in the middle (the 6). # In your case:
Then: ## Won't work (I mean the substitution won't work but if the command is a valid one, it will run them)
Then:
|
Hey,
My issue is pretty simple and I'm probably just missing something.
The pattern of my macros are single letters "o" and "s".
When I want to make a comment to it, containing the same small letters, macros are being repeated, even tho everything past # should be ignored by the bot. In the result when I write a comment "# snake in sorrow", it will trigger "s" macro 2 additional times and "o" also two additional times, making bot showing the error.
It looks like this:
Here are the 2 macros I have on my server:
1st macro: "o"
;$1i:[<=4]{" dodge failed"}{$1i:[5..7]{" weak dodge"}{$1i:[8..12]{" successful dodge"}{$1i:[>=13]{" critical dodge"}}}} False
To trigger I use, for example:
!1d14+2o
or just!d14o
2nd macro: "s"
d10;1d10;$1c[>=$2];"DL $2 | rolls [@1] | successes $3" True
To trigger I use, for exampple:
!3s
While testing it I also realised that the first macro is being interrupted by activating 2nd macro because of the "successful" word, which contains said "s" ( https://i.imgur.com/AmOQTmV.png )
So, the question is -> is this issue to be somehow fixed or should I just use longer patterns that are impossible to be repeated in any word?
The 2nd option seems to me a bit odd since on the other server a friend of mine has macros named "p" or "k" or "s" also and nothing is being trigerred like that (neither by # comment nor macro sentence display in "")
I tried to use False for Regular expression too, hoping that it will change something but it doesn't affect anything.
The text was updated successfully, but these errors were encountered: