Jump to content


Coding Problem


2 replies to this topic

#1 Lizze_twisted

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 28 December 2004 - 02:19 AM

I found a code which is almost what I wanted for my RPG site but when I added a few things it won't work. I'm pretty new with coding so I'm having a lot of problems. Can someone tell me what's wrong?

Quote

<script language="JAVASCRIPT">
Gender = new Array();
Occupation = new Array();
Vault Number = new Array();
Pet = new Array();
Wand = new Array();
Broom = new Array();
Patronus = new Array();
Animagus = new Array();
Apparition = new Array();
// Harry Potter Hack
//Made by muggleman

var sign = "";
var name = "Age";

var MID=[];
MID["Admin"]="1000"
Gender["Admin"]="Female"
Occupation["Admin"]="Ruler"
Vault Number[“Admin”]=”12”
Pet["Admin"]="Fish"
Wand["Admin"]=" Cherry, essence of Wood Rose, 12.5 inches"
Broom["Admin"]="Firebolt"
Patronus["Admin"]="God"
Animagus["Admin"]="God"
Apparition[“Admin”]= “Granted”
// DO NOT EDIT BELOW THIS LINE!!!!
// DO NOT EDIT BELOW THIS LINE!!!!

td=document.body.getElementsByTagName("TD")
for(i=0;i<td.length;i++) {
if((td[i].className=="post1"||td[i].className=="post2")&&td[i].innerHTML.match("Posts: ")&&td[i].width!="100%")
{
  sPost=td[i].getElementsByTagName("SPAN")[0]
  uname = td[i-2].innerHTML.replace(/<[^>]+>/g,"")
  if(MID[uname] > 0){ EXP = MID[uname] }
else{ EXP = 0 }

if(td[i].innerHTML.match(/group/i) && (td[i].className=="post2" || td[i].className=="post1") && (!td[i].width)) {
var midR="Group: " + td[i].innerHTML.split('Group: ')[1].split(/<br><\/span>/i)[0]
var topR=td[i].innerHTML.split('Group: ')[0]
NewCode = topR
NewCode +=  midR
NewCode +=  "<br />"+name + ": " + sign + EXP + "<br>"
if(Gender[uname] == "undefined"){Gender[uname]=="NONE"}
if(Occupation[uname] == "undefined"){Occupation[uname]=="NONE"}
if(Vault Number[uname] == "undefined"){Vault Number[uname]=="NONE"}
if(Pet[uname] == "undefined"){Pet[uname]=="NONE"}
if(Wand[uname] == "undefined"){Wand[uname]=="NONE"}
if(Broom[uname] == "undefined"){Broom[uname]=="NONE"}
if(Patronus[uname] == "undefined"){Patronus[uname]=="NONE"}
if(Animagus[uname] == "undefined"){Animagus[uname]=="NONE"}
if(Apparition[uname] == "undefined"){Apparition[uname]=="NONE"}
NewCode += "Gender: " + Gender[uname]
NewCode += "<br> Occupation: " + Occupation[uname]
NewCode += "<br> Vault Number: " + Vault Number[uname]
NewCode += "<br>Pet: " + Pet[uname]
NewCode += "<br>Wand: " + Wand[uname]
NewCode += "<br>Broom: " + Broom[uname]
NewCode += "<br>Patronus: " + Patronus[uname]
NewCode += "<br>Animagus: " +Animagus[uname]
NewCode += "<br> Apparition: " + Apparition[uname] + "<br>"
NewCode += "<br /><br /><img src='http://69.57.141.218/style_images/1/spacer.gif' alt='' width='160' height='1' />"
td[i].innerHTML = NewCode
}

  }
}
</SCRIPT>

When I place it in the Footer of my forum it doesn't seem to work.

Thanks very much.

#2 adam123

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 2,306 posts
  • Location:London, UK
  • Interests:Programming and stuff.

Posted 29 December 2004 - 05:23 PM

Where'd you get it from?

#3 Phyrriz

    Young Padawan

  • Members
  • Pip
  • 19 posts
  • Location:Sweden, Sundsvall
  • Interests:Doing some work in C++ or ASM, PHP/ASP.

Posted 17 September 2005 - 05:25 PM

adam123, on Dec 29 2004, 10:23 PM, said:

Where'd you get it from?
Some stupid script kiddie is messing with him/her!

Quote

// Harry Potter Hack //Made by muggleman
Don't think someone think a way to break Javascript codes with a harry potter hack.

On the topic: I don't think it'll work for you to just post it in the forum! :(





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users