Nickname Generator


(unf4z3d) #1

I know there are ton os em, but this one has the proper HTML colours, some missing codes, and the same colours as the console part u usually type on:

The code is my own, only kept hexa index from easyriders, cause i’d already corrected it for Nails with proper values.

anyone can use this, no need for credit, no copyrights. enjoy.


<html>
<head>
<script type="text/javascript">
var name = new Array();
var invalids = ["\\",";"];
var hexa = new Array();
hexa["0"] = "000000";
hexa["1"] = "FF0000";
hexa["2"] = "00FF00";
hexa["3"] = "FFFF00";
hexa["4"] = "0000FF";
hexa["5"] = "00FFFF";
hexa["6"] = "FF00FF";
hexa["7"] = "FFFFFF";
hexa["8"] = "FF7F00";
hexa["9"] = "7F7F7F";
hexa["/"] = "FFFF7F";
hexa[":"] = "BFBFBF";
hexa[";"] = "BFBFBF";
hexa["<"] = "007F00";
hexa[">"] = "00007F";
hexa["="] = "7F7F00";
hexa["*"] = "FFFFFF";
hexa["-"] = "999933";
hexa["+"] = "993300";
hexa["?"] = "7F0000";
hexa["@"] = "7F3F00";
hexa["a"] = "FF9919";
hexa["b"] = "007F7F";
hexa["c"] = "7F007F";
hexa["d"] = "007fFF";
hexa["e"] = "7F00FF";
hexa["f"] = "3399CC";
hexa["g"] = "CCFFCC";
hexa["h"] = "006633";
hexa["i"] = "FF0033";
hexa["j"] = "B21919";
hexa["k"] = "993300";
hexa["l"] = "CC9933";
hexa["m"] = "999933";
hexa["n"] = "FFFFBF";
hexa["o"] = "FFFF7F";
hexa["p"] = "000000";
hexa["q"] = "FF0000";
hexa["r"] = "00FF00";
hexa["s"] = "FFFF00";
hexa["t"] = "0000FF";
hexa["u"] = "00FFFF";
hexa["v"] = "FF00FF";
hexa["w"] = "FFFFFF";
hexa["x"] = "FF7F00";
hexa["y"] = "7F7F7F";
hexa["z"] = "BFBFBF";

function populate ()
{
	optionList = "<form name='listColor'><select  onChange='colorSelect(this.options[this.selectedIndex].value)' name='chooseColor' style='font-weight:bold;background-color:#99A099;'><option style='color:#FFFFFF;' value=''>choose color</option>";
	for (var i in hexa)
	{
		optionList += "<option style='color:#"+hexa[i]+"' value='"+i+"'>"+i+" = "+hexa[i]+"</option>"
	}
	document.getElementById("colorDrop").innerHTML += optionList + "</select></form>";
	document.getElementById("input").value = "your^8Name^5Here";
	KeyDown();
}

function colorSelect (i)
{
	document.getElementById("input").value += "^" + i;
}

function invalidCharacters (invalid,string)
{
	for (var i=0;i<invalid.length;i++)
	{
		var invalidsArray = string.split(invalid[i]);
		string = invalidsArray.join("<span style='background-color:#FF0000'>"+invalid[i]+"</span>")
	}
	return string;
}

function KeyDown()
{
	inp = document.getElementById("input").value;
	name = inp.split("^");
	nameString = "<font color=#BFBFBF>"+name[0]+"</font>";
	for(var i=1;i<name.length; i++)
	{
		if(name[i].substring(0,1) != "")
		{
			color = hexa[name[i].substring(0,1)]
			if(color === undefined)
			{
				nameString += "<span style='background-color:#FF0000'>^"+name[i].substring(0,1)+"</span><font color=#BFBFBF>"+name[i].substring(1)+"</font>"
			}else{
				nameString += "<font color=#"+hexa[name[i].substring(0,1)]+">"+name[i].substring(1)+"</font>";
			}
		}else{
			nameString += "<font color=#BFBFBF>^</font>"
		}
	}
	nameString = invalidCharacters(invalids,nameString);
	document.getElementById("output").innerHTML = nameString;
}
</script>
</head>
<body onload="populate()">

