Voxiom Name Changer with Element Check

Name Changer

  1. // ==UserScript==
  2. // @name Voxiom Name Changer with Element Check
  3. // @namespace https://discord.gg/4T6HGWTBd7
  4. // @version 6.0
  5. // @description Name Changer
  6. // @author Jaguar
  7. // @match https://voxiom.io/*
  8. // @icon https://cdn.discordapp.com/icons/1140361748747141203/7234c7dfb6b45cb72a80b44a2303a342.png?size=1024https://www.google.com/s2/favicons?sz=64&domain=kirka.io
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. const customUsername = "Jaguar"; // Custom Username
  14.  
  15. function replaceText(node, username) {
  16. const replacedText = node.textContent.replace(new RegExp(username, 'gi'), customUsername);
  17. node.textContent = replacedText;
  18. }
  19.  
  20. function handleMutation(mutationsList, username) {
  21. for (let mutation of mutationsList) {
  22. if (mutation.type === 'childList') {
  23. const walker = document.createTreeWalker(mutation.target, NodeFilter.SHOW_TEXT, null, false);
  24. while (walker.nextNode()) {
  25. const node = walker.currentNode;
  26. if (node.textContent.includes(username)) {
  27. replaceText(node, username);
  28. }
  29. }
  30. }
  31. }
  32. }
  33.  
  34. function observer(username) {
  35. const observer = new MutationObserver(mutationsList => handleMutation(mutationsList, username));
  36. observer.observe(document.body, { childList: true, subtree: true });
  37. }
  38.  
  39. function Check() {
  40. const user = document.querySelector('.sc-lbhJGD.fYyclM');
  41. if (user) {
  42. const username = user.textContent;
  43. observer(username);
  44. user.textContent = customUsername;
  45. } else {
  46. setTimeout(Check, 1); // Loop if Not Found Since Retarded Loading times ✅😊🤣😂🤣❤❤❤🤣
  47. }
  48. }
  49. window.addEventListener("load", Check);