CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    LagDetector.js

    Scripts
    2
    2
    311
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      siuank last edited by

      sth might be useful 🙂
      LagDetector.js

      Plumer Man 1 Reply Last reply Reply Quote 0
      • Plumer Man
        Plumer Man @siuank last edited by

        @siuank

        var script = registerScript({
            name: "LagDetector",
            version: "1.0",
            authors: ["ys"]
        });
        var plus;
        script.registerModule({
            name: "LagDetector",
            description: "Detect flags",
            category: "Misc",
            settings: {
                TooFarCheck: Setting.boolean({
                    name: "TooFarCheck",
                    default: true
                }),
                TooFarLengh: Setting.integer({
                    name: "TooFarLengh",
                    max: 100,
                    min: 1,
                    default: 8
                }),
                TooFarMessage: Setting.boolean({
                    name: "TooFarMessage",
                    default: false
                })
            }
        }, function (module) {
            module.on("packet", function (event) {
                var packet = event.getPacket();
                if (packet instanceof S08) {
                    if (module.settings.TooFarCheck.get()) {
                        if (get3DPythagorean(packet.getX() - mc.thePlayer.posX, packet.getY() - mc.thePlayer.posY, packet.getZ() - mc.thePlayer.posZ) >= module.settings.TooFarLengh.get()) {
                            if (module.settings.TooFarMessage.get()) {
                                Chat.print("[ §cDEBUG §r] §bToo far.");
                            }
                        } else {
                            Chat.print("[ §cDEBUG §r] §4FLAG.");
                        }
                    } else {
                        Chat.print("[ §cDEBUG §r] §4FLAG.");
                    }
                }
            });
        });
        var S08 = Java.type('net.minecraft.network.play.server.S08PacketPlayerPosLook');
        
        function get3DPythagorean(x, y, z) {
            return Math.sqrt(Math.pow(Math.sqrt(Math.pow(x, 2) + Math.pow(z, 2)), 2) + Math.pow(y, 2));
        }
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        About
        • Terms of Service
        • Privacy Policy
        • Status
        • Contact Us
        Downloads
        • Releases
        • Source code
        • License
        Docs
        • Tutorials
        • CustomHUD
        • AutoSettings
        • ScriptAPI
        Community
        • Forum
        • Guilded
        • YouTube
        • Twitter
        • D.Tube