Rewrite PingSpoof module in ScriptAPI
-
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...