CCBlueX Forum

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

    Rewrite PingSpoof module in ScriptAPI

    Scripts
    1
    1
    194
    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.
    • L_exe
      L_exe last edited by

      var script = registerScript({
          name: "PingSpoof",
          version: "1.0.0",
          authors: ["huy"]
      });
      
      var maxDelayValue = value.createInteger("MaxDelay", 1000, 0, 5000);
      var minDelayValue = value.createInteger("MinDelay", 500, 0, 5000);
      
      var packetQueue = new Map();
      
      script.registerModule({
          name: "PingSpoof",
          category: "Exploit",
          description: "Spoofs your ping to the server."
      }, function (module) {
          module.on("disable", function () {
              packetQueue.clear();
          });
      
          module.on("packet", function (event) {
              var packet = event.getPacket();
      
              if (mc.thePlayer == null) {
                  return;
              }
      
              if ((packet instanceof C00PacketKeepAlive || packet instanceof C16PacketClientStatus) && !packetQueue.has(packet)) {
                  event.cancelEvent();
      
                  packetQueue.set(packet, System.currentTimeMillis() + _.random(minDelayValue.get(), maxDelayValue.get()));
              }
          });
      
          module.on("update", function () {
              var filtered = [];
      
              packetQueue.forEach(function (value, key) {
                  if (value <= System.currentTimeMillis()) {
                      filtered.push(key);
                  }
              });
      
              for (var i = 0; i < filtered.length; i++) {
                  var packet = filtered[i];
                  mc.getNetHandler().addToSendQueue(packet);
                  packetQueue.delete(packet);
              }
          });
      });
      

      I dont know if it will work...

      1 Reply Last reply Reply Quote 0
      • 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