Click to See Complete Forum and Search --> : puzzle attempts


tinernet
07-07-2003, 07:11 AM
i am tryin to make a puzzle site and im so far doin ok. i am tryin to get this particular puzzle to work with 3 attempts, and i have tried usina varibale that counts down but im havin no luck. help! here is the page:
http://members.lycos.co.uk/toprockspots/level3.html
any help would be greatly appreciated!

Nevermore
07-07-2003, 07:27 AM
Untested but should work:

<html>
<head>
<title>HaCkThEmAtRiX ClEaRaNcE LeVeL 2...</title>
<script language="javascript">
var try = 3;
function valpuzz() {
if(document.puzz1.valpuzz1.value == "there is no reality"&&document.puzz2.valpuzz2.value == "v4h5da"&&document.id.valid.value == "neo") {
alert('Authentication accepted. Level 3 clearance granted.');
elseif(try > 0) {
alert('You have ' + try + ' attempts remaining);
}
elseif(try == 0) {
alert('You have been traced. Agents are coming...');
}
}
</script>
</head>
<body style="background:black;font-family:OCR A Extended;color:green;font-size:13px">
<div align=center>
Authentication required. Complete the puzzles. You have 3 minutes:
</div>
<div align=center>
&nbsp;</div>
<div align=center>
&nbsp;</div>

<div align=center>
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="85%" id="AutoNumber1">
<tr>
<td width="4%" align="center"><b>h</b></td>
<td width="4%" align="center"><b>s</b></td>
<td width="4%" align="center"><b>i</b></td>
<td width="4%" align="center"><b>o</b></td>

<td width="4%" align="center"><b>t</b></td>
<td width="4%" align="center"><b>e</b></td>
<td width="4%" align="center"><b>r</b></td>
<td width="4%" align="center"><b>t</b></td>
<td width="4%" align="center"><b>i</b></td>
<td width="4%" align="center"><b>y</b></td>

<td width="4%" align="center"><b>r</b></td>
<td width="4%" align="center"><b>e</b></td>
<td width="4%" align="center"><b>n</b></td>
<td width="4%" align="center"><b>e</b></td>
<td width="4%" align="center"><b>a</b></td>
<td width="4%" align="center"><b>l</b></td>

</tr>
</table>
</center>
<br><br>
=&nbsp;&nbsp;<form name="puzz1"><input type=text name="valpuzz1" size=20 style="color:green;background:black;font-family:OCR A Extended;border:solid 1px white"></form>
<br><br>
<map name="puzz">
<area shape="rect" coords="115,10,186,110" onclick="document.puzz2.valpuzz2.value='h47scg'">
<area shape="rect" coords="230,11,341,106" onclick="document.puzz2.valpuzz2.value='v4h5da'">
<area shape="rect" coords="379,7,452,111" onclick="document.puzz2.valpuzz2.value='vb36cs'">
</map>
<img src="puzz.gif" border=none usemap="#puzz">
<form name="puzz2"><input type=text name="valpuzz2" size=20 style="color:green;background:black;font-family:OCR A Extended;border:solid 1px white"></form>

<br><br>
Enter your id:&nbsp;<form name="id"><input type=text name="valid" size=20 style="color:green;background:black;font-family:OCR A Extended;border:solid 1px white"><br><br><input type=button onclick="passprot()" value="Validate" style="background:darkgreen;color:white;font-family:OCR A Extended">
</form>
</div>
</body>
</html>

Nevermore
07-07-2003, 07:40 AM
Try this actually:


<html>
<head>
<title>
<html>
<head>
<title>HaCkThEmAtRiX ClEaRaNcE LeVeL 2...</title>
<script type="text/javascript">
tries=2;
function passprot() {
if(document.puzz1.valpuzz1.value == "there is no reality"&&document.puzz2.valpuzz2.value == "v4h5da"&&document.id.valid.value == "neo")
alert('Authentication accepted. Level 3 clearance granted.');
else if(tries > 0) { alert('You have ' + tries + ' attempts remaining'); tries--;}
else if(tries == 0) alert('You have been traced. Agents are coming...');
}
</script>
</head>
<body style="background:black;font-family:OCR A Extended;color:green;font-size:13px">
<div align=center>
Authentication required. Complete the puzzles. You have 3 minutes:
</div>
<div align=center>
</div>
<div align=center>
</div>

<div align=center>
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="85%" id="AutoNumber1">
<tr>
<td width="4%" align="center"><b>h</b></td>
<td width="4%" align="center"><b>s</b></td>
<td width="4%" align="center"><b>i</b></td>
<td width="4%" align="center"><b>o</b></td>

<td width="4%" align="center"><b>t</b></td>
<td width="4%" align="center"><b>e</b></td>
<td width="4%" align="center"><b>r</b></td>
<td width="4%" align="center"><b>t</b></td>
<td width="4%" align="center"><b>i</b></td>
<td width="4%" align="center"><b>y</b></td>

<td width="4%" align="center"><b>r</b></td>
<td width="4%" align="center"><b>e</b></td>
<td width="4%" align="center"><b>n</b></td>
<td width="4%" align="center"><b>e</b></td>
<td width="4%" align="center"><b>a</b></td>
<td width="4%" align="center"><b>l</b></td>

</tr>
</table>
</center>
<br><br>
= <form name="puzz1"><input type=text name="valpuzz1" size=20 style="color:green;background:black;font-family:OCR A Extended;border:solid 1px white"></form>
<br><br>
<map name="puzz">
<area shape="rect" coords="115,10,186,110" onclick="document.puzz2.valpuzz2.value='h47scg'">
<area shape="rect" coords="230,11,341,106" onclick="document.puzz2.valpuzz2.value='v4h5da'">
<area shape="rect" coords="379,7,452,111" onclick="document.puzz2.valpuzz2.value='vb36cs'">
</map>
<img src="puzz.gif" border=none usemap="#puzz">
<form name="puzz2"><input type=text name="valpuzz2" size=20 style="color:green;background:black;font-family:OCR A Extended;border:solid 1px white"></form>

<br><br>
Enter your id: <form name="id"><input type=text name="valid" size=20 style="color:green;background:black;font-family:OCR A Extended;border:solid 1px white"><br><br><input type=button onclick="passprot()" value="Validate" style="background:darkgreen;color:white;font-family:OCR A Extended">
</form>
</div>
</body>
</html>
Changes:

elseif changed to else if
redundant brackets removed
function name repaired
curly bracket order fixed
= changed to ==
Fake counter increment fixed
Correct script declaration added

Notes: Should use CSS not bgcolor="" etc
Shouldnt use tables for layout
Scripts aren't declared using language="" any more
Green on black is low contrast and an alternative should really be given.