Skip to content

Instantly share code, notes, and snippets.

@LandonPowell
Last active February 13, 2016 23:46
Show Gist options
  • Save LandonPowell/7081097b9b0253b4b6e1 to your computer and use it in GitHub Desktop.
Save LandonPowell/7081097b9b0253b4b6e1 to your computer and use it in GitHub Desktop.
This is a clone of "Make America Great Again"'s code that he wrote for my website. It generates a nick in the style of his username, "get52". I'm using LJPowell indents because they're the master race.
function randomChar(string) {
return string.charAt(Math.floor(Math.random() * string.length)) ;}
function generateName() {
var vowels = "aeiou";
var consonants = "bcdfghjklmnpqrstvwxyz";
return randomChar(consonants) +
randomChar(vowels) +
randomChar(consonants) +
(Math.floor(Math.random()*89)+10) ;}
var flair = "$Megrim|/^/^@@0f0#fff ";
var style = "||$Quicksand|@@0f0#fff: ";
CLIENT.on('message', function(){
CLIENT.attributes.style = flair + generateName() + style ;});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment