Arkadaşlar merhaba, web tabanlı bir oyun (haxball) için internetten aldığım bu kodu autohotkey adlı uygulama ile çalıştırmayı denediğim sırada fotoğraftaki gibi bir hata alıyorum. Acaba autohotkey yanlış bir seçim mi ya da kodlarda mı sıkıntı var Yardımcı Olursanız Sevinirim TEŞEKKÜRLER...
function CalcAngle (PP, EP)
{
//FIND ANGLE
}
function CalcDist(me_pos, them_pos){
return Math.sqrt(
(me_pos[0] - them_pos[0])**2 +
(me_pos[1] - them_pos[1])**2 +
(me_pos[2] - them_pos[2])**2)
}
function GetPlayerClosest(my_pos){
tempdistance = []
for (i=0;i<=players.length;i++){
if (players[i] != null){
if (players[i]["hp"] > 0){
their_pos = [players[i]["x"], players[i]["y"], players[i]["z"]]
if (players[i]["id"] != me.id){
if (tempdistance.length <= 0){
tempdistance = [CalcDist(my_pos, their_pos), players[i]["name"], their_pos];
}else if(CalcDist(my_pos, their_pos) < tempdistance[0]){
tempdistance = [CalcDist(my_pos, their_pos), players[i]["name"], their_pos];
}
}
}
}
}
return tempdistance;
}
window.setInterval(function(){
cur_pos = [me.x, me.y, me.z];
//console.log(CalcDist(cur_pos, [3.25, 1, 11.25]));
nearest = GetPlayerClosest(cur_pos);
CalcAngle(cur_pos, nearest[2]);
}, 1);