PP Bot Example

Bot Exampe

  1. // ==UserScript==
  2. // @name PP Bot Example
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Bot Exampe
  6. // @author Bambi1
  7. // @match https://pixelplace.io/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=pixelplace.io
  9. // @run-at document-start
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. function fix(a, b) {
  15. Object.defineProperty(window.console, a, {configurable:false,enumerable:true,writable:false,value:b});
  16. }
  17.  
  18. fix('log', console.log);
  19. fix('warn', console.warn);
  20. fix('error', console.error);
  21. fix('info', console.info);
  22. const originalWebSocket = window.WebSocket;
  23. var socket;
  24.  
  25. class WebSocketHook extends originalWebSocket {
  26. constructor(a, b) {
  27. super(a, b);
  28. socket = this;
  29. }
  30. }
  31.  
  32. window.WebSocket = WebSocketHook;
  33.  
  34.  
  35. function placePix(x, y, col) {
  36. socket.send(`42["p",[${x},${y},${col},1]]`);
  37. }
  38.  
  39.  
  40. function startingPos(x, y){
  41. var three = 3;
  42. var four = 4;
  43. var color = 5;
  44. placePix(x , y,color)
  45. placePix(x+1, y+1,color)
  46. placePix(x+2, y+2,color)
  47. placePix(x+four,y+three,color)
  48. }
  49.  
  50.  
  51. document.addEventListener('keydown', function(event) {
  52. // Check if the pressed key is 'j'
  53. if (event.key === 'j') {
  54. // Get the element with the id "coordinates"
  55. var coordinatesElement = document.getElementById('coordinates');
  56. var coordinatesValue = coordinatesElement.textContent;
  57. // Split the coordinates value into x and y parts
  58. var [x, y] = coordinatesValue.split(',');
  59. //send the coordinates as integers
  60. startingPos(parseInt(x), parseInt(y));
  61. }
  62. });

QingJ © 2025

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