Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

crazynarutard

crazynarutard Avatar

*****
Senior Studio Member

1,470


August 2005
Description: This code will add some RPG informations in your profile, view the previews for more information.
Creator: CrAzY_J
Instructions: There are 2 parts in this code, one should go in the Main footers and the other in the board footers. Edit the red colored areas if you want to. The red parts is the muliplication with the total posts to gain the rpg stat number. Behind the number I added a comment for which RPG stat you are changing the multiplication....
Previews: Preview1
Preview2
Preview3


Main Footers
<script type="text/javascript">
/* RPG Me V1.0 SL Version
Created by CrAzY_J
Do no redistribute this code without the creator's permission*/

var mmu = 5; //Money
var hmu = 4; // HP
var amu = 4; //MP
var smu = 2.5; //Stamina

/*Do not edit beyon this point*/
var TD = document.body.getElementsByTagName( "td" );
var TB = document.body.getElementsByTagName( "table" );

function AddRP()
{
if( TD.item(5).innerHTML.match(/admin/))
{
for( t = 0 ; t < TD.length ; t ++ )
{
if( TD.item(t).className == "titlebg" && TD.item(t).innerHTML.match(/Edit\sProfile/))
{
var Ahref = document.createElement( "a" );
Ahref.href = this.location.href+"&rp";
Ahref.appendChild( document.createTextNode( 'RPG Stats' ));
TD.item(t).getElementsByTagName( 'b' ).item(0).appendChild( document.createTextNode(' '));
TD.item(t).getElementsByTagName( 'b' ).item(0).appendChild( Ahref );
document.creator.usertext.parentNode.parentNode.parentNode.style.display = "none";
}
}
}
}

