Module:Dice/Format: Difference between revisions

Jump to navigation Jump to search
119 bytes removed ,  06:18, 25 August 2023
oops, pcall no longer necessary
(add extraafterroll support)
(oops, pcall no longer necessary)
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:


function DiceFormat.diceStats(frame)
function DiceFormat.diceStats(frame)
     local succeeded, dice = pcall(Dice.from_range_string, frame.args.roll)
     local dice = Dice.parse(frame.args.roll)
 
    if not succeeded then
        dice = Dice.from_dice_string(frame.args.roll)
    end


local template_title = (frame.args.template ~= nil and frame.args.template ~= '') and frame.args.template or 'Dice string'
local template_title = (frame.args.template ~= nil and frame.args.template ~= '') and frame.args.template or 'Dice string'

Navigation menu