Skip to content

Instantly share code, notes, and snippets.

@ashlux ashlux/x.js
Created Aug 10, 2009

What would you like to do?
names: ["roll"],
icon: "",
description: "Roll a die with the given ",
help: "TODO",
author: {name: "Ash Lux", email: ""},
license: "GPL",
homepage: "",
arguments: [{role: 'object', nountype: noun_arb_text}],
preview: function preview(pblock, args) {
pblock.innerHTML = "Roll a <b>" + args.object.html + "-sided die.</b>.";
execute: function execute(args) {
var randomnumber=Math.floor(Math.random()* args.object.text + 1);
var doc = CmdUtils.getWindowInsecure();
doc.alert("You rolled a " + randomnumber + " on a " + args.object.text + "-sided die.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.