Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • 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. Support
  3. [Help] Porting Core.

[Help] Porting Core.

Scheduled Pinned Locked Moved Unsolved Support
13 Posts 4 Posters 610 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OmNomNom
    wrote on last edited by
    #1

    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
    0
    • V Offline
      V Offline
      vinci
      wrote on last edited by vinci
      #2

      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

      CzechHekC RafayR O 5 Replies Last reply
      2
      • CzechHekC Offline
        CzechHekC Offline
        CzechHek
        replied to vinci on last edited by
        #3

        @nvinci probably not

        1 Reply Last reply
        1
        • RafayR Offline
          RafayR Offline
          Rafay
          replied to vinci on last edited by
          #4

          @nvinci Its not patched and will not be soon

          V 1 Reply Last reply
          1
          • V Offline
            V Offline
            vinci
            replied to Rafay on last edited by
            #5

            Oh alright

            1 Reply Last reply
            0
            • O Offline
              O Offline
              OmNomNom
              replied to vinci on last edited by
              #6

              @nvinci thank you!

              1 Reply Last reply
              0
              • O Offline
                O Offline
                OmNomNom
                replied to vinci on last edited by
                #7

                @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
                0
                • V Offline
                  V Offline
                  vinci
                  replied to OmNomNom on last edited by
                  #8

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

                  O 1 Reply Last reply
                  0
                  • O Offline
                    O Offline
                    OmNomNom
                    replied to vinci on last edited by
                    #9

                    @nvinci I tried it on JartexNetwork.

                    1 Reply Last reply
                    0
                    • CzechHekC Offline
                      CzechHekC Offline
                      CzechHek
                      replied to vinci on last edited by
                      #10

                      @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
                      1
                      • O Offline
                        O Offline
                        OmNomNom
                        replied to CzechHek on last edited by OmNomNom
                        #11

                        @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
                        0
                        • V Offline
                          V Offline
                          vinci
                          replied to CzechHek on last edited by
                          #12

                          @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
                          0
                          • O Offline
                            O Offline
                            OmNomNom
                            replied to vinci on last edited by
                            #13

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

                            1 Reply Last reply
                            0

                            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