Why oh why will those text boxes not refresh? I can’t even get them to change for any reason, I’ve tried deleting all the functions and just leaving the text boxes, but they won’t change even then.
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title>Adventure</title>
<script type=”text/javascript”>
dec = 0; dun = 0; cha = 0;
bat = 0; scen = 0; sscen = 0; mscen = 1;
function random(maxnum)
{
r = Math.random() * maxnum;
if (r > maxnum)
r = maxnum;
return r;
}
function init()
{
refresh();
}
function round(number)
{
r = number;
r = Math.round(r);
return r;
}
function refresh()
{
if (bat == 0)
{
if (scen == 0)
{
sscen = 0;
scen = round(random(mscen – 1)) + 1;
}
if (scen == -1)
{
sscen = 0;
form.maintext.value = “You are dead!”;
form.optonetext.value = “Play again?”;
form.opttwotext.value = “”:
form.optthrtext.value = “”:
form.optfoutext.value = “”;
form.optfivtext.value = “”;
}
if (scen == 1)
{
if (sscen == 0)
{
form.maintext.value = “There is an ogre attacking you.”;
form.optonetext.value = “Flee!”;
form.opttwotext.value = “Fight him.”;
form.optthrtext.value = “Mating Season!”;
form.optfoutext.value = “”;
form.optfivtext.value = “”;
}else if (sscen == 1)
{
form.maintext.value = “He catches you and eats you.”;
form.optonetext.value = “Continue.”;
form.opttwotext.value = “”;
form.optthrtext.value = “”;
form.optfoutext.value = “”;
form.optfivtext.value = “”;
}
}
}
}
function optionOne()
{
if (scen == -1)
{
scen = 0; bat = 0;
init();
}
if (scen == 1)
{
if (sscen == 0)
{
sscen = 1;
}else if (sscen == 1)
{
scen = -1;
}
}
refresh();
}
function optionTwo()
{
}
function optionThr()
{
}
function optionFou()
{
}
function optionFiv()
{
}
function chanceOutOf(num)
{
rer = num;
der = 0;
cer = random(1);
con = 1/rer;
if (cer <= con)
der = 1;
return der
}
</script>
</head>
<body onload=”init()”>
<center>
<form name=”form” id=”form” action=””>
<textarea cols=”50″ rows=”4″ name=”maintext” value=”There is an ogre attacking you.”></textarea>
<br>
<input type=”button” value=”Option 1.” onclick=”optionOne()”>
<br>
<textarea cols=”20″ rows=”1″ name=”optonetext” value=”Flee!”></textarea>
<br>
<input type=”button” value=”Option 2.” onclick=”optionTwo()”>
<br>
<textarea cols=”20″ rows=”1″ name=”opttwotext” value=”Fight him.”></textarea>
<br>
<input type=”button” value=”Option 3.” onclick=”optionThr()”>
<br>
<textarea cols=”20″ rows=”1″ name=”optthrtext” value=”Mating Season!”></textarea>
<br>
<input type=”button” value=”Option 4.” onclick=”optionFou()”>
<br>
<textarea cols=”20″ rows=”1″ name=”optfoutext” value=”BLAGH!”></textarea>
<br>
<input type=”button” value=”Option 5.” onclick=”optionFiv()”>
<br>
<textarea cols=”20″ rows=”1″ name=”optfivtext” value=””></textarea>
<br>
<input type=”button” value=”Refresh.” onclick=”refresh()”>
</form>
</center>
</body>
</html>