Gartic Phone Draw Bot (MADE WITH AI??)

Automatic Draw Bot for Gartic Phone

目前为 2025-03-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Gartic Phone Draw Bot (MADE WITH AI??)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Automatic Draw Bot for Gartic Phone
  6. // @author fdslalkad
  7. // @match *://garticphone.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. const drawBotButton = document.createElement('button');
  15. drawBotButton.innerText = 'DRAWBOT';
  16. drawBotButton.style.position = 'absolute';
  17. drawBotButton.style.top = '10px';
  18. drawBotButton.style.right = '10px';
  19. drawBotButton.style.zIndex = '1000';
  20. document.body.appendChild(drawBotButton);
  21.  
  22. drawBotButton.addEventListener('click', () => {
  23. const gui = document.createElement('div');
  24. gui.style.position = 'fixed';
  25. gui.style.top = '50%';
  26. gui.style.left = '50%';
  27. gui.style.transform = 'translate(-50%, -50%)';
  28. gui.style.backgroundColor = 'white';
  29. gui.style.padding = '20px';
  30. gui.style.boxShadow = '0 0 10px rgba(0,0,0,0.5)';
  31. gui.style.zIndex = '1001';
  32.  
  33. const input = document.createElement('input');
  34. input.type = 'file';
  35. input.accept = 'image/*';
  36. gui.appendChild(input);
  37.  
  38. const urlInput = document.createElement('input');
  39. urlInput.type = 'text';
  40. urlInput.placeholder = 'Or enter image URL';
  41. gui.appendChild(urlInput);
  42.  
  43. const uploadButton = document.createElement('button');
  44. uploadButton.innerText = 'Upload Image';
  45. gui.appendChild(uploadButton);
  46.  
  47. document.body.appendChild(gui);
  48.  
  49. uploadButton.addEventListener('click', () => {
  50. const file = input.files[0];
  51. const url = urlInput.value;
  52. const img = new Image();
  53.  
  54. if (file) {
  55. const reader = new FileReader();
  56. reader.onload = (e) => {
  57. img.src = e.target.result;
  58. startDrawing(img);
  59. };
  60. reader.readAsDataURL(file);
  61. } else if (url) {
  62. img.src = url;
  63. startDrawing(img);
  64. }
  65. });
  66.  
  67. document.addEventListener('click', (event) => {
  68. if (!gui.contains(event.target)) {
  69. gui.remove();
  70. }
  71. });
  72. });
  73.  
  74. function startDrawing(image) {
  75. const canvas = document.querySelector('canvas'); // Adjust selector as needed
  76. const ctx = canvas.getContext('2d');
  77. image.onload = () => {
  78. ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
  79. };
  80. }
  81. })();