Taming.io ZWSP Injector 2.0

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

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

  1. // ==UserScript==
  2. // @name Taming.io ZWSP Injector 2.0
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Automatically injects a zero-width space into the Taming.io chat to uncensor 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.  
  16. const resetKeybind = document.onkeydown = (evt) => {
  17. evt = evt || window.event;
  18. if (evt.keyCode == 27) {
  19. censoredWords = prompt("Bypass List: (separated by spaces)", censoredWords.join(" ")).split(" ");
  20. }
  21. };
  22.  
  23. const indexes = (string, search) => {
  24. return [...string.matchAll(new RegExp(search, "gi"))].map((a) => a.index);
  25. };
  26.  
  27. const inject = (string, index) => {
  28. index++;
  29. return string.slice(0, index) + "​" + string.slice(index);
  30. }
  31.  
  32. const onInput = () => {
  33. if (censoredWords[0] == "" && censoredWords.length == 1) return;
  34. selector.value = selector.value.replace(/[\u200B-\u200D\uFEFF]/g, '');
  35. censoredWords.forEach((i) => {
  36. if (selector.value.toLowerCase().includes(i)) {
  37. let indexList = indexes(selector.value, i);
  38. let indexIncrement = 0;
  39.  
  40. indexList.forEach((j) => {
  41. indexList[indexList.indexOf(j)] += indexIncrement;
  42. indexIncrement += 2;
  43. });
  44.  
  45. indexList.forEach((k) => {
  46. selector.value = inject(selector.value, k);
  47. selector.value = inject(selector.value, k + 2);
  48. });
  49.  
  50. }
  51. });
  52. };
  53.  
  54. selector.oninput = onInput;

QingJ © 2025

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