26horses Forum
0 Members and 0 Guests are viewing this board.
  • Opoil
  • Irregular
  • 34 posts
  • Reputation 9
  • Honourable
    Dishonourable
  • I love 26horses Productions
May 27 2022 11:47 am

an old script in php
<?php
session_start();
if (!$_SESSION['pseudo']) header("location : http://rlddlck.clawz.com/login.php");
$title="Travel Calculator";
require_once("haut.inc");
if (!$_SESSION['pseudo']) die ("<center><tr><td>You need Login <form action='login.php' method='post'><input type='hidden' name='pseudo' value =''><input type='submit' value='log in' class=text2 ></td></tr></table><tr><td></td><td align='left' valign='bottom'><img border='0' src='/images/vers2/coinbg.gif' width='50' height='50'></td><td></td><td align='right' valign='bottom'><img border='0' src='/images/vers2/coinbd.gif' width='50' height='50'></td></tr></table></body></html>");

?>
<form name='calculator'>
<table id='totale' align=center >
<tr>
<td>
<table id='start'>
<tr align=center>
<td colspan="3" bgcolor='#202060'><b>Start</b></td>
</tr>
<tr >
<td align=center bgcolor="#404040">X</td><td bgcolor="#404040" align=center>Y</td><td bgcolor="#404040" align=center>ID</td>
</tr>
<tr>
<td bgcolor="#305050" align=center>
<input type=text name="x_start" value="0" size=3 class=text onchange='calcul()'>
</td>
<td bgcolor="#305050" align=center>
<input type='text' name="y_start" value="0" size=3 class=text onchange='calcul()'>
</td>
<td bgcolor="#305050" align=center><select name='id_start' onchange='calcul()'>
<option value=1> 1
<option value=2> 2
<option value=3> 3
<option value=4> 4
<option value=5> 5
<option value=6> 6
<option value=7> 7
<option value=8> 8
<option value=9> 9
<option value=10> 10
<option value=11> 11
<option value=12> 12

</select>
</td>
</tr>
</table>
</td>
<td>
<table id='dest'>
<tr >
<td colspan="3" bgcolor='#202060' align="center"><b>Destination</b></td>
</tr>
<tr>
<td bgcolor="#404040" align=center>X</td><td bgcolor="#404040" align=center>Y</td><td bgcolor="#404040" align=center>ID</td>
</tr>
<tr align=center class="hlight">
<td bgcolor="#305050" align=center>
<input type='text' name="x_dest" value="0" size=3 class=text onchange='calcul()'>
</td>
<td bgcolor="#305050" align=center>
<input type='text' name="y_dest" value="0" size=3 class=text onchange='calcul()'>
</td>
<td><select name='id_dest' onchange='calcul()'>
<option value=1> 1
<option value=2> 2
<option value=3> 3
<option value=4> 4
<option value=5> 5
<option value=6> 6
<option value=7> 7
<option value=8> 8
<option value=9> 9
<option value=10> 10
<option value=11> 11
<option value=12> 12
</select>
</td>
</tr>
</table>
</td>
<td>
<table id='myrace'>
<tr align=center bgcolor='#202060'>
<td colspan="2" >
<b>My Race</b>
</td>
</tr>
<tr>
<td bgcolor="#404040" align=center>
Level Energy
</td>
<td bgcolor="#404040" align=center>
Speed Bonus race
</td>
</tr>
<tr>
<td bgcolor="#305050" align=center>
<input type='text' name="lvl_energy" value="0" size="3" class=text onchange='calcul()'>&nbsp;
</td>
<td bgcolor="#305050" align=center>
<select name='speed_bonus' onchange='calcul()'>
<option value=-68> -68%
<option value=-51> -51%
<option value=-34> -34%
<option value=-17> -17%
<option value=0 selected> 0%
<option value=17> 17%
<option value=34> 34%
<option value=51> 51%
<option value=68> 68%
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr align=center>
<td colspan="3">
the planet is mine or player of my alliance
<select name='planeteamoi' bgcolor="#305050" align=center onchange='calcul()'>
<option value=0 selected> no
<option value=1> yes
</select>
</td>
</tr>
<tr align=center>
<td colspan="3">
travel time :
<input type='text' name="result" size=20 class=text>
</td>
</tr>
<tr>
<td colspan="3" align=center>
<div id=gipi
style="position:relative; left:0"><--- Gipi Javascript ---></div>
</td>
</tr>
</table>
</form>

<?php
require_once("bas.inc");
?>


  • Opoil
  • Irregular
  • 34 posts
  • Reputation 9
  • Honourable
    Dishonourable
  • I love 26horses Productions
May 27 2022 11:55 am

<script type='text/JavaScript'>
function calcul()
{
id_start=Math.floor(document.forms[0].id_start.value);
x_start=Math.floor(document.forms[0].x_start.value);
y_start=Math.floor(document.forms[0].y_start.value);
id_dest=Math.floor(document.forms[0].id_dest.value);
x_dest=Math.floor(document.forms[0].x_dest.value);
y_dest=Math.floor(document.forms[0].y_dest.value);
speed_bonus=Math.floor(document.forms[0].speed_bonus.value)/100;
lvl_energy=Math.floor(document.forms[0].lvl_energy.value);
planeteamoi=Math.floor(document.forms[0].planeteamoi.value);
csteA=1155;
csteC=115.75;
csteB=14.15;
distsyst=((x_start-x_dest)*(x_start-x_dest))+((y_start-y_dest)*(y_start-y_dest));
distsyst=Math.sqrt(distsyst);
distplanet=Math.abs(id_start-id_dest);
dist=Math.sqrt((csteA*distsyst)+(csteC*distplanet))+csteB;
bonus=(1+speed_bonus)*(1+planeteamoi);
result=dist/bonus;
bonus=Math.pow(0.91,lvl_energy);
result=(result*bonus);
result=result/24;
jour=Math.floor(result);
result=(result-jour)*24;
heure = Math.floor(result);
result=(result-heure)*60;
minute=Math.floor(result);
result=(result-minute)*60;
seconde=Math.floor(result);
result="";
if (jour) result=jour+" d ";
result=result+heure+" h "+minute+" m "+seconde+" s";
document.calculator.result.value= result;
}
posgipi=-1
sensgipi=-1
gipi="<--- Gipi Javascript --->"
function bouge()
{
posgipi=posgipi+sensgipi
if ( posgipi < -170 )
{
sensgipi=1
posgipi=-169
}
if ( posgipi > 170 )
{
sensgipi=-1
posgipi=169
}
document.all.gipi.innerText = gipi
document.all.gipi.style.left=posgipi

setTimeout("bouge()",10)
}
</script>


  • Shadowing
  • Devoted
  • 1460 posts
  • Reputation 244
  • Honourable
    Dishonourable
  • Captain of the boat or captain of the Sea?
May 27 2022 12:04 pm

not really gonna work. The old game was pixel based. The game Engine I use uses something called units.


What ever you can do or dream you can always begin it because boldness has genius, power and magic in it
  • Opoil
  • Irregular
  • 34 posts
  • Reputation 9
  • Honourable
    Dishonourable
  • I love 26horses Productions
May 27 2022 12:41 pm

Yes i imagine it s not the same