Created
September 12, 2010 05:36
-
-
Save fczuardi/575880 to your computer and use it in GitHub Desktop.
jerkenstein colorize plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this.plugin = { | |
| 'name': 'colorize' | |
| ,'pattern': /^\?colorize (.+)$/ | |
| ,'description': 'Randomly colorize the message.' | |
| ,'example': "?colorize I feel funny. Is this real life?" | |
| ,'action': function(message) { | |
| var output = '' | |
| for(i in message.match_data[1]){ | |
| var color_code = (Math.floor(Math.random()*14)+2).toString() //2 to 15 | |
| color_code = '\x03'+((color_code.length<2) ? ('0'+color_code) : color_code) | |
| output += color_code+message.match_data[1][i] | |
| } | |
| message.say(output) | |
| } | |
| ,'url': 'http://gist.github.com/575880' | |
| } | |
| // after Supybot by Jeremiah Fincher and others | |
| // http://supybot.git.sourceforge.net/git/gitweb.cgi?p=supybot/supybot;a=blob;f=plugins/Filter/plugin.py;h=23b6277ffa4b23d9023f1f179a649e76ba1e7214;hb=HEAD#l353 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment