Jump to content

Js Error?


EmperorZenos

Recommended Posts

Whenever U try to utilize my script (in anyway) the script fails to do anything. My JavaScript debugger (FireBug) says that there's a syntax error somewhere, but I can't spot where.

// START Universal Variablesvar wea="IROSWO";var en="\n";// END Universal Variables// START STATSvar statATK=0;var statHP=15;var statDEF=4;var statEXP=0;var statLVL=1;var statMP=5;// END STATS// START COMMANDSfunction func() {var line=document.getElementById("command").value;var g=document.getElementById("Constue").value+line;if (line=="cls") {document.getElementById("Constue").value="";}if (line=="equip \"Iron Hammer\"") {document.getElementById("Constue").value=g+"\n";document.getElementById("WEAP").src="wea_hm.gif";document.getElementById("wea_name").innerHTML="Iron Hammer";var wea="IROHAM";}if (line=="equip \"Iron Sword\"") {document.getElementById("Constue").value=g+"\n";document.getElementById("WEAP").src="wea_sw.gif";document.getElementById("wea_name").innerHTML="Iron Sword";var wea="IROSWO";}} // END COMMANDS// START STAT MODS	// IRON SWORD	if (wea=="IROSWO") {		if (statATK!=0) {			var statA2=statATK-statATK;			var statATK=statA2+5;			}		}		else		{			var statATK=0+5;		}	var curwea="Iron Sword";	}		// IRON HAMMER	if (wea=="IROHAMMER") {		if (statATK!=0) {			var statA2=statATK-statATK;			var statATK=statA2+6;		}		else		{			var statATK=0+6;		}	var curwea="Iron Sword";	}// END STAT MODS// START STAT SHOWfunction s() {	alert("HP: "+statHP+en+"Attack: "+statATK+en+"Defense: "+statDEF+en+"Experience: "+statEXP+en);}// END STAT SHOW	

Here's the address of the script in case it is of any use: http://swordshieldco.site50.net/DFTPX/ui.html

Link to comment
Share on other sites

Firebug tells you the line number :)

	if (wea=="IROSWO") {		if (statATK!=0) {			var statA2=statATK-statATK;			var statATK=statA2+5;			}		}		else		{			var statATK=0+5;		}	var curwea="Iron Sword";	} //<--------- See the error now?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...