Taming.io shark finder

if there's a shark hidden on your screen it will find it for you

  1. // ==UserScript==
  2. // @name Taming.io shark finder
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description if there's a shark hidden on your screen it will find it for you
  6. // @author Phantasm
  7. // @match *://taming.io/
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11. // Get the canvas element
  12. var canvas = document.getElementById('canvas');
  13. var ctx = canvas.getContext('2d');
  14.  
  15. // Set the line color to RGB 123, 159, 209
  16. ctx.strokeStyle = 'rgb(123, 159, 209)';
  17.  
  18. // Set the line width
  19. ctx.lineWidth = 5;
  20.  
  21. // Function to get the coordinates of an object with a specific color
  22. function getObjectCoordinates(color) {
  23. // Get the page's image data
  24. var imageData = getImageData();
  25.  
  26. // Iterate through the image data to find the object with the specified color
  27. for (var y = 0; y < imageData.height; y++) {
  28. for (var x = 0; x < imageData.width; x++) {
  29. var pixel = imageData.data[(y * imageData.width * 4) + (x * 4)];
  30. if (pixel[0] === color[0] && pixel[1] === color[1] && pixel[2] === color[2]) {
  31. // Found the object! Return its coordinates
  32. return [x, y];
  33. }
  34. }
  35. }
  36.  
  37. // If no object is found, return null
  38. return null;
  39. }
  40.  
  41. // Function to get the page's image data
  42. function getImageData() {
  43. // Create a temporary canvas to render the page
  44. var tempCanvas = document.createElement('canvas');
  45. tempCanvas.width = window.innerWidth;
  46. tempCanvas.height = window.innerHeight;
  47. var tempCtx = tempCanvas.getContext('2d');
  48.  
  49. // Render the page on the temporary canvas
  50. tempCtx.drawWindow(window, 0, 0, window.innerWidth, window.innerHeight);
  51.  
  52. // Get the image data from the temporary canvas
  53. var imageData = tempCtx.getImageData(0, 0, window.innerWidth, window.innerHeight);
  54.  
  55. // Remove the temporary canvas
  56. tempCanvas.remove();
  57.  
  58. return imageData;
  59. }
  60.  
  61. // Get the coordinates of the object with the color RGB 123, 159, 209
  62. var objectCoordinates = getObjectCoordinates([123, 159, 209]);
  63.  
  64. // If the object is found, draw a line to it
  65. if (objectCoordinates) {
  66. ctx.beginPath();
  67. ctx.moveTo(968, 630);
  68. ctx.lineTo(objectCoordinates[0], objectCoordinates[1]);
  69. ctx.stroke();
  70. } else {
  71. console.log("Object not found!");
  72. }

QingJ © 2025

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