CCBlueX Forum

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

    [CORE]AutoInsultReloaded

    Scripts
    core script assist automation configurable
    2
    7
    275
    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.
    • FaaatPotato
      FaaatPotato last edited by FaaatPotato

      So I made another AutoInsult
      Thanks @CzechHek for answering my questions :axofast:

      Features:

      • Formats links so chat filters won't cancel your shit
      • Option to add own insult list via file
      • Some commands to modify and download shit, idk if you need them tbh
      • Different detection modes
      • Very customizable
      • Fancy settings? Idk I think they're!

      Big advantage?

      • You can input any link combined with a message,
        meaning you don't have to "only send links" or "only send insults" you can combine both in one file, even in one message

      • The link stays clickable (for you) even with custom formatting!

      Your file could look like this:

      1| lmao
      2| you are dead im alive https://www.examplelink.com
      3| https://www.examplelink.com
      4| dont even try to join a new round
      5| https://www.examplelink.com lmao
      

      To do:

      • Fix issues which will come up in future

      Code:

      • AutoInsultReloaded.js
      • And ofc the github no one cares about
      ///api_version=2
      (script = registerScript({
          name: "AutoInsultReloaded",
          version: "1.0.3",
          authors: ["FaaatPotato"]
      })).import("Core.lib");
      
      Core.updateURL = "https://raw.githubusercontent.com/FaaatPotato/Scripts/main/AutoInsultReloaded.js"
      
      ChatComponentText = Java.type("net.minecraft.util.ChatComponentText");
      ClickEvent = Java.type("net.minecraft.event.ClickEvent");
      HoverEvent = Java.type("net.minecraft.event.HoverEvent");
      
      insultDir = new File(LiquidBounce.fileManager.dir, "AutoInsultRL")
      insultDir.mkdir()
      
      var internalInsults = [
          "lmao",
          "your performance was miserable :)",
          "idk bro not your best day huh",
          "I, personally, would just surrender.",
          "normally I would say absolute exquisite beginner",
          "that game isn't made for you...",
          "people like you shouldn't play this game.",
          "listen, go to bed. I already sent you to sleep.",
          "buddy, try harder next time ig.",
          "seems like you lost. Must have happened before. Maybe quit?",
          "seen on a sexual perspective your mom is hot.",
          "let me give you a little.. live lesson. Live fucks you like I did."
      ]
      var sentInsult = false, clientChat, prefix = "§8§l[§c§lAutoInsultRL§8§l]§7 ",
          formattedInsult, insult, externalFile, userContent, currentTarget;
      
      insultValues = [
          sectionMode = value.createBoolean("§6§lGeneralConfiguration§f", true, [
              detectionMode = value.createList("DetectionMode", ["PacketChat", "Classic"], "PacketChat", {
                  "PacketChat": [
                      detectionPhrase = new (Java.extend(TextValue)) ("Scan", "killed by") {
                          onChanged: function(o, n) {
                              lookFor = !n.contains(",") ? [n] : n.split(",").unique().filter(function (entry) entry != "")
                              detectionPhrase.set(lookFor.toString())
                              clearChat();
                              if (n.toLowerCase() == "reset") detectionPhrase.set("killed by");
                              addCustomChat(prefix+"Module will search for '§a§l"+lookFor.join("§7' or '§a§l")+"§7' + §a§l"+mc.thePlayer.getName());
                          }
                      },
                  ]
              }),
              chatParameter = value.createText("Parameter", "!"),
              value.createSpacer(),
              insultMode = value.createList("InsultMode", ["Internal", "Custom"], "Internal", {
                  "Custom": [
                      userFileName = new (Java.extend(ListValue)) ("File", current = Java.from(new File(LiquidBounce.fileManager.dir, "AutoInsultRL").listFiles()).map(function (file) file.getName()).concat(["", "Refresh"]), "") {
                          onChanged: function(o, n) {
                              var updateReflector = new Reflector(userFileName);
                              updateReflector.values = Java.to(Java.from(new File(LiquidBounce.fileManager.dir, "AutoInsultRL").listFiles()).map(function (file) file.getName()).concat(["", "Refresh"]), "java.lang.String[]")
                              if (n == "Refresh" || !n) {
                                  userFileName.set(current[0])
                              } else if (n && !Java.from(insultDir.listFiles()).length) {
                                  addCustomChat(prefix+"Couln't find file to read! Create one with '§c§l.rlc§7'", null, null);
                              } else if (n) {
                                  clearChat()
                                  addCustomChat(prefix+"Checked file format? §a§l[CLICK]", "https://github.com/FaaatPotato/Scripts/blob/main/Tutorials/AutoInsultReloaded", "§a§lClick to view tutorial!")
                                  playSound("random.successful_hit")
                              }
                          }
                      }
                  ]
              }),
              value.createSpacer(),
          ]),
          sectionLinks = value.createBoolean("§6§lFormatConfiguration§f", false, [
              formatMode = value.createList("LinkFormatMode", ["§c§lNoFormatting§f", "SurroundDots", "ReplaceDots", "NoDots"], "NoFormatting", {
                  "SurroundDots": surroundWith = value.createList("SurroundWith", ["(.)", "{.}", "[.]", "|.|", "<.>", "*.*", "'.'", "!.!"], "(.)"),
                  "ReplaceDots": replaceWith = value.createList("ReplaceWith", ["!", "+", "-", "^", "`", "'", "°", "?", "~", "#", "<", "=", ">", "$", "&", "%", "²", "³", "*", "|"], "'")
              }),
              clickableLink = value.createBoolean("ClickableLink", true)
          ])
      ]
      
      function isLink(message) {
          if (message.contains("http://") || message.contains("https://") || message.contains("www")) {
              return true;
          } else return false;
      }
      
      function extractLink(message) {
          var link = message.split(" ").filter(function (part) isLink(part))
          return link;
      }
      
      function addCustomChat(message, URL, hoverText) {
          if (hoverText === undefined) hoverText = null; if (URL === undefined || URL === null) URL = null;
          var comp = new ChatComponentText(message)
      
          if (URL) {
              comp.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, URL))
              if (hoverText) {
                  comp.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(hoverText)))
              }
          } else if (!URL && hoverText) {
              comp.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(hoverText)))
          }
          mc.thePlayer.addChatMessage(comp)
      }
      
      function sendInsult(targetName) {
          userContent = Java.from(FileUtils.readLines(new File(insultDir, userFileName.get())))
          insult = insultMode.get() == "Internal" || !userContent.length ? internalInsults.random() : userContent.random()
      
          if (!isLink(insult)) { //&& (isLink(insult) && formatMode.get() == "NoFormatting")
              formattedInsult = insult
          } else {
              sentInsult = true;
              switch(formatMode.get()) {
                  case "NoFormatting": formattedInsult = insult; break;
                  case "SurroundDots": formattedInsult = insult.replace(/[.]/g, surroundWith.get()); break;
                  case "ReplaceDots": formattedInsult = insult.replace(/[.]/g, replaceWith.get()); break;
                  case "NoDots": formattedInsult = insult.replace(/[.]/g, "")
              }
          }
          mc.thePlayer.sendChatMessage(chatParameter.get()+" "+targetName+" "+formattedInsult)
          return;
      }
      
      var lookFor = !detectionPhrase.get().contains(",") ? [detectionPhrase.get()] : detectionPhrase.split(",").unique().filter(function (entry) entry != "");
      //need to define it here since it only gets defined and updated onChanged
      
      RLInsult = {
          name: "AutoInsultReloaded",
          category: "Fun",
          description: "Automatically insults your (dead) opponents",
          tag: detectionMode.get(),
          values: insultValues,
      
          onPacket: function(e) {
              var packet = e.getPacket()
              if (packet instanceof C01PacketChatMessage && mc.thePlayer && sentInsult) {
                  clientChat = packet.getMessage()
              }
              if (packet instanceof S02PacketChat) {
                  chatContent = packet.getChatComponent().getUnformattedText()
                  firstElement = chatContent.split(" ")[0];
      
                  if (lookFor.some(function (phrase) chatContent.contains(phrase+" "+mc.thePlayer.getName())) && detectionMode.get() == "PacketChat") {
                      sendInsult(firstElement)
                  }
                  if (chatContent.contains(clientChat) && clickableLink.get() && isLink(insult) && sentInsult) { //cancel clientside, resend message with events
                      e.cancelEvent()
                      addCustomChat(packet.getChatComponent().getFormattedText()+" §a§l[OPEN]", extractLink(insult), "§a§lClick me!")
                      sentInsult = false;
                  }
              }
          },
          onAttack: function(e) {
              if (e.getTargetEntity() instanceof EntityPlayer) currentTarget = e.getTargetEntity()
          },
          onUpdate: function() {
              if (currentTarget != null && detectionMode.get() == "Classic") {
                  if (currentTarget.isDead || currentTarget.getHealth <= 0 && !mc.thePlayer.getHealth <= 0 && !mc.thePlayer.isDead) {
                      sendInsult(currentTarget.getName())
                      currentTarget = null
                      return;
                  }
              }
          },
          onWorld: function() {
              currentTarget = null;
          }
      }
      
      RLCreate = {
          name: "RLCreate",
          aliases: ["rlc", "rlcreate"],
          version: script.version,
      
          handler: {
              downloadinsults: function(rawlink, fileName) {
                  var fileToDownload = new File(insultDir, fileName)
                  if (!fileToDownload.exists()) {
                      HttpUtils.download(new URL(rawlink), fileToDownload)
                      addCustomChat(prefix+"Downloaded file! '§a§l"+fileName+"§7'")
                  } else addCustomChat(prefix+"File already exists! '§c§l"+fileName+"§7'")
              },
              addlineto: function(fileName, content) {
                  var fileToAppend = new File(insultDir, fileName)
                  if (fileToAppend.exists()) addCustomChat(prefix+"Added to file! '§a§l"+fileName+"§7'", null, null); else addCustomChat(prefix+"Created and added to file! '§a§l"+fileName+"§7'", null, null);
                  FileUtils.writeStringToFile(fileToAppend, content+"\n", true)
              },
              del: function(fileName) {
                  var fileToDelete = new File(insultDir, fileName)
                  if (fileToDelete.exists()) {
                      fileToDelete.delete()
                      addCustomChat(prefix+"Deleted file! '§c§l"+fileName+"§7'")
                  } else addCustomChat(prefix+"Couldn't find file! '§c§l"+fileName+"§7'", null, null)
              },
              delall: function() {
                  var files = Java.from(insultDir.listFiles())
                  if (files.length) {
                      files.map(function (file) file.delete())
                      addCustomChat(prefix+"Deleted all files! §a§l[Hover]", null, "§a§l"+files.map(function (file) file.getName()).join("§a§l, "))
                  } else addCustomChat(prefix+"No files found! '§c§l"+insultDir+"§7'")
              },
              folder: function() {
                  openFolder(insultDir)
              }
          },
          onTabComplete: function(args) {
              if (args[0] == "del" || args[0] == "addlineto" && args.length < 3) return Java.from(insultDir.listFiles()).map(function (file) file.getName());
          }
      }
      
      command = [RLCreate]
      module = [RLInsult]
      
      FaaatPotato 2 Replies Last reply Reply Quote 0
      • FaaatPotato
        FaaatPotato @FaaatPotato last edited by FaaatPotato

        Update v1.0.3

        Changelog v1.0.3:
        
        * added support for multiple detection phrases
          -> usage: .autoinsultreloaded scan phrase1,phrase2,phrase3,...
        
        * fixed bug where insultmode classic would insult targets even if player dead
        * fixed bug where insultmode classic would insult yourself :axolaughter: 
        * added autoupdate url
        * minor code adjustements
        
        1 Reply Last reply Reply Quote 0
        • FaaatPotato
          FaaatPotato @FaaatPotato last edited by FaaatPotato

          Update v1.0.6

          Changelog v1.0.4-1.0.6
          
          * added insult queue
             -> Insult targets even if chat filter detects "chatting too fast"
          
          * added option to find target if it isn't the first element in chat
             -> select index if message captured
          
          * expanded internal insults
          * MORE CUSTOMIZATION YEAHHHH
          

          To do:

          • Use actual queue class instead of the one i made out of arrays :axocooler:
          • Fix bug where multiple detectionphrases wont get used on startup (have to reset them manually rn)
          kumri owo 1 Reply Last reply Reply Quote 0
          • kumri owo
            kumri owo @FaaatPotato last edited by

            @FaaatPotato Can you add a feature to randomize the string into random characters like: "dont even try next time" -> "𝗱o𝗻t e𝘃en t𝗿y ne𝘅𝘁 𝘁im𝗲" to bypass more advanced filters?

            FaaatPotato 1 Reply Last reply Reply Quote 0
            • FaaatPotato
              FaaatPotato @kumri owo last edited by

              @Systemless you mean replacing some characters of the string with random ones? Or just swapping some (wouldn't be readable so ig just replacing)

              Ye I could do that

              kumri owo 1 Reply Last reply Reply Quote 0
              • kumri owo
                kumri owo @FaaatPotato last edited by

                @FaaatPotato random ones that dont use the same like char like: 𝗱 and d

                FaaatPotato 1 Reply Last reply Reply Quote 0
                • FaaatPotato
                  FaaatPotato @kumri owo last edited by

                  @Systemless ahhhh alternative letters that arent the normal ones. Yes pretty good idea, i'll add it if i find time

                  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