<div id="output" style="border:2px solid #000000; background-color:#0f110f; width:400px; height: 50px;text-align:center;font-family:Courier New; font-size:16px; font-weight:bold;">
</div>
<br />
<input type="text" id="input" name="input" value="" onkeyup="KeyDown()" style="width:400px;border:2px solid;text-align:center;font-size:16px;font-weight:bold;"/>
<div id="colorDrop">
</div>
</body>
</html>


(eiM) #2

great one :slight_smile: Might be usefull for some poeple =) Wont test it out now but guess its working.


(Nail) #3

good work unf4z3d


(unf4z3d) #4

added an error/exception handler, for invalid characters in the color codes, and in the text in general

modified base color (no codes) to that of ET (its not white)

:slight_smile:


(unf4z3d) #5

thanks a lot for hosting that berzerk…

unfortunately i didn’t remember to add two keys to the exception handler,

if i posted the code, could you just swap the files out? sry bout that, it was just that the tilde key never occured to me as an invalid until like today :frowning:


<html>
<head>
<title>Nickname Generator</title>
<script type="text/javascript">
var name = new Array();
var invalids = ["\\",";","~","`"];
var hexa = new Array();
hexa["0"] = "000000";
hexa["1"] = "FF0000";
hexa["2"] = "00FF00";
hexa["3"] = "FFFF00";
hexa["4"] = "0000FF";
hexa["5"] = "00FFFF";
hexa["6"] = "FF00FF";
hexa["7"] = "FFFFFF";
hexa["8"] = "FF7F00";
hexa["9"] = "7F7F7F";
hexa["/"] = "FFFF7F";
hexa[":"] = "BFBFBF";
hexa[";"] = "BFBFBF";
hexa["&lt;"] = "007F00";
hexa["&gt;"] = "00007F";
hexa["="] = "7F7F00";
hexa["*"] = "FFFFFF";
hexa["-"] = "999933";
hexa["+"] = "993300";
hexa["?"] = "7F0000";
hexa["@"] = "7F3F00";
hexa["a"] = "FF9919";
hexa["b"] = "007F7F";
hexa["c"] = "7F007F";
hexa["d"] = "007fFF";
hexa["e"] = "7F00FF";
hexa["f"] = "3399CC";
hexa["g"] = "CCFFCC";
hexa["h"] = "006633";
hexa["i"] = "FF0033";
hexa["j"] = "B21919";
hexa["k"] = "993300";
hexa["l"] = "CC9933";
hexa["m"] = "999933";
hexa["n"] = "FFFFBF";
hexa["o"] = "FFFF7F";
hexa["p"] = "000000";
hexa["q"] = "FF0000";
hexa["r"] = "00FF00";
hexa["s"] = "FFFF00";
hexa["t"] = "0000FF";
hexa["u"] = "00FFFF";
hexa["v"] = "FF00FF";
hexa["w"] = "FFFFFF";
hexa["x"] = "FF7F00";
hexa["y"] = "7F7F7F";
hexa["z"] = "BFBFBF";

function populate ()
{
	optionList = "&lt;form name='listColor'&gt;&lt;select  onChange='colorSelect(this.options[this.selectedIndex].value)' name='chooseColor' style='font-weight:bold;background-color:#99A099;'&gt;&lt;option style='color:#FFFFFF;' value=''&gt;choose color&lt;/option&gt;";
	for (var i in hexa)
	{
		optionList += "&lt;option style='color:#"+hexa[i]+"' value='"+i+"'&gt;"+i+" = "+hexa[i]+"&lt;/option&gt;"
	}
	document.getElementById("colorDrop").innerHTML += optionList + "&lt;/select&gt;&lt;/form&gt;";
	document.getElementById("input").value = "your^8Name^5Here";
	KeyDown();
}

function colorSelect (i)
{
	document.getElementById("input").value += "^" + i;
}

function invalidCharacters (invalid,string)
{
	for (var i=0;i&lt;invalid.length;i++)
	{
		var invalidsArray = string.split(invalid[i]);
		string = invalidsArray.join("&lt;span style='background-color:#FF0000'&gt;"+invalid[i]+"&lt;/span&gt;")
	}
	return string;
}

