Update plugins/dice.py

This commit is contained in:
lukeroge 2012-03-19 12:35:20 +13:00
parent 1907cbb389
commit 4c39506b76

View file

@ -9,7 +9,7 @@ from util import hook
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)))*)( .+)?$'
valid_diceroll_re = re.compile(valid_diceroll, 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.command
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"
try: # if inp is a re.match object...