first time making scripts



  • two of my most useless scripts:
    AutoJump: jump when move lmao

    • normal edition
    var scriptName = "AutoJump";
    var scriptAuthor = "404NotFound";
    var scriptVersion = "1.0";
    
    function autoJump() {
        this.getName = function() {
            return "AutoJump"
        };
        
        this.getDescription = function() {
            return "Basically jump when move."
        };
        
        this.getCategory = function() {
            return "Movement"
        };
        
        this.onMove = function() {
            //hella this won't work
            if (mc.thePlayer.onGround) {
                mc.thePlayer.jump();
            }
        };
        
        this.onEnable = function() {};
        this.onDisable = function () {}
    }
    
    var autoJump = new autoJump();
    var autoJumpclient;
    
    function onEnable() {
        autoJumpclient = moduleManager.registerModule("autoJump")
    };
    
    function onDisable() {
        moduleManager.unregisterModule("autoJumpclient")
    };
    
    function onLoad() {}
    
    • Core edition (removed due to critical bug)

    AntiJump: never gonna let you jump

    var scriptName = "AntiJump";
    var scriptAuthor = "404NotFound";
    var scriptVersion = "1.0";
    
    function antiJump() {
        this.getName = function() {
            return "AntiJump"
        };
        
        this.getDescription = function() {
            return "never gonna let you jump"
        };
        
        this.getCategory = function() {
            return "Movement"
        };
        
        this.onJump = function(event) {
                event.cancelEvent();
            }
        };
        
        this.onEnable = function() {};
        this.onDisable = function () {}
    }
    
    var antiJump = new antiJump();
    var antiJumpclient;
    
    function onEnable() {
        antiJumpclient = moduleManager.registerModule("antiJump")
    };
    
    function onDisable() {
        moduleManager.unregisterModule("antiJumpclient")
    };
    
    function onLoad() {}
    


  • ummm nobody needs you to post your first scripts, and yeah you don't need the autoJumpClient variable



  • fixed a lot of thinge



  • @404NotFound said in first time making scripts:

    • Core edition (removed due to critical bug)

    what do you mean?



  • @CzechHek ugh it is a type of speed but can't even bypass vanilla lmao



  • only NOOBS use mc.thePlayer.jump(), pros use mc.thePlayer.motionY = 0.42



  • @ChocoPie_isme said in first time making scripts:

    only NOOBS use mc.thePlayer.jump(), pros use mc.thePlayer.motionY = 0.42

    yes i'm a noob at coding, i didn't even learn any thing about coding (only scratch.mit.edu - some kids language)
    sorry if my scripts is bad, i'll change and learn more about javascript/java



  • @ChocoPie_isme uhhhh u sure about that?



  • @infAura said in first time making scripts:

    @ChocoPie_isme uhhhh u sure about that?

    men that's just a joke


  • Moderator

    Hello, I recommend to use the scriptapi v2 if you plan to do other things in Javascript at some point. Because it is much closer to normal Javascript-apis so the transition is easier.
    But either way, have fun learning :axothumbsup:



  • @scorpion3013 said in first time making scripts:

    Hello, I recommend to use the scriptapi v2 if you plan to do other things in Javascript at some point. Because it is much closer to normal Javascript-apis so the transition is easier.
    But either way, have fun learning :axothumbsup:

    my script in v2 doesn't work, idk how to fix


  • Moderator

    @404NotFound
    Which LiquidBounce version do you use?



  • Scriptapiv2 not have a debug log like scriptapiv1
    Ex:if script load success it will say to the mc launcher debug log
    Scriptapiv2 is not
    So i cant see the error to continue fix


  • Moderator

    @LolMC Do you mean syntax errors on launch?


  • Moderator

    @LolMC
    Syntax errors are displayed:
    Code_2020-08-06_16-22-49.png
    Also, editors like VSCode show you errors like that:
    Code_2020-08-06_16-36-41.png
    Normal errors are also displayed:
    MultiMC_2020-08-06_16-25-10.png

    Same informations as in script api v1


  • Moderator

    @404NotFound
    Here, a working example of your scripts in the scriptapi v2 format.

    /// api_version=2
    var script = registerScript({
        name: "JumpModules",
        version: "1.0.0",
        authors: ["404NotFound"]
    });
    
    script.registerModule({
        name: "AntiJumpS",
        category: "Fun", 
        description: "Prevents you from jumping"
    }, function (module) {
    
        module.on("jump", function(eventData) {
            eventData.cancelEvent()
        });
    
        module.on("enable", function() {
            Chat.print("AntiJumpS enabled");
        });
    
        module.on("disable", function() {
            Chat.print("AntiJumpS disabled");
        });
    
    });
    
    script.registerModule({
        name: "AutoJumpS",
        category: "Fun", 
        description: "Jumps for you"
    }, function (module) {
    
        module.on("motion", function(eventData) {
            if (mc.thePlayer.onGround){
                mc.thePlayer.jump();
            }
        });
    
        module.on("enable", function() {
            Chat.print("AutoJumpS enabled");
        });
    
        module.on("disable", function() {
            Chat.print("AutoJumpS disabled");
        });
    
    });
    

    Also, I think the error here is that its the move event. Just use the update or the motion event.
    You will learn which one to use by just making stuff.
    firefox_2020-08-06_16-29-24.png



  • I will test it later



  • This post is deleted!


  • @scorpion3013 said in first time making scripts:

    @404NotFound
    Here, a working example of your scripts in the scriptapi v2 format.

    /// api_version=2
    var script = registerScript({
        name: "JumpModules",
        version: "1.0.0",
        authors: ["404NotFound"]
    });
    
    script.registerModule({
        name: "AntiJumpS",
        category: "Fun", 
        description: "Prevents you from jumping"
    }, function (module) {
    
        module.on("jump", function(eventData) {
            eventData.cancelEvent()
        });
    
        module.on("enable", function() {
            Chat.print("AntiJumpS enabled");
        });
    
        module.on("disable", function() {
            Chat.print("AntiJumpS disabled");
        });
    
    });
    
    script.registerModule({
        name: "AutoJumpS",
        category: "Fun", 
        description: "Jumps for you"
    }, function (module) {
    
        module.on("motion", function(eventData) {
            if (mc.thePlayer.onGround){
                mc.thePlayer.jump();
            }
        });
    
        module.on("enable", function() {
            Chat.print("AutoJumpS enabled");
        });
    
        module.on("disable", function() {
            Chat.print("AutoJumpS disabled");
        });
    
    });
    

    Also, I think the error here is that its the move event. Just use the update or the motion event.
    You will learn which one to use by just making stuff.
    firefox_2020-08-06_16-29-24.png

    thank you!~



  • bro why cant autojump bypass anticheat ?
    autojump can bypass all kinds of anticheat LMAO


Log in to reply