function KeyDown()
{
	inp = document.getElementById("input").value;
	name = inp.split("^");
	nameString = "&lt;font color=#BFBFBF&gt;"+name[0]+"&lt;/font&gt;";
	for(var i=1;i&lt;name.length; i++)
	{
		if(name[i].substring(0,1) != "")
		{
			color = hexa[name[i].substring(0,1)]
			if(color === undefined)
			{
				nameString += "&lt;span style='background-color:#FF0000'&gt;^"+name[i].substring(0,1)+"&lt;/span&gt;&lt;font color=#BFBFBF&gt;"+name[i].substring(1)+"&lt;/font&gt;"
			}else{
				nameString += "&lt;font color=#"+hexa[name[i].substring(0,1)]+"&gt;"+name[i].substring(1)+"&lt;/font&gt;";
			}
		}else{
			nameString += "&lt;font color=#BFBFBF&gt;^&lt;/font&gt;"
		}
	}
	nameString = invalidCharacters(invalids,nameString);
	document.getElementById("output").innerHTML = nameString;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="populate()"&gt;

&lt;div id="output" style="border:2px solid #000000; background-color:#0f110f; width:400px; height: 50px;text-align:center;font-family:Courier New; font-size:16px; font-weight:bold;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;input type="text" id="input" name="input" value="" onkeyup="KeyDown()" style="width:400px;border:2px solid;text-align:center;font-size:16px;font-weight:bold;"/&gt;
&lt;div id="colorDrop"&gt;
&lt;/div&gt;
&lt;div id="Scripts"&gt;

&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


ty bezerker :slight_smile:


(Berzerkr) #6

OK, the file is swapped with the new version.
Seems like people like this small tool you made. :slight_smile:


(Blowfish) #7

Thanks, I made a copy for my website. Saves me finding one when needed…

http://www.p0wnd.nl:666/namegenerator.htm


(unf4z3d) #8

going to release a version 2.0 in a few days that handles capital letters and also generates a script to cycle multiple names.


(unf4z3d) #9

Well, i studied through the ET color table , and an ascii code chart, and i found what makes it tick, why some letters have the same color :slight_smile:

basically ET takes the ascii of the color key, and subtracts 32 from it until it cant subtract 32 without the value being below 48 (aka 0, which is where the quake 3 table starts)

now if you take away 48 you get a number from 0-31 which is the same length as the color table! :slight_smile:

now all you do is pull the color stored in the table by that index :slight_smile:

this means my color generator now handles every code ET does, as well as being a lot more efficient because I dont have a seperate key for each color, only the 32 that are used :slight_smile:

also, assuming the colors aren’t changed in the other ID engines, this will work for those games too :slight_smile:

v2.0 release is in a few days :slight_smile:

now to sleep!


(shagileo) #10

Now that’s a lot of ’ :slight_smile: ’ 's ^^

Well, nice find


(unf4z3d) #11

lol i failed again :),

it works by pulling the ascci, subtracting 16 (to start the index at the keycode for 0, instead of space) and then finding the remainder when its divided by 32

Example:

3 for example is 51 in ascii

subtract 16 = 35

35/32 is 1 remainder 3

so the index is 3

now take S, or 83 in ascii which has the same color as 3 in ET (try it if you dont believe me)

subtract 16 = 67

67/32 is 2 Remainder 3

again, index 3 :slight_smile:

i winz

CODE:

here is the key javascriopt code (easily changeable into any language) for ne one who understatands/cares to understand :slight_smile:


function getIndex(char) //takes the input key
{
	ascii = char.charCodeAt(0); //gets its ascii value
	index = (ascii - 16) % 32; //finds the remainder/index
	return index; //returns this value
}

and here is my color index :slight_smile:


var hexa = 
[
"000000",
"FF0000",
"00FF00",
"FFFF00",
"0000FF",
"00FFFF",
"FF00FF",
"FFFFFF",
"FF7F00",
"7F7F7F",
"BFBFBF",
"BFBFBF",
"007F00",
"7F7F00",
"00007F",
"7F0000",
"7F3F00",
"FF9919",
"007F7F",
"7F007F",
"007fFF",
"7F00FF",
"3399CC",
"CCFFCC",
"006633",
"FF0033",
"B21919",
"993300",
"CC9933",
"999933",
"FFFFBF",
"FFFF7F"
];

