1,043
edits
(add truncated mean; minor refactoring) |
(autodetect which kind of string we wanted) |
||
Line 4: | Line 4: | ||
function DiceFormat.diceStats(frame) | function DiceFormat.diceStats(frame) | ||
local | local succeeded, result = pcall(Dice.fromRangeString, frame.args.roll) | ||
if not succeeded then | |||
result = Dice.fromDiceString(frame.args.roll) | |||
end | |||
local dice = result | |||
local templatetitle = 'Dice string' | local templatetitle = 'Dice string' |