[Realm Relay] Avatar Block, protects you against teleporting on top of the avatar

Posts 1–10 of 10 · Page 1 of 1
[Realm Relay] Avatar Block, protects you against teleporting on top of the avatar
Hey all. This script will save you from accidental teleports onto players using the infamous 0 speedhack with cheat engine. If you are within 1.1 tiles of the avatar, if you get hit by a shot, the script will it will block it, send a nexus, and disconnect you.

From my tests, it worked 100% of the time over 10+ tests on a 0/8 level 20 knight with tops, and it worked about 50% of the time over 6 tests on a level 1 trickster with no equips. You will have higher success rates playing on a server with low ping (close to you). On my level 1, I died more when I was on an EU server while I live in the US (but I still died on US servers sometimes, so I recommend being maxed).

I am in the process of porting it to K Relay.

Disclaimer: I am not responsible if you lose a character while using my script.

Code:
/* avatarblock.js by 059

UPDATE
	Tile[] tiles
	Entity[] newObjs
	int[] drops

Entity
	short objectType
	Status status

Status
	int objectId
	Location pos
	StatData[] data

Location
	float x
	float y
	float distanceSquaredTo(Location location)
	float distanceTo(Location location)
*/
var ID_MOVE = $.findPacketId("MOVE");
var ID_UPDATE = $.findPacketId("UPDATE");
var ID_ESCAPE = $.findPacketId("ESCAPE");
var ID_OTHERHIT = $.findPacketId("OTHERHIT");
var ID_PLAYERHIT = $.findPacketId("PLAYERHIT");

var myPos;
var block = false;
var avatarPos;
var avatarFound = false;

function onClientPacket(event) {
	var packet = event.getPacket();

	if (packet.id() == ID_MOVE) {
		myPos = packet.newPosition;
		if (avatarFound) {
			var dist = Math.sqrt(myPos.distanceSquaredTo(avatarPos));
			if (dist < 1.1) {
				block = true;
			} else
				block = false;
		}
	}

	if (block) {
		if (packet.id() == ID_PLAYERHIT) {
			event.cancel();
			event.sendToServer(event.createPacket(ID_ESCAPE));
			$.disconnect();
		}

		if (packet.id() == ID_SHOOTACK) {
			event.cancel();
			event.sendToServer(event.createPacket(ID_ESCAPE));
			$.disconnect();
		}

		if (packet.id() == ID_OTHERHIT) {
			event.cancel();
			event.sendToServer(event.createPacket(ID_ESCAPE));
			$.disconnect();
		}
	}
}

function onServerPacket(event) {
	var packet = event.getPacket();

	if (packet.id() == ID_UPDATE)
		if (!avatarFound)
			for (var x = 0; x < packet.newObjs.length; x++)
				if (packet.newObjs[x].objectType == 0x734d) {
					avatarFound = true;
					avatarPos = packet.newObjs[x].status.pos;
				}
}
Interesting, I'm gonna have to implement this into my auto nexus script.
Quote Originally Posted by 059 View Post
Hey all. This script will save you from accidental teleports onto players using the infamous 0 speedhack with cheat engine. If you are within 1.1 tiles of the avatar, if you get hit by a shot, the script will it will block it, send a nexus, and disconnect you.

From my tests, it worked 100% of the time over 10+ tests on a 0/8 level 20 knight with tops, and it worked about 50% of the time over 6 tests on a level 1 trickster with no equips. You will have higher success rates playing on a server with low ping (close to you). On my level 1, I died more when I was on an EU server while I live in the US (but I still died on US servers sometimes, so I recommend being maxed).

I am in the process of porting it to K Relay.

Disclaimer: I am not responsible if you lose a character while using my script.

Code:
/* avatarblock.js by 059

UPDATE
	Tile[] tiles
	Entity[] newObjs
	int[] drops

Entity
	short objectType
	Status status

Status
	int objectId
	Location pos
	StatData[] data

Location
	float x
	float y
	float distanceSquaredTo(Location location)
	float distanceTo(Location location)
*/
var ID_MOVE = $.findPacketId("MOVE");
var ID_UPDATE = $.findPacketId("UPDATE");
var ID_ESCAPE = $.findPacketId("ESCAPE");
var ID_OTHERHIT = $.findPacketId("OTHERHIT");
var ID_PLAYERHIT = $.findPacketId("PLAYERHIT");

var myPos;
var block = false;
var avatarPos;
var avatarFound = false;

function onClientPacket(event) {
	var packet = event.getPacket();

	if (packet.id() == ID_MOVE) {
		myPos = packet.newPosition;
		if (avatarFound) {
			var dist = Math.sqrt(myPos.distanceSquaredTo(avatarPos));
			if (dist < 1.1) {
				block = true;
			} else
				block = false;
		}
	}

	if (block) {
		if (packet.id() == ID_PLAYERHIT) {
			event.cancel();
			event.sendToServer(event.createPacket(ID_ESCAPE));
			$.disconnect();
		}

		if (packet.id() == ID_SHOOTACK) {
			event.cancel();
			event.sendToServer(event.createPacket(ID_ESCAPE));
			$.disconnect();
		}

		if (packet.id() == ID_OTHERHIT) {
			event.cancel();
			event.sendToServer(event.createPacket(ID_ESCAPE));
			$.disconnect();
		}
	}
}

function onServerPacket(event) {
	var packet = event.getPacket();

	if (packet.id() == ID_UPDATE)
		if (!avatarFound)
			for (var x = 0; x < packet.newObjs.length; x++)
				if (packet.newObjs[x].objectType == 0x734d) {
					avatarFound = true;
					avatarPos = packet.newObjs[x].status.pos;
				}
}
Would be very helpful with the shatters first boss blue bullets and ice spheres. If you get hit by one of the bullets you're basically dead so..
Quote Originally Posted by jakerofl View Post
Would be very helpful with the shatters first boss blue bullets and ice spheres. If you get hit by one of the bullets you're basically dead so..
The difference is those are avoidable because you can see when they spawn and you know what they are, teleporting onto an avatar doesn't kill you because of lack of skill, only lack of foresight.
Quote Originally Posted by 059 View Post
The difference is those are avoidable because you can see when they spawn and you know what they are, teleporting onto an avatar doesn't kill you because of lack of skill, only lack of foresight.
Oh believe me I know, I've lost my fair share of characters to that too (though 0 speed with CE? Pft. You dc after like 10 seconds. There are 2 more reliable ways that you can do it..). I was just saying it would make for an excellent anti-death mod for realmrelay, not that they were unfair or anything.
Great work man, it's always sad to see people losing their hard earned characters to a bunch of ce scrubs.

Funny that I'm saying this on a hacking forum.
Quote Originally Posted by luferac View Post
Great work man, it's always sad to see people losing their hard earned characters to a bunch of ce scrubs.

Funny that I'm saying this on a hacking forum.
You're right though.
Using CE and saying you're a leet pro coder isn't hacking.
nice work @059, you should release a K Relay version too
how to i add it by myself?
Quote Originally Posted by Jator View Post
how to i add it by myself?
Get realm relay, then save the text I put in the code section to the scripts folder in realm relay. Then start rr and connect to proxy server in game.
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?