Velocity

A simple velocity script.

void onLoad() {
    modules.registerSlider("Horizontal", 100, 0, 100, 1);
    modules.registerSlider("Vertical", 100, 0, 100, 1);
    modules.registerSlider("Chance", 100, 0, 100, 1);
    modules.registerButton("Explosions", true);
    modules.registerButton("Only while targeting", false);
    modules.registerButton("Disable while holding S", false);
}

boolean onPacketReceived(SPacket packet) {
    if (packet instanceof S12) {
        Entity player = client.getPlayer();
        S12 s12 = (S12) packet;
        if (s12.entityId != player.entityId) return true;

        if ((modules.getSlider(scriptName, "Chance") / 100) < client.util.randomDouble(0, 1)) return true;

        if (modules.getButton(scriptName, "Disable while holding S") && client.keybinds.isKeyDown(31)) return true;

        if (modules.getButton(scriptName, "Only while targeting")) {
            double reach = modules.isEnabled("Reach") ? modules.getSlider("Reach", "Max") : 3;
            Object[] raycast = client.raycastEntity(reach);
            Entity en = raycast != null ? (Entity)raycast[0] : null;
            boolean isLooking = (en != null && en.type.contains("EntityOtherPlayer")) || modules.getKillAuraTarget() != null;
            if (!isLooking) return true;
        }

        Vec3 motion = client.getMotion();
        double horizontal = modules.getSlider(scriptName, "Horizontal") / 100, 
               vertical = modules.getSlider(scriptName, "Vertical") / 100;

        double x = horizontal == 0 ? motion.x : (s12.motion.x / 8000d) * horizontal, 
               z = horizontal == 0 ? motion.z : (s12.motion.z / 8000d) * horizontal,
               y = vertical == 0 ? motion.y : (s12.motion.y / 8000d) * vertical;

        client.setMotion(x, y, z);
        return false;
    } else if (packet instanceof S27) {
        Entity player = client.getPlayer();
        S27 s27 = (S27) packet;

        if (player.getPosition().distanceToSq(s27.pos) > 20d) return true;

        if (!modules.getButton(scriptName, "Explosions")) return true;

        if ((modules.getSlider(scriptName, "Chance") / 100) < client.util.randomDouble(0, 1)) return true;

        if (modules.getButton(scriptName, "Disable while holding S") && client.keybinds.isKeyDown(31)) return true;

        Vec3 motion = client.getMotion();
        double horizontal = modules.getSlider(scriptName, "Horizontal") / 100, 
               vertical = modules.getSlider(scriptName, "Vertical") / 100;

        double x = horizontal == 0 ? motion.x : (s27.motion.x / 8000d) * horizontal, 
               z = horizontal == 0 ? motion.z : (s27.motion.z / 8000d) * horizontal,
               y = vertical == 0 ? motion.y : (s27.motion.y / 8000d) * vertical;

        client.setMotion(x, y, z);
        return false;
    }

    return true;
}

Last updated