CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Unsolved [Help] Porting Core.

    Support
    4
    13
    283
    Loading More Posts
    • 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.
    • O
      OmNomNom last edited by

      Can someone help me convert CzechHek's antibot script from Core to the Script Api 2 version?

      I'm an idiot, so if anyone would be kind enough to help me out.

      ///api_version=2
      (script = registerScript({
          name: "MatrixAntiBot",
          authors: ["CzechHek"],
          version: "3.5"
      })).import("Core.lib");
      
      module = {
          category: "Combat",
          onPacket: function (e) {
              if (e.getPacket().wrapped instanceof S41PacketServerDifficulty) wasAdded = false;
              if (mc.thePlayer && e.getPacket().wrapped instanceof S38PacketPlayerListItem && e.getPacket().wrapped.getAction() == "ADD_PLAYER") {
                  name = (info = e.getPacket().wrapped.getEntries().get(0)).getProfile().getName();
                  if (!wasAdded) wasAdded = name == mc.thePlayer.getName();
                  else if (!mc.thePlayer.isSpectator() && !mc.thePlayer.capabilities.allowFlying && info.getPing() && info.getGameMode() != "NOT_SET") e.cancelEvent(), print("§2§lRemoved a bot§a:", name);
              }
          }
      }
      
      var wasAdded;
      

      ^This is for liquidbounce B73, and I want to use it on a custom build (liquiddrip)

      1 Reply Last reply Reply Quote 0
      • V
        vinci last edited by vinci

        here is it

        var scriptName = "MatrixAntiBot";
        var scriptAuthor = "CzechHek";
        var scriptVersion = 3.5;
        var S38PacketPlayerListItem = Java.type("net.minecraft.network.play.server.S38PacketPlayerListItem");
        var S41PacketServerDifficulty = Java.type("net.minecraft.network.play.server.S41PacketServerDifficulty");
        var wasAdded;
        
        function MatrixAntiBot() {
            this.getName = function() {
                return "MatrixAntiBot";
            };
            this.getDescription = function() {
                return "antibot (matrix proof)";
            };
            this.getCategory = function() {
                return "Combat";
            };
            this.onPacket = function(e) {
                if (e.getPacket() instanceof S41PacketServerDifficulty) wasAdded = false;
                if (e.getPacket() instanceof S38PacketPlayerListItem && e.getPacket().getAction() == "ADD_PLAYER") {
                    var info = e.getPacket().getEntries().get(0);
                    var name = info.getProfile().getName();
        			
                    if (!wasAdded) {
                        wasAdded = name != mc.thePlayer.getName();
                    } else if (mc.thePlayer && !mc.thePlayer.isSpectator() && !mc.thePlayer.capabilities.allowFlying && info.getPing() && info.getGameMode() != "NOT_SET") {
                        chat.print("Removed a bot");
                        e.cancelEvent();
                    }
                }
            }
        }
        
        var matrixantibot = new MatrixAntiBot();
        
        function onEnable() {
            moduleManager.registerModule(matrixantibot);
        };
        
        function onDisable() {
            moduleManager.unregisterModule(matrixantibot);
        };
        

        it seems to be working but not sure
        it's a 5-months old script it's probs patched tho

        CzechHek Rafay O 5 Replies Last reply Reply Quote 2
        • CzechHek
          CzechHek @vinci last edited by

          @nvinci probably not

          1 Reply Last reply Reply Quote 1
          • Rafay
            Rafay @vinci last edited by

            @nvinci Its not patched and will not be soon

            V 1 Reply Last reply Reply Quote 1
            • V
              vinci @Rafay last edited by

              Oh alright

              1 Reply Last reply Reply Quote 0
              • O
                OmNomNom @vinci last edited by

                @nvinci thank you!

                1 Reply Last reply Reply Quote 0
                • O
                  OmNomNom @vinci last edited by

                  @nvinci Nevermind, it doesn't seem to be working. It just prints Bot is removed but the bot doesn't disappear

                  V 1 Reply Last reply Reply Quote 0
                  • V
                    vinci @OmNomNom last edited by

                    @omnomnom oh, what server did you test it? so I can try to fix it

                    O 1 Reply Last reply Reply Quote 0
                    • O
                      OmNomNom @vinci last edited by

                      @nvinci I tried it on JartexNetwork.

                      1 Reply Last reply Reply Quote 0
                      • CzechHek
                        CzechHek @vinci last edited by

                        @nvinci said in [Help] Porting Core.:

                        here is it

                                    if (!wasAdded) {
                                        wasAdded = name != mc.thePlayer.getName();
                        

                        @omnomnom said in [Help] Porting Core.:

                                    if (!wasAdded) wasAdded = name == mc.thePlayer.getName();
                        
                        O V 2 Replies Last reply Reply Quote 1
                        • O
                          OmNomNom @CzechHek last edited by OmNomNom

                          @czechhek Oh so do I just replace that, and this is what it should be, right?

                          if (!wasAdded) wasAdded = name == mc.thePlayer.getName();
                                        else if (mc.thePlayer && !mc.thePlayer.isSpectator() && !mc.thePlayer.capabilities.allowFlying && info.getPing() && info.getGameMode() != "NOT_SET") {
                                          chat.print("§2§lRemoved a Matrix bot§a");
                                          e.cancelEvent();
                          
                          1 Reply Last reply Reply Quote 0
                          • V
                            vinci @CzechHek last edited by

                            @czechhek I've already tried this, but it removed all players from the server (loyisa's test server)
                            but maybe it should work in jartextnetwork

                            O 1 Reply Last reply Reply Quote 0
                            • O
                              OmNomNom @vinci last edited by

                              @nvinci after the change, it doesn't work as well.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              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