muhtemelen THREE tabanlı bir oyun oyunun içerisinde kendi aimassist modülü var ama mobildeyken çalışıyor pcdeyken çalışmıyor.
aimAssistScanTarget() {
this.aimAssistTarget = null;
const e = this.clientGame.camera
, t = this.clientGame.physics
, n = this.clientGame.ecs.getEntities()
, r = e.position
, s = this.clientGame.cameraOrientation.getWorldDirection()
, o = oo(this.clientGame.gameMode);
let a = null;
if (!o) {
for (const y of n)
if (y.hasComponent(rn)) {
const v = y.getComponent(ps);
v && (a = v.value);
break
}
if (a === null)
return
}
const l = et.degToRad(this.AIM_ASSIST_ANGLE_THRESHOLD)
, d = Math.cos(l);
let c = -1
, h = null;
for (const y of n) {
if (!y.hasComponent(si) || y.hasComponent(rn) || y.hasComponent(Fn))
continue;
if (!o) {
const M = y.getComponent(ps);
if (!M || M.value === a)
continue
}
const v = y.getComponent(on);
if (!v)
continue;
const g = t.playerIdToPosition.get(v.id);
if (!g)
continue;
this.aaChest.set(g.x, g.y + .2, g.z),
this.aaDir.copy(this.aaChest).sub(r);
const b = this.aaDir.length();
if (b > this.AIM_ASSIST_MAX_RANGE || b < .5)
continue;
this.aaDir.divideScalar(b);
const x = this.aaDir.dot(s);
x < d || x > c && (c = x,
h = y)
}
if (!h)
return;
const u = h.getComponent(on)
, p = t.playerIdToPosition.get(u.id);
this.aaChest.set(p.x, p.y + .2, p.z),
this.aaDir.copy(this.aaChest).sub(r);
const m = this.aaDir.length();
this.aaDir.divideScalar(m),
this.aaRay.origin.x = r.x,
this.aaRay.origin.y = r.y,
this.aaRay.origin.z = r.z,
this.aaRay.dir.x = this.aaDir.x,
this.aaRay.dir.y = this.aaDir.y,
this.aaRay.dir.z = this.aaDir.z,
t.world.castRay(this.aaRay, m, !1, void 0, Re.STATIC_ONLY_GROUP) === null && (this.aimAssistTarget = h)
}
aimAssistApplyPull(e) {
if (!this.aimAssistTarget)
return;
if (this.aimAssistTarget.hasComponent(Fn))
return void (this.aimAssistTarget = null);
const t = this.aimAssistTarget.getComponent(on);
if (!t)
return void (this.aimAssistTarget = null);
const n = this.clientGame.physics.playerIdToPosition.get(t.id);
if (!n)
return void (this.aimAssistTarget = null);
const r = this.clientGame.camera;
this.aaChest.set(n.x, n.y + .2, n.z),
this.aaDir.copy(this.aaChest).sub(r.position);
const s = this.aaDir.length();
if (s < .1)
return;
this.aaDir.divideScalar(s);
const o = Math.atan2(-this.aaDir.x, -this.aaDir.z)
, a = Math.asin(this.aaDir.y)
, l = r.rotation.y
, d = r.rotation.x;
let c = o - l;
for (; c > Math.PI; )
c -= 2 * Math.PI;
for (; c < -Math.PI; )
c += 2 * Math.PI;
const h = a - d
, u = et.degToRad(this.AIM_ASSIST_PULL_SPEED) * e
, p = et.clamp(c, -u, u)
, m = et.clamp(h, -u, u);
r.rotation.y += p,
r.rotation.x += m;
const y = et.degToRad(89);
r.rotation.x = et.clamp(r.rotation.x, -y, y),
this.clientGame.cameraOrientation.update()
}
bunları tampermonkey aracılığıyla nasıl çalıştırırım?
aimAssistScanTarget() {
this.aimAssistTarget = null;
const e = this.clientGame.camera
, t = this.clientGame.physics
, n = this.clientGame.ecs.getEntities()
, r = e.position
, s = this.clientGame.cameraOrientation.getWorldDirection()
, o = oo(this.clientGame.gameMode);
let a = null;
if (!o) {
for (const y of n)
if (y.hasComponent(rn)) {
const v = y.getComponent(ps);
v && (a = v.value);
break
}
if (a === null)
return
}
const l = et.degToRad(this.AIM_ASSIST_ANGLE_THRESHOLD)
, d = Math.cos(l);
let c = -1
, h = null;
for (const y of n) {
if (!y.hasComponent(si) || y.hasComponent(rn) || y.hasComponent(Fn))
continue;
if (!o) {
const M = y.getComponent(ps);
if (!M || M.value === a)
continue
}
const v = y.getComponent(on);
if (!v)
continue;
const g = t.playerIdToPosition.get(v.id);
if (!g)
continue;
this.aaChest.set(g.x, g.y + .2, g.z),
this.aaDir.copy(this.aaChest).sub(r);
const b = this.aaDir.length();
if (b > this.AIM_ASSIST_MAX_RANGE || b < .5)
continue;
this.aaDir.divideScalar(b);
const x = this.aaDir.dot(s);
x < d || x > c && (c = x,
h = y)
}
if (!h)
return;
const u = h.getComponent(on)
, p = t.playerIdToPosition.get(u.id);
this.aaChest.set(p.x, p.y + .2, p.z),
this.aaDir.copy(this.aaChest).sub(r);
const m = this.aaDir.length();
this.aaDir.divideScalar(m),
this.aaRay.origin.x = r.x,
this.aaRay.origin.y = r.y,
this.aaRay.origin.z = r.z,
this.aaRay.dir.x = this.aaDir.x,
this.aaRay.dir.y = this.aaDir.y,
this.aaRay.dir.z = this.aaDir.z,
t.world.castRay(this.aaRay, m, !1, void 0, Re.STATIC_ONLY_GROUP) === null && (this.aimAssistTarget = h)
}
aimAssistApplyPull(e) {
if (!this.aimAssistTarget)
return;
if (this.aimAssistTarget.hasComponent(Fn))
return void (this.aimAssistTarget = null);
const t = this.aimAssistTarget.getComponent(on);
if (!t)
return void (this.aimAssistTarget = null);
const n = this.clientGame.physics.playerIdToPosition.get(t.id);
if (!n)
return void (this.aimAssistTarget = null);
const r = this.clientGame.camera;
this.aaChest.set(n.x, n.y + .2, n.z),
this.aaDir.copy(this.aaChest).sub(r.position);
const s = this.aaDir.length();
if (s < .1)
return;
this.aaDir.divideScalar(s);
const o = Math.atan2(-this.aaDir.x, -this.aaDir.z)
, a = Math.asin(this.aaDir.y)
, l = r.rotation.y
, d = r.rotation.x;
let c = o - l;
for (; c > Math.PI; )
c -= 2 * Math.PI;
for (; c < -Math.PI; )
c += 2 * Math.PI;
const h = a - d
, u = et.degToRad(this.AIM_ASSIST_PULL_SPEED) * e
, p = et.clamp(c, -u, u)
, m = et.clamp(h, -u, u);
r.rotation.y += p,
r.rotation.x += m;
const y = et.degToRad(89);
r.rotation.x = et.clamp(r.rotation.x, -y, y),
this.clientGame.cameraOrientation.update()
}
bunları tampermonkey aracılığıyla nasıl çalıştırırım?

