Silent aim in scripts

Avatar

By soulplexis 3 August 2019 19:16

Donator · 435 comments

how do you do it? i try

//to show that i have the randomint thing here:
function randomIntFrom(min,max) // Get a random integer from [min] to [max] 
{
    return Math.floor(Math.random()*(max-min+1)+min);
}
//ok so this:
var packet = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook');

mc.thePlayer.sendQueue.addToSendQueue(new packet(randomIntFrom(-90,90), randomIntFrom(0,360), true) );

【ソルプレクサス】

Avatar

By Sms_Gamer_3808 3 August 2019 19:34

Member · 577 comments
soulplexis wrote

how do you do it? i try

//to show that i have the randomint thing here:
function randomIntFrom(min,max) // Get a random integer from [min] to [max] 
{
    return Math.floor(Math.random()*(max-min+1)+min);
}
//ok so this:
var packet = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook');

mc.thePlayer.sendQueue.addToSendQueue(new packet(randomIntFrom(-90,90), randomIntFrom(0,360), true) );

that won't work as the client is sending 2 packets, one is (new packet(randomIntFrom(-90,90), randomIntFrom(0,360), true) and the other is the one that vanilla would send. It is not possible in the ScriptApi (that I know of) to do what you're asking because you would have to prevent the client from sending that packet.


I don't exist

Avatar

By Shiv3R 4 August 2019 15:16

Member · 178 comments

of course its possible!

    this.onPacket = function(event){
      var packet = event.getPacket();

      if (packet instanceof C05PacketPlayerLook)
      {
        event.cancelEvent();
      }

    };

Avatar

By Sms_Gamer_3808 4 August 2019 15:30

Member · 577 comments
Shiv3R wrote

of course its possible!

    this.onPacket = function(event){
      var packet = event.getPacket();

      if (packet instanceof C05PacketPlayerLook)
      {
        event.cancelEvent();
      }

    };

oof forgot about the on packet thing


I don't exist

Avatar

By Shiv3R 4 August 2019 15:39

Member · 178 comments
Sms_Gamer_3808 wrote
Shiv3R wrote

of course its possible!

    this.onPacket = function(event){
      var packet = event.getPacket();

      if (packet instanceof C05PacketPlayerLook)
      {
        event.cancelEvent();
      }

    };

oof forgot about the on packet thing

that don't work well for me, its not working everytime and sometimes it don't even move head by packets hmm

Avatar

By yorik100 4 August 2019 18:22

Member · 293 comments
Shiv3R wrote
Sms_Gamer_3808 wrote
Shiv3R wrote

of course its possible!

    this.onPacket = function(event){
      var packet = event.getPacket();

      if (packet instanceof C05PacketPlayerLook)
      {
        event.cancelEvent();
      }

    };

oof forgot about the on packet thing

that don't work well for me, its not working everytime and sometimes it don't even move head by packets hmm

Because it may not be the right packet, I mean, I know another packet that sends position and head rotations and the same time, maybe it's this packet sent every ticks

Avatar

By soulplexis 4 August 2019 20:00

Donator · 435 comments
yorik100 wrote
Shiv3R wrote
Sms_Gamer_3808 wrote

oof forgot about the on packet thing

that don't work well for me, its not working everytime and sometimes it don't even move head by packets hmm

Because it may not be the right packet, I mean, I know another packet that sends position and head rotations and the same time, maybe it's this packet sent every ticks

