Auto W-Tap Forward (Keep distance)



  • 中文
    描述:自动保持距离目标的最远距离。
    版本:1.0
    作用:控距,在强反作弊服务器有大用。
    用法:攻击目标开始,按END键结束。

    English
    Description: Automatically keep the longest distance between you and the target.
    Version:1.0
    What it does : controlling the distance, useful in servers has good anticheat.
    Usage : starts when you hit a enemy, stops when you hit end key on keyboard

    Legacy Support

    /// api_version=1
    var scriptName = "WTap";
    var scriptAuthor = "Anonzme";
    var scriptVersion = 1.0;
    
    var EntityLivingBase = Java.type("net.minecraft.entity.EntityLivingBase");
    
    var currentTargetEntity;
    var searched;
    
    function WTapModule() {
        var wTapRangeValue = value.createFloat("WTapRange", 3.425, 2.99, 8.0);
        
        this.getName = function() {
            return "WTap";
        };
        
        this.getDescription = function() {
            return "Auto W-Tap.";
        };
        
        this.getCategory = function() {
            return "Combat";
        };
        
        this.addValues = function(values) {
            values.add(wTapRangeValue);
        };
        
        this.onEnable = function() {
            searched = false;
            
            chat.print("[WTap] Hit a player to start Auto-WTap. Press END to stop Auto-WTap");
        };
        
        this.onMotion = function(event) {
            if (!searched)
                return;
            
            var distance = mc.thePlayer.getDistanceToEntity(currentTargetEntity);
            
            mc.gameSettings.keyBindForward.pressed = distance > wTapRangeValue.get();
            
            if (!mc.gameSettings.keyBindBack.pressed)
                mc.thePlayer.setSprinting(mc.gameSettings.keyBindForward.pressed);
        };
        
        this.onKey = function(event) {
            if (event.getKey() == 207) {
                if (!searched) {
                    chat.print("[WTap] Hit a player to start Auto-WTap and then you can stop!");
                    return;
                }
                
                searched = false;
                
                chat.print("[WTap] Stop Auto-WTap.");
            }
        };
        
        this.onAttack = function(event) {
            var entity = event.getTargetEntity();
            if (!(entity instanceof EntityLivingBase))
                return;
            
            if (currentTargetEntity != entity) {
                currentTargetEntity = entity;
                chat.print("[WTap] Start Auto-WTap with: " + entity.getName());
            }
            
            searched = true;
        };
    }
    
    var wTapModule = new WTapModule();
    
    function onEnable() {
        moduleManager.registerModule(wTapModule);
    }
    
    function onDisable() {
        moduleManager.unregisterModule(wTapModule);
    }
    
    

    New Script-API Support

    /// api_version=2
    var script = registerScript({
        name: "WTap",
        version: "1.0", 
        authors: ["Anonzme"]
    });
    
    var EntityLivingBase = Java.type("net.minecraft.entity.EntityLivingBase");
    
    var currentTargetEntity;
    var searched;
    
    script.registerModule({
        name: "WTap",
        description: "Auto W-Tap",
        category: "Combat",
        settings: {
            wTapRangeValue: Setting.float({
                name: "WTapRange",
                default: 3.425,
                min: 2.99,
                max: 8.0
            })
        }
    }, function(module) {
        module.on("enable", function() {
            searched = false;
                    
            Chat.print("[WTap] Hit a player to start Auto-WTap. Press END to stop Auto-WTap");
        });
    
        module.on("motion", function(event) {
            if (!searched)
                return;
    
            var distance = mc.thePlayer.getDistanceToEntity(currentTargetEntity);
    
            mc.gameSettings.keyBindForward.pressed = distance > wTapRangeValue.get();
    
            if (!mc.gameSettings.keyBindBack.pressed)
                mc.thePlayer.setSprinting(mc.gameSettings.keyBindForward.pressed);
        });
    
        module.on("key", function(event) {
           if (event.getKey() == 207) {
               if (!searched) {
                   Chat.print("[WTap] Hit a player to start Auto-WTap and then you can stop!");
                   return;
                }
    
                searched = false;
    
                Chat.print("[WTap] Stop Auto-WTap.");
           }
        });
    
        module.on("attack", function(event) {
            var entity = event.getTargetEntity();
            if (!(entity instanceof EntityLivingBase))
                return;
    
            if (currentTargetEntity != entity) {
                currentTargetEntity = entity;
                Chat.print("[WTap] Start Auto-WTap with: " + entity.getName());
            }
    
            searched = true;
        });
    });
    

    代码是一次写成的,游戏暂时开不开,没法调试,有问题请反馈,感激不尽。


  • Admin

    Could you please translate the description to English?



  • @Senk-Ju said in Auto W-Tap:

    Could you please translate the description to English?

    Description: Automatically keep the longest distance between you and the target.
    Ver:1.0
    What it does : controlling the distance, useful in servers has good anticheat.
    Usage : starts when you hit a enemy, stops when you hit end key on keyboard





  • @Anonzme
    It should work but would probably not that well because I have written some similar thing just a month ago. My goal was to make it as legit as possible.

    Terribly written.
    My wtapbot a month ago. (it's basically your version with a aimbot lock on the target and toggling ac)
    My current wtapbot. I didn't post this because it could be further improved but I don't have enough motivation XDDDDD .

    The real case is much more complicated than that. It took me some time to realize the following.

    It works perfectly when you are already comboing your target, barely have problem, but it could be difficult to start the process.

    The purpose of wtap/distance controlling stuff is to combo the player(hitting it continously without being hit by it). The reason why wtap exists is because you only get extra knock back on the first hit after you start sprinting, to gain the extra knock back you have to stop sprinting and start again between hits, so it's literally tapping the w key, and it's more than just distance controlling. (That's what SuperKnockBack does and why it's also called wtap, it just send start/stop sprinting packets silently onattack, btw the SuperKnockBack module in LB flags in AACv4 when you hit a enemy while standing still)

    And the extra knock back is the key to start and keep comboing, in some cases, you might not always able to reset the sprint state(happens most frequently when you are playing sumo) , which might result in the undesired outcome.

    Even if my current version doesn't have any distance controlling stuff, it is significantly better than the old one. (could still control the distance manually using ad-strafe).



  • This post is deleted!


  • I use wtap by myself xd



  • This post is deleted!


  • Can you give an already compiled mod please?



  • @Revees-Keanu You can easily create a .js file and copy paste everything in it and place it in your Scripts folder.



  • and where is this folder located? I'm sorry, I'm just a beginner.




Log in to reply