Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[v1.3] Attack time calculator
#5
PHP Code:
<?php
$movement_speed 
0.5;
$server_speed 32;
$unit_speed 720;

$x1 = ;
$y1 = ;

$x2 = ;
$y2 = ;

function 
calc_dist($x1,$y1,$x2,$y2){
    
$a $x1 $x2;
    
$b $y1 $y2;
    
$dist sqrt(($a*$a)+($b*$b));
    return 
$dist;    
}

$distance calc_dist($x1,$y1,$x2,$y2);
$time = (($distance $unit_speed)/$movement_speed)/$server_speed;

function 
minutes$seconds ){
    return 
sprintf"%02.2d:%02.2d"floor$seconds 60 ), $seconds 60 );
}

echo 
minutes($time);
?>

527|527 attack 525|524
My time: 02:42
Server time: 02:52

527|527 attack 525|523
My time: 03:21
Server time: 03:37

Reply


Messages In This Thread
Attack time calculator - by kala - 11.05.2011, 18:18
RE: Attack time calculator - by SlimShady95 - 11.05.2011, 19:46
RE: Attack time calculator - by kala - 13.05.2011, 16:23
RE: Attack time calculator - by SlimShady95 - 13.05.2011, 16:30
RE: Attack time calculator - by kala - 13.05.2011, 16:57
RE: Attack time calculator - by SlimShady95 - 13.05.2011, 17:19



Users browsing this thread: 2 Guest(s)