works fine for me, like this:

    this.onPacket = function(event){
      var packet = event.getPacket();

      if (packet instanceof C05PacketPlayerLook)
      {
        event.cancelEvent();
      }
this.onMotion = function() {
mc.thePlayer.sendQueue.addToSendQueue(new lookpacket(pitch, yaw, onground );
}

heck i didn't even need to use function(event), but then again any silent-aiming module seems to cause morepackets flags.. maybe that is why


【ソルプレクサス】

Avatar

By Shiv3R 5 August 2019 06:53

Member · 178 comments
yorik100 wrote
Shiv3R wrote
Sms_Gamer_3808 wrote

oof forgot about the on packet thing

that don't work well for me, its not working everytime and sometimes it don't even move head by packets hmm

Because it may not be the right packet, I mean, I know another packet that sends position and head rotations and the same time, maybe it's this packet sent every ticks

I know that you say about C06PacketPlayerPosLook, by stopping it you must send 2x packets 1x of C05PacketPlayerLook and 1x of C04PacketPlayerPosition

Avatar

By Shiv3R 5 August 2019 07:20

Member · 178 comments

or you will just get it clientsided

Avatar

By Shiv3R 5 August 2019 07:31

Member · 178 comments

Ok i found an fix but it send many packets ;/
onPacket stop C06PacketPlayerPosLook
onMotion send silent yaw/pitch and send position packet (C05PacketPlayerLook  & C04PacketPlayerPosition)
and then its server-sided

Avatar

By BestNub 7 August 2019 00:34

Member · 23 comments

I have tried your recommendations, but I ran into the same Problem. I think if the onPacket part would work, it should be fine.

var scriptName = "SilentAim";
var scriptVersion = 1.0;
var scriptAuthor = "not me";

var silentAim = new silentAim();

var client;

var lookpacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook');
var pospacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition');
var poslookpacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook');

function randomIntFrom(min, max) {
    return Math.floor(Math.random() * (max - min + 1) + min);
}

function silentAim() {
    this.getName = function () {
        return "SilentAim";
    };

    this.getDescription = function () {
        return "SilentAimTest";
    };

    this.getCategory = function () {
        return "Misc";
    };

    this.onPacket = function (event) {
        //this part does not work for me

        /*var packet = event.getPacket();

        if (packet instanceof C06PacketPlayerPosLook) {
            event.cancelEvent();
        }*/
    };
    this.onMotion = function () {


        //Probably not a good solution, but NCP does not spam Net_Keppalivefrequency ...
        if (mc.thePlayer.ticksExisted % randomIntFrom(2, 3) == 0)

            //I have tried it with two and with one package: Its the same

            //mc.thePlayer.sendQueue.addToSendQueue(new lookpacket(randomIntFrom(0, 360), randomIntFrom(-30, 30), mc.thePlayer.isOnGround));
            //mc.thePlayer.sendQueue.addToSendQueue(new pospacket(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, mc.thePlayer.isOnGround));
            mc.thePlayer.sendQueue.addToSendQueue(new poslookpacket(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, randomIntFrom(0, 360),
                randomIntFrom(-90, 90), mc.thePlayer.isOnGround));

    };
}

function onEnable() {
    client = moduleManager.registerModule(silentAim);
}

function onDisable() {
    moduleManager.unregisterModule(client);
}
Avatar

By Sms_Gamer_3808 7 August 2019 00:38

Member · 577 comments
this.onPacket = function(event) {
    // Code in here will be executed when the client receives a packet

    event.cancelEvent() // Cancels the event
    event.isCancelled() // Whether the event has been cancelled

    var packet = event.getPacket();
};

It's when u get a packet, not when you send one.
https://github.com/CCBlueX/LiquidBounce … om-Modules

Last edited by Sms_Gamer_3808 (7 August 2019 00:39)


I don't exist

Avatar

By BestNub 7 August 2019 00:42

Member · 23 comments
Sms_Gamer_3808 wrote
this.onPacket = function(event) {
    // Code in here will be executed when the client receives a packet

    event.cancelEvent() // Cancels the event
    event.isCancelled() // Whether the event has been cancelled

    var packet = event.getPacket();
};

It's when u get a packet, not when you send one.
https://github.com/CCBlueX/LiquidBounce … om-Modules

As you might see, I am dumb as hell...

Avatar

By yorik100 7 August 2019 02:41

Member · 293 comments
var C06PlayerPacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook');
var C04PacketPlayerPosition = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition')
var C05PacketPlayerLook = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook');
var C03PacketPlayer = Java.type('net.minecraft.network.play.client.C03PacketPlayer');
var S08PacketPlayerPosLook = Java.type("net.minecraft.network.play.server.S08PacketPlayerPosLook");
var pepe = false;
    this.onPacket = function(event){
      var packet = event.getPacket();
      if (((packet instanceof C06PlayerPacket) || (packet instanceof C04PacketPlayerPosition) || (packet instanceof C05PacketPlayerLook) || (packet instanceof C03PacketPlayer)) && pepe == true)
      {
        event.cancelEvent();
      }

    };
    this.onEnable = function() {
    }
	this.onUpdate = function() {
pepe = false;
mc.thePlayer.sendQueue.addToSendQueue(new C06PlayerPacket(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, (randomIntFrom(-90,90), randomIntFrom(0,360), mc.thePlayer.onGround));
pepe = true;
	}

Something like that

Last edited by yorik100 (7 August 2019 02:49)

Avatar

By soulplexis 7 August 2019 03:53

Donator · 435 comments
yorik100 wrote
var C06PlayerPacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook');
var C04PacketPlayerPosition = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition')
var C05PacketPlayerLook = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook');
var C03PacketPlayer = Java.type('net.minecraft.network.play.client.C03PacketPlayer');
var S08PacketPlayerPosLook = Java.type("net.minecraft.network.play.server.S08PacketPlayerPosLook");
var pepe = false;
    this.onPacket = function(event){
      var packet = event.getPacket();
      if (((packet instanceof C06PlayerPacket) || (packet instanceof C04PacketPlayerPosition) || (packet instanceof C05PacketPlayerLook) || (packet instanceof C03PacketPlayer)) && pepe == true)
      {
        event.cancelEvent();
      }

    };
    this.onEnable = function() {
    }
	this.onUpdate = function() {
pepe = false;
mc.thePlayer.sendQueue.addToSendQueue(new C06PlayerPacket(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, (randomIntFrom(-90,90), randomIntFrom(0,360), mc.thePlayer.onGround));
pepe = true;
	}

Something like that

will this prevent it flagging moving_morepackets on NCP/anticheats?


【ソルプレクサス】

Avatar

By Shiv3R 7 August 2019 05:52

Member · 178 comments
yorik100 wrote
var C06PlayerPacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook');
var C04PacketPlayerPosition = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition')
var C05PacketPlayerLook = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook');
var C03PacketPlayer = Java.type('net.minecraft.network.play.client.C03PacketPlayer');
var S08PacketPlayerPosLook = Java.type("net.minecraft.network.play.server.S08PacketPlayerPosLook");
var pepe = false;
    this.onPacket = function(event){
      var packet = event.getPacket();
      if (((packet instanceof C06PlayerPacket) || (packet instanceof C04PacketPlayerPosition) || (packet instanceof C05PacketPlayerLook) || (packet instanceof C03PacketPlayer)) && pepe == true)
      {
        event.cancelEvent();
      }

    };
    this.onEnable = function() {
    }
	this.onUpdate = function() {
pepe = false;
mc.thePlayer.sendQueue.addToSendQueue(new C06PlayerPacket(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, (randomIntFrom(-90,90), randomIntFrom(0,360), mc.thePlayer.onGround));
pepe = true;
	}

Something like that

actually you did something that i wanted to do today, i was thinking about the same idea in the bed wtf god
edit: yes this works preety nice big_smile no flags for morepackets etc

Last edited by Shiv3R (7 August 2019 05:58)