I wanted to make a quick macro to pick a random compass direction for each doorway in a 3x3 room grid and realized there wasn't an easy way to pick a random value from a list without creating a rollable table. I decided that instead of making 9 different rollable tables I'd write a minimal script to provide a random choice from a supplied list of options:  on('chat:message', function(msg) {     if (msg.type !== "api" ) {         return;     }     var args = msg.content.split(" ");     var command = args.shift();     switch(command) {         case '!choice':             var myList = [];             var i;             for (i = 0; i < args.length; i++) {                  myList.push(args[i]);             }                          sendChat('Choice', '/w '+msg.who+' '+myList[randomInteger(myList.length)-1]);     } });  For example saying this:      !choice N S E W  Will result in something like this response:      (From Choice): (GM) E  Not really a ground-breaking or original concept, but I figured I'd share.