Njoy


(unf4z3d) #12

Color index had an extra key :slight_smile: threw it all off


(unf4z3d) #13

V2.0 release:

Also, i will be putting up a version of both pages on a friends permanent host, instead of the current temporary one in a while for those who prefer to place links :slight_smile:

Readme:


/*/        ET Nickname Colors and Scripts Generator V2.0          \*\

This is am html/javascript Nickname generator made by unf4z3d for
Wolfenstein : Enemy Territory but will work for most Quake 3 based
game, and also Enemy Territory : Quake Wars.

to use either version, either host the html files as they are, or 
copy all the code in the <body> tag and put it into another page :)

\*\anyone can use this, no need for credit, no copyrights. enjoy. /*/

Temporary download: http://unf4z3d.fileave.com/NickNameGenerator.zip
Temporary link: Nick + scripts: http://unf4z3d.fileave.com/nickGen_Scripts.html
Temporarly link: Nick_only: http://unf4z3d.fileave.com/nickGen.html

HTML with Script Generator:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nickname Generator</title>
</head>
<body>
<div id="nickGen" style="width:800px;">
    <div id="output" style="border:2px solid #000000; background-color:#0f110f; width:100%; height: 50px;text-align:center;font-family:Courier New; font-size:16px; font-weight:bold;">
    </div>
    <br />
    <input type="text" id="input" name="input" value="" onkeyup="KeyUp()" style="width:100%;border:2px solid;text-align:center;font-size:16px;font-weight:bold;"/>
    <div id="colorDrop">
    </div>
    <div id="scripts" style="border:2px solid #000000; background-color:#0f110f;width:100%;font-weight:bold;color:#FFFFFF;">
    </div>
    <br />
    <br />
    <div id="script" style="border:2px solid #000000; background-color:#0f110f;width:100%;font-weight:bold;color:#FFFFFF;">
    </div>
</div>
<script type="text/javascript">
var hexa = 
[
"000000",
"FF0000",
"00FF00",
"FFFF00",
"0000FF",
"00FFFF",
"FF00FF",
"FFFFFF",
"FF7F00",
"7F7F7F",
"BFBFBF",
"BFBFBF",
"007F00",
"7F7F00",
"00007F",
"7F0000",
"7F3F00",
"FF9919",
"007F7F",
"7F007F",
"007fFF",
"7F00FF",
"3399CC",
"CCFFCC",
"006633",
"FF0033",
"B21919",
"993300",
"CC9933",
"999933",
"FFFFBF",
"FFFF7F"
];

function populate ()
{
	var optionList = "<form name='listColor'><select  onChange='colorSelect(this.options[this.selectedIndex].value)' name='chooseColor' style='font-weight:bold;background-color:#99A099;'><option style='color:#FFFFFF;' value=''>choose color</option>";
	for (var i = 0;i<32;i++)
	{
		var key = String.fromCharCode(i+48);
		optionList += "<option style='color:#"+hexa[i]+"' value='"+key+"'>"+key+" = "+hexa[i]+"</option>"
	}
	loadScriptGenerator();
	document.getElementById("colorDrop").innerHTML += optionList + "</select></form><br>";
	document.getElementById("input").value = "your^8Name^5Here";
	KeyUp();
}

function colorSelect (i)
{
	var input = document.getElementById("input");
	input.value += "^" + i;
	input.focus();
	keyUp();
}

function getIndex(char)
{
	var ascii = char.charCodeAt(0);
	var index = (ascii - 16) % 32;
	return index;
}

