Taming.io ZWSP Injector 2.4

Automatically injects a zero-width space into the Taming.io chat to uncensor selected censored words.

当前为 2023-05-24 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Taming.io ZWSP Injector 2.4
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description Automatically injects a zero-width space into the Taming.io chat to uncensor selected censored words.
  6. // @author You
  7. // @match https://taming.io/
  8. // @icon https://taming.io/img/creature/boss-seahorse-head.png
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. let censoredWords = prompt("Bypass List: (separated by spaces)", "") || "".split(" ");
  13.  
  14. const selector = document.querySelector("input");
  15. const resetKeybind = document.onkeydown = (evt) => {
  16. evt = evt || window.event;
  17. if (evt.keyCode == 27) {
  18. censoredWords = prompt("Bypass List: (separated by spaces)", censoredWords.join(" ")).split(" ");
  19. }
  20. };
  21. const indexes = (string, search) => {
  22. return [...string.matchAll(new RegExp(search, "gi"))].map((a) => a.index);
  23. };
  24. const inject = (string, index) => {
  25. index++;
  26. return string.slice(0, index) + "​" + string.slice(index);
  27. }
  28. const onInput = () => {
  29. if (censoredWords[0] == "" && censoredWords.length == 1) return;
  30. selector.value = selector.value.replace(/[\u200B-\u200D\uFEFF]/g, '');
  31. censoredWords.forEach((i) => {
  32. if (selector.value.toLowerCase().includes(i)) {
  33. let indexList = indexes(selector.value, i);
  34. let indexIncrement = 0;
  35. indexList.forEach((j) => {
  36. indexList[indexList.indexOf(j)] += indexIncrement;
  37. indexIncrement += 2;
  38. });
  39. indexList.forEach((k) => {
  40. selector.value = inject(selector.value, k);
  41. selector.value = inject(selector.value, k + 2);
  42. });
  43. }
  44. });
  45. };
  46. selector.oninput = onInput;

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址