// ==UserScript==
// @name Gartic.io Helper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 8 new cheat capabilities !
// @author iiJavad bokon namous gartic.io
// @match https://gartic.io/
// @grant none
// ==/UserScript==
(function() {
'use strict';
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
// Set the drawing style
ctx.lineWidth = 5;
ctx.strokeStyle = 'black';
// Function to draw a circle
function drawCircle(x, y, radius) {
ctx.beginPath();
ctx.arc(x, y, radius, 0, 2 * Math.PI);
ctx.stroke();
}
// Function to draw a line
function drawLine(x1, y1, x2, y2) {
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.stroke();
}
// Function to draw a rectangle
function drawRect(x, y, width, height) {
ctx.beginPath();
ctx.rect(x, y, width, height);
ctx.stroke();
}
// Function to fill a rectangle
function fillRect(x, y, width, height) {
ctx.fillStyle = 'black';
ctx.fillRect(x, y, width, height);
}
// Function to draw a triangle
function drawTriangle(x1, y1, x2, y2, x3, y3) {
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.lineTo(x3, y3);
ctx.closePath();
ctx.stroke();
}
// Function to clear the canvas
function clearCanvas() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
// Set up event listeners
canvas.addEventListener('mousedown', (e) => {
const x = e.clientX - canvas.offsetLeft;
const y = e.clientY - canvas.offsetTop;
drawCircle(x, y, 10);
});
canvas.addEventListener('mousemove', (e) => {
const x = e.clientX - canvas.offsetLeft;
const y = e.clientY - canvas.offsetTop;
drawLine(x, y, x + 10, y + 10);
});
canvas.addEventListener('mouseup', () => {
clearCanvas();
});
// Draw a grid
for (let i = 0; i < canvas.width; i += 20) {
drawLine(i, 0, i, canvas.height);
}
for (let i = 0; i < canvas.height; i += 20) {
drawLine(0, i, canvas.width, i);
}
// Draw a shape
drawTriangle(100, 100, 150, 150, 200, 100);
fillRect(250, 250, 50, 50);
// Set up a timer to draw a circle every second
setInterval(() => {
drawCircle(Math.random() * canvas.width, Math.random() * canvas.height, 20);
}, 1000);
// Set up a timer to clear the canvas every 10 seconds
setInterval(() => {
clearCanvas();
}, 10000);
// Add a button to the page to toggle the script
const button = document.createElement('button');
button.textContent = 'Toggle Script';
button.onclick = () => {
if (button.textContent === 'Toggle Script') {
button.textContent = 'Script Enabled';
// Enable the script
} else {
button.textContent = 'Toggle Script';
// Disable the script
}
};
document.body.appendChild(button);
})();