User:Cakemix/Snippets/PHP/Dice

Simple dice func for the bot. public static function onCommandDICE(event $event, $nick = null, $dh = null, $args = array(0, 1)) { if ($args[0] && is_numeric($args[0]) && $args[0] > 1) $rnd = rand(1, $args[0]); else $rnd = rand(1, 10);

$dh->reply("[\00303DICE\003] JSBot rolled a %s.", $rnd); $event->delete; }