Update plugins/dice.py
This commit is contained in:
parent
1907cbb389
commit
4c39506b76
1 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@ from util import hook
|
||||||
|
|
||||||
|
|
||||||
whitespace_re = re.compile(r'\s+')
|
whitespace_re = re.compile(r'\s+')
|
||||||
valid_diceroll = r'^([+-]?(?:\d+|\d*d(?:\d+|F))(?:[+-](?:\d+|\d*d(?:\d+|' \
|
valid_diceroll = r'^([+-]?(?:\d+|\d*d(?:\d+|F))(?:[+-](?:\d+|\d*d(?:\d+|'
|
||||||
'F)))*)( .+)?$'
|
'F)))*)( .+)?$'
|
||||||
valid_diceroll_re = re.compile(valid_diceroll, re.I)
|
valid_diceroll_re = re.compile(valid_diceroll, re.I)
|
||||||
sign_re = re.compile(r'[+-]?(?:\d*d)?(?:\d+|F)', re.I)
|
sign_re = re.compile(r'[+-]?(?:\d*d)?(?:\d+|F)', re.I)
|
||||||
|
@ -37,7 +37,7 @@ def nrolls(count, n):
|
||||||
#@hook.regex(valid_diceroll, re.I)
|
#@hook.regex(valid_diceroll, re.I)
|
||||||
@hook.command
|
@hook.command
|
||||||
def dice(inp):
|
def dice(inp):
|
||||||
".dice <diceroll> -- Simulates dicerolls. Example of <diceroll>:" \
|
".dice <diceroll> -- Simulates dicerolls. Example of <diceroll>:"
|
||||||
" '.dice 2d20-d5+4 roll 2'. D20s, subtract 1D5, add 4"
|
" '.dice 2d20-d5+4 roll 2'. D20s, subtract 1D5, add 4"
|
||||||
|
|
||||||
try: # if inp is a re.match object...
|
try: # if inp is a re.match object...
|
||||||
|
|
Reference in a new issue