function EditRP()
{
for( z = 4 ; z < TB.length ; z ++ )
TB.item(z).style.display = "none";
document.title = "Edit RPG";
var Posts = parseInt(document.creator.settings6.value);
var Mon = (document.creator.usertext.value.match( /trm%m:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*mmu);
var Heal = (document.creator.usertext.value.match( /trm%.+?%h:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*hmu);
var Magic = (document.creator.usertext.value.match( /trm%.+?%a:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*amu);
var Stam = (document.creator.usertext.value.match( /trm%.+?%s:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*smu);
var cTB = '<table width = "" class = "bordercolor" cellSpacing = "1" cellPadding = "0" align = "center"><tr><td>'
cTB += '<table width "100%" cellPadding = "4" align = "center"><tr><td class = "titlebg" align = "center">'
cTB += '<font size = "2" class = "titletext"><b>RPG Stats:</b>'
cTB += '</font></td></tr></table></td></tr>'
cTB += '<tr><td><table width = "100%" cellPadding = "4" align = "center"><tr>'
cTB += '<td class = "windowbg" align = "center" width = "40%"><b>Money:</b></td>'
cTB += '<td class = "windowbg" align = "center" width = "30%"><input id = "mon" value = "'+Mon+'"></td>'
cTB += '<td class = "windowbg" align = "center" width = "10%"><a href = "javascript:add(\'mon\')">'
cTB += '<b>+</b></a>/<a href = "javascript:reduce(\'mon\')"><b>-</b></a><td></tr>'
cTB += '<tr><td class = "windowbg" align = "center" width = "40%"><b>Health Points:</b></td>'
cTB += '<td class = "windowbg" align = "center" width = "30%"><input id = "heal" value = "'+Heal+'"></td>'
cTB += '<td class = "windowbg" align = "center" width = "10%"><a href = "javascript:add(\'heal\')">'
cTB += '<b>+</b></a>/<a href = "javascript:reduce(\'heal\')"><b>-</b></a><td></tr>'
cTB += '<tr><td class = "windowbg" align = "center" width = "40%"><b>Magic Points:</b></td>'
cTB += '<td class = "windowbg" align = "center" width = "30%"><input id = "magic" value = "'+Magic+'"></td>'
cTB += '<td class = "windowbg" align = "center" width = "10%"><a href = "javascript:add(\'magic\')">'
cTB += '<b>+</b></a>/<a href = "javascript:reduce(\'magic\')"><b>-</b></a><td></tr>'
cTB += '<tr><td class = "windowbg" align = "center" width = "40%"><b>Stamin Points:</b></td>'
cTB += '<td class = "windowbg" align = "center" width = "30%"><input id = "stam" value = "'+Stam+'"></td>'
cTB += '<td class = "windowbg" align = "center" width = "10%"><a href = "javascript:add(\'stam\')">'
cTB += '<b>+</b></a>/<a href = "javascript:reduce(\'stam\')"><b>-</b></a></td></tr></table>'
cTB += '</td></tr><tr><td><table width "100%" cellPadding = "4" align="center"><tr><td class = "titlebg">'
cTB += '<b>Current password</b> <input type="password" id="pass"><br />'
cTB += '<input type = "button" value = "Reset All RPG Stats" onClick = "Reset()">'
cTB += '<input type = "button" value = "save RPG Settings" onClick = "savedata()"></td></tr></table></td></tr></table>';
document.write(cTB);
}

function Reset()
{
getId('mon').value = 0
getId('heal').value = 0
getId('magic').value = 0
getId('stam').value = 0
}
function savedata()
{
document.creator.usertext.value = "trm%m:" +getId('mon').value+ "%h:"+ getId('heal').value+ "%a:" +getId('magic').value+ "%s:"+ getId('stam').value +"%";
document.creator.cpass.value = getId('pass').value;
document.creator.submit(true);
}

function profile()
{
for( t = 0 ; t < TD.length ; t ++ )
{
if( TD.item(t).width == "30%" && TD.item(t).innerHTML.match(/Posts:\s(\d+)/))
{
var Posts = parseInt(RegExp.$1);
var Mon = ( TD.item(t).innerHTML.match( /trm%m:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*mmu);
var Heal = ( TD.item(t).innerHTML.match( /trm%.+?%h:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*hmu);
var Magic = ( TD.item(t).innerHTML.match( /trm%.+?%a:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*amu);
var Stam = ( TD.item(t).innerHTML.match( /trm%.+?%s:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*smu);
TD.item(t).innerHTML += "Money: "+ Mon +"<br />Health Points: "+ Heal +"<br />Magic Points: "+ Magic +"<br />Stamina: "+Stam;
TD.item(t).innerHTML = TD.item(t).innerHTML.replace(/trm%.+?s:\d+%/,'');
}
}
}


function add(elem)
{
getId(elem).value = Math.floor(parseInt(getId(elem).value) +1);
}

function reduce(elem)
{
getId(elem).value = Math.floor(parseInt(getId(elem).value) -1);
}

function getId(id)
{
return document.getElementById(id);
}
if(this.location.href.match(/profile&/))
AddRP();
if(this.location.href.match(/&rp/))
EditRP()
if(this.location.href.match(/view(profile(2)?)?/))
profile()
</script>



Board footers
<script type="text/javascript">
/* RPG Me V1.0 SL Version
Created by CrAzY_J
Do no redistribute this code without the creator's permission*/

var mmu = 5; //Money
var hmu = 4; // HP
var amu = 4; //MP
var smu = 2.5; //Stamina

/*Do not edit beyon this point*/
var TD = document.body.getElementsByTagName( "td" );
var TB = document.body.getElementsByTagName( "table" );


function miniprofile()
{
for( t = 0 ; t < TD.length ; t ++ )
{
if( TD.item(t).width == "20%" && TD.item(t).innerHTML.match(/Posts:\s(\d+)/))
{
var Posts = parseInt(RegExp.$1);
var Mon = ( TD.item(t).innerHTML.match( /trm%m:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*mmu);
var Heal = ( TD.item(t).innerHTML.match( /trm%.+?%h:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*hmu);
var Magic = ( TD.item(t).innerHTML.match( /trm%.+?%a:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*amu);
var Stam = ( TD.item(t).innerHTML.match( /trm%.+?%s:(\d+)%/ ))? RegExp.$1 : Math.floor(Posts*smu);
TD.item(t).innerHTML += "Money: "+ Mon +"<br />Health Points: "+ Heal +"<br />Magic Points: "+ Magic +"<br />Stamina: "+Stam;
TD.item(t).innerHTML = TD.item(t).innerHTML.replace(/trm%.+?s:\d+%/,'');
}
}
}

if(this.location.href.match(/display/))
miniprofile()
</script>

Enjoy


Last Edit: Jun 30, 2006 21:11:28 GMT by Chris

newBookmarkLockedFalling