Module:Dice/Format: Difference between revisions

112 bytes removed ,  06:15, 25 August 2023
use dice module's new api
(add extraafterroll support)
(use dice module's new api)
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 = pcall(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'