PPAB

Pixel Place Anti Ban

目前为 2022-05-30 提交的版本,查看 最新版本

此脚本不应直接安装,它是供其他脚本使用的外部库。如果你需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/445776/1055993/PPAB.js

  1. // ==UserScript==
  2. // @name PPAB
  3. // @description Pixel Place Anti Ban
  4. // @version 1.0.3
  5. // @author 0vC4
  6. // @namespace https://greasyfork.org/users/670183
  7. // @match https://pixelplace.io/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=pixelplace.io
  9. // @license MIT
  10. // @grant none
  11. // @run-at document-start
  12. // ==/UserScript==
  13. (() => {
  14. const badStrings = ['baba', 'a[href=', '[\'html\']', 'injected', 'using', 'execution']
  15. const _console = {log: window.console.log};
  16. const realInterval = window.setInterval;
  17. const checkid = realInterval(() => {
  18. console.log(window.setInterval.toString(), window.setInterval.toString().includes('[native code]'))
  19. if(!window.setInterval.toString().includes('[native code]')){
  20. console.log(window.checkId)
  21. clearInterval(checkid);
  22. wrapInterval();
  23. }
  24. }, 10)
  25.  
  26. function wrapInterval(){
  27. window.setInterval = function(func, ms){
  28. const code = func.toString();
  29. const match = badStrings.find(x => code.includes(x));
  30. if(match) _console.log('MATCHES', code);
  31. if(match) return Math.random()*10000|0;
  32. return realInterval(...arguments);
  33. }
  34. }
  35. })();