function KeyUp()
{
	var inp = document.getElementById("input").value;
	inp = inp.replace(/"/g,"");
	var name = inp.split("^");
	var nameString = "<font color=#BFBFBF>"+name[0]+"</font>";
	for(var i=1;i<name.length; i++)
	{
		if(name[i].substring(0,1) != "")
		{
			var index = getIndex(name[i].substring(0,1));
			var color = hexa[index]
			if(color === undefined)
			{
				nameString += "<span style='background-color:#FF0000'>^"+index+"</span><font color=#BFBFBF>"+name[i].substring(1)+"</font>"
			}else{
				nameString += "<font color=#"+color+">"+name[i].substring(1)+"</font>";
			}
		}else{
			nameString += "<font color=#BFBFBF>^</font>"
		}
	}
	document.getElementById("output").innerHTML = nameString;
	document.getElementById("input").value = inp;
}

function loadScriptGenerator ()
{
	var scripts = "";
	j=7;
	for (var i=1;i<j;i++)
	{
	scripts += "<div id='select"+i+"'><input type='button' id='name"+i+"bt' value='Use' onClick='use("+i+")'/><input type='button' id='name"+i+"btEdit' value='Edit' onClick='edit("+i+")'/><input type='button' id='name"+i+"btDel' value='Delete' onClick='del("+i+")'/><input type='button' id='name"+i+"btUp' value='^' onClick='up("+i+","+j+")'/><input type='button' id='name"+i+"btDown' value='v' onClick='down("+i+","+j+")'/>name "+i+": <span id='name"+i+"'></span>  = <span id='nameSource"+i+"'></span><br></div>"
	}
	document.getElementById("scripts").innerHTML = scripts + "<br><input type='text' id='cycleKey' name='cycleKey' value='' style='width:40px;text-align:center;font-size:16px;font-weight:bold;'/> Cycle key (for multiple names)*<br><input type='text' id='chooseKey' name='chooseKey' value='' style='width:40px;text-align:center;font-size:16px;font-weight:bold;'/> Select key (Selects the name)*<br><br>* = Required<br><input type='button' id='genScript' value='Make my script!' onClick='generateScript("+j+")'/>";
}

function use(curr)
{
	document.getElementById("name"+curr).innerHTML = document.getElementById("output").innerHTML;
	document.getElementById("nameSource"+curr).innerHTML = document.getElementById("input").value;
}

function edit (curr)
{
	document.getElementById("input").value = document.getElementById("nameSource"+curr).innerHTML;
	document.getElementById("output").innerHTML = document.getElementById("name"+curr).innerHTML; 
}

function del (curr)
{
	document.getElementById("name"+curr).innerHTML = "";
	document.getElementById("nameSource"+curr).innerHTML = "";
}

function up (curr,full)
{
	next = curr - 1;
	if(next < 1)
	{
		next = full - 1;
	}
	Swap(curr,next);
}

function down (curr,full)
{
	next = curr + 1;
	if(next > full - 1)
	{
		next = 1;
	}
	Swap(curr,next);
}

function Swap (curr,next)
{
	var tempName = document.getElementById("name"+next).innerHTML;
	var tempSrc = document.getElementById("nameSource"+next).innerHTML;
	document.getElementById("name"+next).innerHTML = document.getElementById("name"+curr).innerHTML;
	document.getElementById("nameSource"+next).innerHTML = document.getElementById("nameSource"+curr).innerHTML;
	document.getElementById("name"+curr).innerHTML = tempName;
	document.getElementById("nameSource"+curr).innerHTML = tempSrc;
}


function generateScript (amount)
{
	var script = "";
	var namesArray = [];
	for (var i=1;i<amount;i++)
	{
		if(document.getElementById("nameSource"+i).innerHTML != "")
		{
			namesArray.push(document.getElementById("nameSource"+i).innerHTML);
		}
	}
	amount=namesArray.length
	if(amount == 1)
	{
		script = "bind "+document.getElementById("chooseKey").value+" \"set name "+namesArray[0]+"\"<br><br>//copy code into notepad and save as autoexec.cfg in your ETmain folder, then, in-game open console and type /exec autoexec.cfg";
	}else if(amount == 0){
		script = "Select names first!"
	}else{
		script = "bind "+document.getElementById("cycleKey").value+" vstr Nick<br>bind "+document.getElementById("chooseKey").value+" vstr setNick<br><br>"
		for (var i=1;i<amount;i++)
		{
			script += "set Name"+i+" \"set name "+namesArray[i-1]+"\"<br>set echoName"+i+" \"echo ^0> ^7Nick^0: "+namesArray[i-1]+"\"<br>set N"+i+" \"vstr echoName"+i+"; set Nick vstr N"+(i+1)+"; set setNick vstr Name"+i+"\"<br><br>"
		}
		script += "set Name"+amount+" \"set name "+namesArray[amount-1]+"\"<br>set echoName"+amount+" \"echo ^0> ^7Nick^0: "+namesArray[amount-1]+"\"<br>set N"+amount+" \"vstr echoName"+amount+"; set Nick vstr N1; set setNick vstr Name"+amount+"\"<br>";
		script += "<br>set Nick \"vstr N1\"<br>set setNick \"echo ^0>^7Choose a Nick first!^0<\"<br><br>//copy code into notepad and save as autoexec.cfg in your ETmain folder, then, in-game open console and type /exec autoexec.cfg";
	}
	document.getElementById("script").innerHTML = script;
}
populate();
</script>
</body>
</html>

No Script Generator


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nickname Generator</title>
</head>
<body>
<div id="nickGen" style="width:800px;">
    <div id="output" style="border:2px solid #000000; background-color:#0f110f; width:100%; height: 50px;text-align:center;font-family:Courier New; font-size:16px; font-weight:bold;">
    </div>
    <br />
    <input type="text" id="input" name="input" value="" onkeyup="KeyUp()" style="width:100%;border:2px solid;text-align:center;font-size:16px;font-weight:bold;"/>
    <div id="colorDrop">
    </div>
</div>
<script type="text/javascript">
var hexa = 
[
"000000",
"FF0000",
"00FF00",
"FFFF00",
"0000FF",
"00FFFF",
"FF00FF",
"FFFFFF",
"FF7F00",
"7F7F7F",
"BFBFBF",
"BFBFBF",
"007F00",
"7F7F00",
"00007F",
"7F0000",
"7F3F00",
"FF9919",
"007F7F",
"7F007F",
"007fFF",
"7F00FF",
"3399CC",
"CCFFCC",
"006633",
"FF0033",
"B21919",
"993300",
"CC9933",
"999933",
"FFFFBF",
"FFFF7F"
];

function populate ()
{
	var optionList = "<form name='listColor'><select  onChange='colorSelect(this.options[this.selectedIndex].value)' name='chooseColor' style='font-weight:bold;background-color:#99A099;'><option style='color:#FFFFFF;' value=''>choose color</option>";
	for (var i = 0;i<32;i++)
	{
		key = String.fromCharCode(i+48);
		optionList += "<option style='color:#"+hexa[i]+"' value='"+key+"'>"+key+" = "+hexa[i]+"</option>"
	}
	document.getElementById("colorDrop").innerHTML += optionList + "</select></form><br>";
	document.getElementById("input").value = "your^8Name^5Here";
	KeyUp();
}

function colorSelect (i)
{
	var input = document.getElementById("input");
	input.value += "^" + i;
	input.focus();
	keyUp();
}

function getIndex(char)
{
	var ascii = char.charCodeAt(0);
	var index = (ascii - 16) % 32;
	return index;
}

function KeyUp()
{
	var inp = document.getElementById("input").value;
	inp = inp.replace(/"/g,"");
	var name = inp.split("^");
	var nameString = "<font color=#BFBFBF>"+name[0]+"</font>";
	for(var i=1;i<name.length; i++)
	{
		if(name[i].substring(0,1) != "")
		{
			var index = getIndex(name[i].substring(0,1));
			var color = hexa[index]
			if(color === undefined)
			{
				nameString += "<span style='background-color:#FF0000'>^"+index+"</span><font color=#BFBFBF>"+name[i].substring(1)+"</font>"
			}else{
				nameString += "<font color=#"+color+">"+name[i].substring(1)+"</font>";
			}
		}else{
			nameString += "<font color=#BFBFBF>^</font>"
		}
	}
	document.getElementById("output").innerHTML = nameString;
	document.getElementById("input").value = inp;
}
populate();
</script>
</body>
</html>


(Nail) #14

mirror:
http://ftp.freenet.de/pub/4players/hosted/et/tools/NickNameGenerator.zip


(unf4z3d) #15

thanks a lot nail :slight_smile:

also, i found the only invalid in ET is ", so i jsut have it automatically remove " from the name :slight_smile:

also found that ~ becomes " in ET, so in futur i might have people who use " automaticalyl get a ~

but aside from that character this replicates the ET system exactly


(Pande) #16

How do you type ~ in et since that gives you the console toggle?


(unf4z3d) #17

configs/ctrl+c,ctrl+v :slight_smile:


(ailmanki) #18

for IPB 2.3: but shouldn’t be big trouble to adapt… only tested with Chrome and firefox.
thanks for the script unfa43d.
you can see it here: http://bunker.aaxxss.com/forums/index.php?showtopic=24168


<script type="text/javascript">
var hexa = ["000000", "FF0000", "00FF00", "FFFF00", "0000FF", "00FFFF", "FF00FF", "FFFFFF", "FF7F00", "7F7F7F", "BFBFBF", "BFBFBF", "007F00", "7F7F00", "00007F", "7F0000", "7F3F00", "FF9919", "007F7F", "7F007F", "007fFF", "7F00FF", "3399CC", "CCFFCC", "006633", "FF0033", "B21919", "993300", "CC9933", "999933", "FFFFBF", "FFFF7F"];

		function bunkerColorize(input) {
			var mySplitResult = input.split("<br>");
			var awesome = "";
			for (var j = 0; j < mySplitResult.length; j++) {
				inp = mySplitResult[j];
				//inp = inp.replace(/"/g, "");
				var name = inp.split("^");
				var nameString = "<font color='#FFF'>" + name[0] + "</font>";
				for (var i = 1; i < name.length; i++) {
					if (name[i].substring(0, 1) != "") {
						var index = getIndex(name[i].substring(0, 1));
						var color = hexa[index];
						if (color === undefined) {
							nameString += "<span style='background-color:#FF0000'>^" + index + "</span><font color='#FFF'>" + name[i].substring(1) + "</font>"
						} else {
							nameString += "<font color='#" + color + "'>" + name[i].substring(1) + "</font>";
						}
					} else {
						nameString += "<font color='#FFF'>^</font>"
					}
				}
				awesome += (nameString + "<br>");
			}
			return awesome;
		}

		function getIndex(char) {
			var ascii = char.charCodeAt(0);
			var index = (ascii - 16) % 32;
			return index;
		}

		function bunkerButtonColorize(entry) {
			//Cache it
			if (bunkerButtonColorize.oldHTML === undefined) {
				bunkerButtonColorize.oldHTML = new Object()
				bunkerButtonColorize.newHTML = new Object()
			}
			if (bunkerButtonColorize.oldHTML[entry] === undefined) {
				bunkerButtonColorize.oldHTML[entry] = document.getElementById(entry).innerHTML;
				bunkerButtonColorize.newHTML[entry] = bunkerColorize(bunkerButtonColorize.oldHTML[entry]);
				document.getElementById(entry).innerHTML = bunkerButtonColorize.newHTML[entry];
				document.getElementById(entry+"_button").value = "Uncolorize";
			} else if (document.getElementById(entry+"_button").value == "Colorize") {
				document.getElementById(entry).innerHTML = bunkerButtonColorize.newHTML[entry];
				document.getElementById(entry+"_button").value = "Uncolorize";
			} else {
				document.getElementById(entry).innerHTML = bunkerButtonColorize.oldHTML[entry];
				document.getElementById(entry+"_button").value = "Colorize";
			}
		}
	</script>

<b>{option}</b><input style="margin: 5px; padding: 5px; font-size: 10px;" id="{option}_button" type="button" onclick="bunkerButtonColorize('{option}')" value='Colorize'/><br/><br/>
<div class="codemain" style="white-space:pre;overflow:auto"><p style="background-color:#444444;" id="{option}">{content}</p>
</div>

edit: this thing ain’t perfect yet -just noticed a bug, and also a version where it just does colorize it without a button… needs some random stuff…


(Paul) #19

Thanks for the colors, I never included the real correct colors in my personal track :wink: Now I can put them correct.


(BlackEight) #20

Hey
I downloaded that pogram from here
http://ftp.freenet.de/pub/4players/h...eGenerator.zip.
Thats really nice thing and id love to put it into my modules on website but am still the beginner in website stuff. I dont really know what should i do with this now…

Am looking forward for you feedback.

Regards,
Karol