KEMBAR78
Spawn Kill | PDF | Computer Programming | Programming Paradigms
0% found this document useful (0 votes)
34 views3 pages

Spawn Kill

The document contains C# code for a class named TELEKILL, which is part of a namespace called AotForms. It implements a method that continuously checks for the closest entity within a certain distance and manipulates game memory to interact with that entity. The code includes error handling and cancellation support for asynchronous operations.

Uploaded by

xzelvo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views3 pages

Spawn Kill

The document contains C# code for a class named TELEKILL, which is part of a namespace called AotForms. It implements a method that continuously checks for the closest entity within a certain distance and manipulates game memory to interact with that entity. The code includes error handling and cancellation support for asynchronous operations.

Uploaded by

xzelvo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

//// BY JNIYENx9999 ////

//// Watermark: https://discord.gg/TRMS3CXwJJ ////

using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Threading;
using System.Threading.Tasks;

namespace AotForms //// BY JNIYENx9999 ////


//// Watermark: https://discord.gg/TRMS3CXwJJ ////
{
internal static class TELEKILL
{
private static Task upPlayerTask;
private static CancellationTokenSource cts;
private static bool isRunning = false;

internal static void Work()


{
if (isRunning) return;
isRunning = true;

cts?.Dispose();
cts = new CancellationTokenSource();

upPlayerTask = Task.Run(async () =>


{
try
{
while (!cts.Token.IsCancellationRequested)
{
if (!Config.JNIYENSPAWNKILL)/// BY JNIYENx9999 ////
//// Watermark:
https://discord.gg/TRMS3CXwJJ ////
{
await Task.Delay(10, cts.Token);
continue;
}

var closestEntity = default(Entity);


var minDistance = float.MaxValue;

if (Core.Entities == null || !Core.Entities.Any())


{
await Task.Delay(10, cts.Token);
continue;
} /// BY
JNIYENx9999 ////
////
Watermark: https://discord.gg/TRMS3CXwJJ ////

foreach (var entity in Core.Entities.Values)


{
if (!entity.IsKnown || entity.IsDead ||
(Config.IgnoreKnocked && entity.IsKnocked))
continue;
var playerDistance =
Vector3.Distance(Core.LocalMainCamera, entity.Head);
if (playerDistance > 200) continue;

if (playerDistance < minDistance)


{
minDistance = playerDistance;
closestEntity = entity;
}
}
/// BY
JNIYENx9999 ////
////
Watermark: https://discord.gg/TRMS3CXwJJ ////
if (closestEntity != null)
{
try
{
var localRootBone =
InternalMemory.Read<uint>(Core.LocalPlayer + (uint)Bones.Root, out var
localRootBonePtr);
var localTransform =
InternalMemory.Read<uint>(localRootBonePtr + 0x8, out var localTransformValue);
var localTransformObj =
InternalMemory.Read<uint>(localTransformValue + 0x8, out var localTransformObjPtr);
var localMatrix =
InternalMemory.Read<uint>(localTransformObjPtr + 0x20, out var localMatrixValue);

var enemyRootBone =
InternalMemory.Read<uint>(closestEntity.Address + (uint)Bones.Root, out var
enemyRootBonePtr);
var enemyTransform =
InternalMemory.Read<uint>(enemyRootBonePtr + 0x8, out var enemyTransformValue);
var enemyTransformObj =
InternalMemory.Read<uint>(enemyTransformValue + 0x8, out var enemyTransformObjPtr);
var enemyMatrix =
InternalMemory.Read<uint>(enemyTransformObjPtr + 0x20, out var enemyMatrixValue);

if (!Transform.GetNodePosition(enemyRootBonePtr,
out var enemyRootTransform))
{
await Task.Delay(10, cts.Token);
continue;
}

InternalMemory.Write<Vector3>(localMatrixValue +
0x80, enemyRootTransform);
}
catch (Exception)
{
await Task.Delay(10, cts.Token);
continue;
}
}

await Task.Delay(10, cts.Token);


}
}
/// BY JNIYENx9999 ////
//// Watermark: https://discord.gg/TRMS3CXwJJ ////
catch (OperationCanceledException)
{
}
catch (Exception)
{
}
finally
{
isRunning = false;
}
}, cts.Token);
}
}
}

You might also like