game/enter2.php

78 lines
2.2 KiB
PHP

<!DOCTYPE>
<html lang="ru">
<head><title></title></head>
<body>
Запрос второго пароля к персонажу.<br><br>
<img id="pass" onClick="" width="295" src="i/pin/e0.png" alt=""><br><br>
<img id="p1" alt="" src=""><img id="p2" alt="" src=""><img id="p3" alt="" src=""><br>
<img id="p4" alt="" src=""><img id="p5" alt="" src=""><img id="p6" alt="" src=""><br>
<img id="p7" alt="" src=""><img id="p8" alt="" src=""><img id="p9" alt="" src=""><br>
<img onClick="keypush(12);" src="i/pin/12.png" alt="">
<img id="p0" name="image" src="" alt="">
<img onClick="keypush(11);" src="i/pin/11.png" alt="">
<br>
<div id="text"></div>
</body>
<script>
var dopass = '';
var tdopass = '';
var lenth = 0;
randomp();
function randomp() {
var ss = new Array();
var n = 0;
while (n < 10) {
ss[n] = n;
n++;
}
var i = 0;
var k = 0;
var m = 0;
var tmpp = 0;
while (i < 10) {
k = getRandomInt(10);
m = getRandomInt(10);
if (k != m) {
tmpp = ss[k];
ss[k] = ss[m];
ss[m] = tmpp;
i++;
}
}
n = 10;
while (n > -1) {
n = n - 1;
document.getElementById('p' + n).setAttribute("src", "i/pin/" + ss[n] + ".png");
document.getElementById('p' + n).setAttribute("onClick", "keypush(" + ss[n] + ");");
}
}
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
function keypush(n) {
if (n == 12) {
if (lenth > 0) {
dopass = '';
lenth = 0;
document.getElementById('pass').setAttribute("src", "i/pin/e" + lenth + ".png");
}
} else if (n == 11) {
//document.getElementById("text").innerHTML = ''+dopass;
println(dopass);
} else {
if (lenth < 8) {
dopass = dopass + '' + n;
lenth++;
document.getElementById('pass').setAttribute("src", "i/pin/e" + lenth + ".png");
}
}
}
</script>
</html>