ReplacementText *OLD*

Replaces text you choose with a substitute

  1. // ==UserScript==
  2. // @name ReplacementText *OLD*
  3. // @namespace skyboy@kongregate
  4. // @author skyboy
  5. // @version 1.0.0
  6. // @description Replaces text you choose with a substitute
  7. // @include http://www.kongregate.com/games/*/*
  8. // @homepage
  9. // ==/UserScript==
  10. if (/^\/?games\/[^\/]+\/[^\/?]+(\?.*)?$/.test(window.location.pathname)) {
  11. setTimeout(function() {
  12. var r = function(){return eval("("+GM_getValue("skyreplacements", "{ }")+")")};
  13. var stringit = function(a){var i="{ ";for(var d in a){i += '"' + d.replace(/"/g,'\\"') + '":"' + String(a[d]).replace(/"/g,'\\"') + '",'}return i.substring(0, i.length - 1) + " }"};
  14. unsafeWindow.holodeck.addOutgoingMessageFilter(function(m,n){for(var i in r()){m=m.replace(new RegExp(i,"g"),r()[i]);}n(m);})
  15. GM_registerMenuCommand("Add replacement text (ie. faces)", function(){
  16. var k = r();
  17. var i = prompt("What text do you want to replace?");
  18. if (!i) return;
  19. var j = prompt("What do you want to replace it with?\n(Empty to delete replacement)", k[i] || i);
  20. if (j) k[i] = j; else delete k[i];
  21. GM_setValue("skyreplacements", stringit(k))
  22. });
  23. }, 1250);
  24. }

QingJ © 2025

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