PP-Client

Pixel Place Client

  1. // ==UserScript==
  2. // @name PP-Client
  3. // @name:ru PP-Client
  4. // @description Pixel Place Client
  5. // @description:ru Pixel Place Клиент
  6. // @version 1.6.2.1
  7. // @author 0vC4
  8. // @namespace https://gf.qytechs.cn/users/670183
  9. // @match https://pixelplace.io/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=pixelplace.io
  11. // @license MIT
  12. // @grant none
  13. // @run-at document-start
  14. // @require https://gf.qytechs.cn/scripts/445776-ppab/code/PPAB.js?version=1056000
  15. // @require https://gf.qytechs.cn/scripts/438620-workertimer/code/WorkerTimer.js?version=1009025
  16. // @require https://gf.qytechs.cn/scripts/438408-cwss/code/CWSS.js?version=1042744
  17. // @require https://gf.qytechs.cn/scripts/444949-ppconf/code/PPConf.js?version=1050254
  18. // @require https://gf.qytechs.cn/scripts/443803-ppml/code/PPML.js?version=1050258
  19. // @require https://gf.qytechs.cn/scripts/443894-ppil/code/PPIL.js?version=1050256
  20. // @require https://gf.qytechs.cn/scripts/443807-ppt/code/PPT.js?version=1050374
  21. // @require https://gf.qytechs.cn/scripts/443844-ppcc/code/PPCC.js?version=1050358
  22. // @require https://gf.qytechs.cn/scripts/443907-pppc/code/PPPC.js?version=1050383
  23. // ==/UserScript==
  24. Object.defineProperty(window.console, 'log', {configurable:false,enumerable:true,writable:false,value:console.log});
  25. Object.defineProperty(window, 'setInterval', {configurable:false,enumerable:true,writable:false,value:WorkerTimer.setInterval});
  26. Object.defineProperty(window, 'clearInterval', {configurable:false,enumerable:true,writable:false,value:WorkerTimer.clearInterval});
  27. Object.defineProperty(window, 'setTimeout', {configurable:false,enumerable:true,writable:false,value:WorkerTimer.setTimeout});
  28. Object.defineProperty(window, 'clearTimeout', {configurable:false,enumerable:true,writable:false,value:WorkerTimer.clearTimeout});
  29. setInterval(() => {
  30. const _18 = document.querySelector('[data-id="alert"]');
  31. if (!_18 || _18.style.display != 'flex') return;
  32. document.querySelector('.nsfw-continue').click();
  33. });
  34. (() => {
  35. const PPClient = window.PPClient || {modules:{}};
  36. window.PPClient = PPClient;
  37. PPClient.CWSS = CWSS;
  38.  
  39. const {ImageLoader, Tools} = PPClient.modules;
  40. const config = PPClient.config;
  41.  
  42. config.timer = WorkerTimer;
  43. config.packetSpeed = 30;
  44. config.subscribe(...Object.values(PPClient.modules).map(({config}) => config).filter(Boolean));
  45. PPClient.modules.Compiler.compile();
  46.  
  47. Object.defineProperty(PPClient, 'ignore', {enumerable:true,configurable:true,get(){
  48. let b = !PPClient.ws.ignore;
  49. PPClient.sockets.map(ws=>ws.ignore = b);
  50. return b;
  51. },set(v){
  52. PPClient.sockets.map(ws=>ws.ignore = v);
  53. return v;
  54. }});
  55.  
  56. PPClient.order = new Proxy({}, {
  57. get(_, type) {
  58. PPClient.config.order = type;
  59. return Tools.order[type]
  60. .finish(queue => {
  61. PPClient.pos = 0;
  62. PPClient.queue = queue;
  63. console.log('order finished');
  64. })
  65. .center([PPClient.map.width/2, PPClient.map.height/2])
  66. .silent(PPClient.config.silent)
  67. .start(PPClient.queue);
  68. }
  69. });
  70. PPClient.mode = mode => {
  71. if (mode == 'none') {
  72. PPClient.onclick = () => true;
  73. return true;
  74. }
  75. if (mode == 'rainbow_hole_v2') {
  76. PPClient.onclick = (x,y,pixel) => {
  77. const {width, height} = PPClient.map;
  78. const {palette, zero} = Tools.args;
  79. let clr = 0;
  80. let perc = null;
  81.  
  82. Tools.shader
  83. .tick((x,y,p) => {
  84. const dx = (x/4-width/8)**2;
  85. const dy = (y-height/2)**2;
  86. const dist = (dx+dy)**.75;
  87. const percent = 1000*dist/(height/2)>>0;
  88. if (percent != perc) {
  89. perc = percent;
  90. clr = perc%palette.length;
  91. while (palette[clr] == zero) {
  92. clr++;
  93. if (clr > palette.length-1) clr = 0;
  94. }
  95. }
  96. PPClient.set(x, y, clr);
  97. })
  98. .finish((taskId) => {
  99. console.log('shader finished');
  100. Tools.order[config.order]
  101. .finish(queue => {
  102. PPClient.pos = 0;
  103. PPClient.queue = queue;
  104. console.log('order finished');
  105. })
  106. .silent(PPClient.config.silent)
  107. .center([width/2, height/2])
  108. .start(PPClient.queue);
  109. })
  110. .start(PPClient.map);
  111.  
  112. return false;
  113. };
  114. return true;
  115. }
  116. if (mode == 'rainbow_hole') {
  117. PPClient.onclick = (x,y,pixel) => {
  118. const {width, height} = PPClient.map;
  119. const {palette, zero} = Tools.args;
  120. let clr = 0;
  121. let perc = null;
  122.  
  123. Tools.shader
  124. .tick((x,y,p) => {
  125. const dist = ((x-width/2)**2+(y-height/2)**2)**0.5;
  126. const percent = 1000*dist/(height/2)>>0;
  127. if (percent != perc) {
  128. perc = percent;
  129. clr = perc%palette.length;
  130. while (palette[clr] == zero) {
  131. clr++;
  132. if (clr > palette.length-1) clr = 0;
  133. }
  134. }
  135. PPClient.set(x, y, clr);
  136. })
  137. .finish((taskId) => {
  138. console.log('shader finished');
  139. Tools.order[config.order]
  140. .finish(queue => {
  141. PPClient.pos = 0;
  142. PPClient.queue = queue;
  143. console.log('order finished');
  144. })
  145. .silent(PPClient.config.silent)
  146. .center([width/2, height/2])
  147. .start(PPClient.queue);
  148. })
  149. .start(PPClient.map);
  150.  
  151. return false;
  152. };
  153. return true;
  154. }
  155. if (mode == 'border_rainbow') {
  156. PPClient.onclick = (x,y,pixel) => {
  157. const areaSize = 5;
  158. const has = areaSize>>1;
  159. const padding = 2;
  160. const {width, height, pixels} = PPClient.map;
  161.  
  162. Tools.shader
  163. .tick((x,y,p) => {
  164. if (x < areaSize || x > width-1-areaSize || y < areaSize || y > height-1-areaSize) return;
  165. let start = (x-has)+(y-has)*width;
  166. let area = [];
  167. for (let i = 0; i < areaSize; i++) {
  168. const offset = start+i*width;
  169. area.push(...pixels.slice(offset, offset+areaSize));
  170. }
  171. if (area.find(p => p === 255)) {
  172. PPClient.set(x, y, Tools.wheel);
  173. return;
  174. }
  175. const size = areaSize+padding*2;
  176. const hs = has+padding;
  177. if (x < size || x > width-1-size || y < size || y > height-1-size) return;
  178. start = (x-hs)+(y-hs)*width;
  179. area = [];
  180. for (let i = 0; i < size; i++) {
  181. const offset = start+i*width;
  182. area.push(...pixels.slice(offset, offset+size));
  183. }
  184. if (area.find(p => p === 255)) {
  185. PPClient.set(x, y, 5);
  186. return;
  187. }
  188. PPClient.set(x, y, 5);
  189. })
  190. .finish((taskId) => {
  191. console.log('shader finished');
  192. Tools.order[config.order]
  193. .finish(queue => {
  194. PPClient.pos = 0;
  195. PPClient.queue = queue;
  196. console.log('order finished');
  197. })
  198. .silent(PPClient.config.silent)
  199. .center([width/2, height/2])
  200. .start(PPClient.queue);
  201. })
  202. .start(PPClient.map);
  203.  
  204. return false;
  205. };
  206. return true;
  207. }
  208.  
  209. if (mode == 'image') {
  210. PPClient.onclick = (x,y,pixel) => {
  211. ImageLoader.loadImage
  212. .finish(([pixels, w, h]) => {
  213. if (config.order == 'fromCenter') x -= w/2>>0;
  214. if (config.order == 'fromCenter') y -= h/2>>0;
  215.  
  216. Tools.image
  217. .tick((x,y,p) => {
  218. if (!(x>=0&&y>=0&&x<PPClient.map.width&&y<PPClient.map.height)) return;
  219. PPClient.set(x, y, p);
  220. })
  221. .finish((taskId) => {
  222. console.log('image finished');
  223. Tools.order[config.order]
  224. .finish(queue => {
  225. PPClient.pos = 0;
  226. PPClient.queue = queue;
  227. console.log('order finished');
  228. })
  229. .silent(PPClient.config.silent)
  230. .center([x+w/2, y+h/2])
  231. .start(PPClient.queue);
  232. })
  233. .start(pixels, x,y,w,h);
  234. }).start();
  235.  
  236. return false;
  237. };
  238. return true;
  239. }
  240. };
  241.  
  242. PPClient.lock = true;
  243. PPClient.mode('image');
  244. })();
  245. // 0vC4#7152 aka Palette

QingJ © 2025

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