Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. ScriptAPI
  3. Cant find the problem in my code

Cant find the problem in my code

Scheduled Pinned Locked Moved Solved ScriptAPI
7 Posts 3 Posters 2.0k Views
  • 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.
  • ByGrafB Offline
    ByGrafB Offline
    ByGraf
    wrote on last edited by
    #1

    this is my script and i dont know where the problem is ._. pls help

    var scriptName = "InvSort";
    var scriptAuthor = "ByGraf";
    var scriptVersion = 1.0;
    var x = 0;
    var y = 0;
    var bridge = value.createBoolean("bridge", false);
    var bw = value.createBoolean("bw", false);

    function Sort() {

    this.addValues = function(values) {
        values.add(bridge);
        values.add(bw);
    }
    
    
    this.onEnable = function() {
        x = 0;
        y = 0;
    };
    
    this.onDisable = function() {
        x = 0;
        y = 0;
    };
    
    
    this.getName = function() {
        return "InvSort";
    }
    this.getCategory = function() {
        return "Player";   
    }
    
    this.getDescription = function() {
        return "Inventorycleaner addon";
    }
    
    this.onUpdate = function(){
        if(!bridge.get()){
            x = 0;
        }
    
        if (!bw.get()){
            y = 0;
        }
    
        if (bridge.get() && x == 0){
            commandManager.executeCommand(.inventorycleaner throwgarbage false);
            commandManager.executeCommand(.inventorycleaner sortslot-1 Sword);
            commandManager.executeCommand(.inventorycleaner sortslot-2 Pickaxe);
            commandManager.executeCommand(.inventorycleaner sortslot-3 Gapple);
            commandManager.executeCommand(.inventorycleaner sortslot-4 Bow);
            commandManager.executeCommand(.inventorycleaner sortslot-5 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-6 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-7 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-8 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-9 Block);
            x = 1;
        }
        
        if(bw.get() && y == 0){
            commandManager.executeCommand(.inventorycleaner throwgarbage false);
            commandManager.executeCommand(.inventorycleaner sortslot-1 Sword);
            commandManager.executeCommand(.inventorycleaner sortslot-2 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-3 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-4 Gapple);
            commandManager.executeCommand(.inventorycleaner sortslot-5 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-6 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-7 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-8 Ignore);
            commandManager.executeCommand(.inventorycleaner sortslot-9 Block);
            y = 1;
    
        }
    
    }
    

    }

    var module = new Sort();
    var Client;

    function onEnable() {
    Client = moduleManager.registerModule(module);

    }

    function onDisable() {
    moduleManager.unregisterModule(Client);

    }

    Ali00035A exit scammedE 2 Replies Last reply
    0
    • ByGrafB ByGraf

      this is my script and i dont know where the problem is ._. pls help

      var scriptName = "InvSort";
      var scriptAuthor = "ByGraf";
      var scriptVersion = 1.0;
      var x = 0;
      var y = 0;
      var bridge = value.createBoolean("bridge", false);
      var bw = value.createBoolean("bw", false);

      function Sort() {

      this.addValues = function(values) {
          values.add(bridge);
          values.add(bw);
      }
      
      
      this.onEnable = function() {
          x = 0;
          y = 0;
      };
      
      this.onDisable = function() {
          x = 0;
          y = 0;
      };
      
      
      this.getName = function() {
          return "InvSort";
      }
      this.getCategory = function() {
          return "Player";   
      }
      
      this.getDescription = function() {
          return "Inventorycleaner addon";
      }
      
      this.onUpdate = function(){
          if(!bridge.get()){
              x = 0;
          }
      
          if (!bw.get()){
              y = 0;
          }
      
          if (bridge.get() && x == 0){
              commandManager.executeCommand(.inventorycleaner throwgarbage false);
              commandManager.executeCommand(.inventorycleaner sortslot-1 Sword);
              commandManager.executeCommand(.inventorycleaner sortslot-2 Pickaxe);
              commandManager.executeCommand(.inventorycleaner sortslot-3 Gapple);
              commandManager.executeCommand(.inventorycleaner sortslot-4 Bow);
              commandManager.executeCommand(.inventorycleaner sortslot-5 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-6 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-7 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-8 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-9 Block);
              x = 1;
          }
          
          if(bw.get() && y == 0){
              commandManager.executeCommand(.inventorycleaner throwgarbage false);
              commandManager.executeCommand(.inventorycleaner sortslot-1 Sword);
              commandManager.executeCommand(.inventorycleaner sortslot-2 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-3 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-4 Gapple);
              commandManager.executeCommand(.inventorycleaner sortslot-5 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-6 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-7 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-8 Ignore);
              commandManager.executeCommand(.inventorycleaner sortslot-9 Block);
              y = 1;
      
          }
      
      }
      

      }

      var module = new Sort();
      var Client;

      function onEnable() {
      Client = moduleManager.registerModule(module);

      }

      function onDisable() {
      moduleManager.unregisterModule(Client);

      }

      Ali00035A Offline
      Ali00035A Offline
      Ali00035
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • ByGrafB ByGraf

        this is my script and i dont know where the problem is ._. pls help

        var scriptName = "InvSort";
        var scriptAuthor = "ByGraf";
        var scriptVersion = 1.0;
        var x = 0;
        var y = 0;
        var bridge = value.createBoolean("bridge", false);
        var bw = value.createBoolean("bw", false);

        function Sort() {

        this.addValues = function(values) {
            values.add(bridge);
            values.add(bw);
        }
        
        
        this.onEnable = function() {
            x = 0;
            y = 0;
        };
        
        this.onDisable = function() {
            x = 0;
            y = 0;
        };
        
        
        this.getName = function() {
            return "InvSort";
        }
        this.getCategory = function() {
            return "Player";   
        }
        
        this.getDescription = function() {
            return "Inventorycleaner addon";
        }
        
        this.onUpdate = function(){
            if(!bridge.get()){
                x = 0;
            }
        
            if (!bw.get()){
                y = 0;
            }
        
            if (bridge.get() && x == 0){
                commandManager.executeCommand(.inventorycleaner throwgarbage false);
                commandManager.executeCommand(.inventorycleaner sortslot-1 Sword);
                commandManager.executeCommand(.inventorycleaner sortslot-2 Pickaxe);
                commandManager.executeCommand(.inventorycleaner sortslot-3 Gapple);
                commandManager.executeCommand(.inventorycleaner sortslot-4 Bow);
                commandManager.executeCommand(.inventorycleaner sortslot-5 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-6 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-7 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-8 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-9 Block);
                x = 1;
            }
            
            if(bw.get() && y == 0){
                commandManager.executeCommand(.inventorycleaner throwgarbage false);
                commandManager.executeCommand(.inventorycleaner sortslot-1 Sword);
                commandManager.executeCommand(.inventorycleaner sortslot-2 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-3 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-4 Gapple);
                commandManager.executeCommand(.inventorycleaner sortslot-5 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-6 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-7 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-8 Ignore);
                commandManager.executeCommand(.inventorycleaner sortslot-9 Block);
                y = 1;
        
            }
        
        }
        

        }

        var module = new Sort();
        var Client;

        function onEnable() {
        Client = moduleManager.registerModule(module);

        }

        function onDisable() {
        moduleManager.unregisterModule(Client);

        }

        exit scammedE Offline
        exit scammedE Offline
        exit scammed
        wrote on last edited by
        #3

        @bygraf all commands must be placed inside quotation marks.
        e.g.

        commandManager.executeCommand(.inventorycleaner throwgarbage false);
        

        to

        commandManager.executeCommand(".inventorycleaner throwgarbage false");
        

        and the same for others.

        ByGrafB Ali00035A 2 Replies Last reply
        1
        • exit scammedE exit scammed

          @bygraf all commands must be placed inside quotation marks.
          e.g.

          commandManager.executeCommand(.inventorycleaner throwgarbage false);
          

          to

          commandManager.executeCommand(".inventorycleaner throwgarbage false");
          

          and the same for others.

          ByGrafB Offline
          ByGrafB Offline
          ByGraf
          wrote on last edited by
          #4

          @exit-scammed ahh lol thx

          1 Reply Last reply
          0
          • ByGrafB ByGraf has marked this topic as solved on
          • exit scammedE exit scammed

            @bygraf all commands must be placed inside quotation marks.
            e.g.

            commandManager.executeCommand(.inventorycleaner throwgarbage false);
            

            to

            commandManager.executeCommand(".inventorycleaner throwgarbage false");
            

            and the same for others.

            Ali00035A Offline
            Ali00035A Offline
            Ali00035
            wrote on last edited by Ali00035
            #5

            @exit-scammed I think that's supposed to be like this

            var LB = Java.type("net.ccbluex.liquidbounce.LiquidBounce");
            
            LB.commandManager.executeCommands(".inventorycleaner throwgarbage false");
            
            exit scammedE 1 Reply Last reply
            0
            • Ali00035A Ali00035

              @exit-scammed I think that's supposed to be like this

              var LB = Java.type("net.ccbluex.liquidbounce.LiquidBounce");
              
              LB.commandManager.executeCommands(".inventorycleaner throwgarbage false");
              
              exit scammedE Offline
              exit scammedE Offline
              exit scammed
              wrote on last edited by exit scammed
              #6

              @stfwissue LiquidBounce automatically imports its commandManager variable while loading the script. Take a look at line 58 of Script.kt:

              scriptEngine.put("commandManager", LiquidBounce.commandManager)
              

              P/s: I didn't notice the typo, it's actually executeCommands instead of executeCommand.

                  fun executeCommands(input: String) {
              
              Ali00035A 1 Reply Last reply
              0
              • exit scammedE exit scammed

                @stfwissue LiquidBounce automatically imports its commandManager variable while loading the script. Take a look at line 58 of Script.kt:

                scriptEngine.put("commandManager", LiquidBounce.commandManager)
                

                P/s: I didn't notice the typo, it's actually executeCommands instead of executeCommand.

                    fun executeCommands(input: String) {
                
                Ali00035A Offline
                Ali00035A Offline
                Ali00035
                wrote on last edited by
                #7

                @exit-scammed It's ok

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                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
                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups