Gartic Phone Draw Bot (MADE WITH AI??)

Automatic Draw Bot for Gartic Phone

目前為 2025-03-25 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Gartic Phone Draw Bot (MADE WITH AI??)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Automatic Draw Bot for Gartic Phone
// @author       fdslalkad
// @match        *://garticphone.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const drawBotButton = document.createElement('button');
    drawBotButton.innerText = 'DRAWBOT';
    drawBotButton.style.position = 'absolute';
    drawBotButton.style.top = '10px';
    drawBotButton.style.right = '10px';
    drawBotButton.style.zIndex = '1000';
    document.body.appendChild(drawBotButton);

    drawBotButton.addEventListener('click', () => {
        const gui = document.createElement('div');
        gui.style.position = 'fixed';
        gui.style.top = '50%';
        gui.style.left = '50%';
        gui.style.transform = 'translate(-50%, -50%)';
        gui.style.backgroundColor = 'white';
        gui.style.padding = '20px';
        gui.style.boxShadow = '0 0 10px rgba(0,0,0,0.5)';
        gui.style.zIndex = '1001';

        const input = document.createElement('input');
        input.type = 'file';
        input.accept = 'image/*';
        gui.appendChild(input);

        const urlInput = document.createElement('input');
        urlInput.type = 'text';
        urlInput.placeholder = 'Or enter image URL';
        gui.appendChild(urlInput);

        const uploadButton = document.createElement('button');
        uploadButton.innerText = 'Upload Image';
        gui.appendChild(uploadButton);

        document.body.appendChild(gui);

        uploadButton.addEventListener('click', () => {
            const file = input.files[0];
            const url = urlInput.value;
            const img = new Image();

            if (file) {
                const reader = new FileReader();
                reader.onload = (e) => {
                    img.src = e.target.result;
                    startDrawing(img);
                };
                reader.readAsDataURL(file);
            } else if (url) {
                img.src = url;
                startDrawing(img);
            }
        });

        document.addEventListener('click', (event) => {
            if (!gui.contains(event.target)) {
                gui.remove();
            }
        });
    });

    function startDrawing(image) {
        const canvas = document.querySelector('canvas'); // Adjust selector as needed
        const ctx = canvas.getContext('2d');
        image.onload = () => {
            ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
        };
    }
})();