// (c) 2011 Richard Carter
// This code is licensed under the MIT license; see LICENSE.txt for details.

// This script handles the following functions:
//     ~coin|flip - randomly chooses heads or tails

listen(/~(coin|flip)$/i, function(match, data, replyTo) {
    // save message into the tell folder
    irc.action(replyTo, "flips a coin...");
    setTimeout(function() {
        irc.privmsg(replyTo, (Math.random() < 0.5) ? "Heads!" : "Tails!");
    }, 1000);
});

@@ -210,99 +210,77 @@
 ten(
-/~(coin%7Cflip)$/i, function(match, data, replyTo) %7B%0A    // save message into the tell folder
+regexFactory.only(%5B%22coin%22, %22flip%22%5D), function(match, data, replyTo) %7B
 %0A   

use regexFactory