Macro AGMA.IO

Editado por EmersonxD

目前为 2023-05-09 提交的版本。查看 最新版本

// ==UserScript==
// @name         Macro AGMA.IO
// @namespace https://gf.qytechs.cn/pt-BR/users/305931-emerson-bardusco
// @version      6.0
// @license      MIT
// @description  Editado por EmersonxD
// @author       EmersonxD
// @match        http://agma.io/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function () {
'use strict';

// Define variáveis globais
var feeding = false;
var feedingSpeed = 20;
var splittingSpeed = 50;
var splitCount = 4;

// Função para alimentar a célula
function feed() {
if (feeding) {
// Dispara eventos de teclado para alimentar a célula
var eventKeyDown = new KeyboardEvent('keydown', { keyCode: 87 });
var eventKeyUp = new KeyboardEvent('keyup', { keyCode: 87 });
document.dispatchEvent(eventKeyDown);
document.dispatchEvent(eventKeyUp);
// Chama a função de alimentação novamente após um intervalo de tempo
setTimeout(feed, feedingSpeed);
}
}

// Função para dividir a célula em várias partes
function split() {
// Dispara eventos de teclado para dividir a célula
var eventKeyDown = new KeyboardEvent('keydown', { keyCode: 32 });
var eventKeyUp = new KeyboardEvent('keyup', { keyCode: 32 });
document.dispatchEvent(eventKeyDown);
document.dispatchEvent(eventKeyUp);
}

// Função para executar o truque de divisão
function doSplitTrick() {
split();
setTimeout(split, splittingSpeed);
setTimeout(split, splittingSpeed * 2);
setTimeout(split, splittingSpeed * 3);
}

// Função para executar a divisão personalizada
function doCustomSplit() {
splitCount = prompt('Digite a quantidade de vezes que deseja dividir a célula:', splitCount);
splitCount = parseInt(splitCount);
if (isNaN(splitCount) || splitCount < 2) {
alert('A quantidade de divisão deve ser um número maior ou igual a 2.');
return;
}
for (var i = 0; i < splitCount; i++) {
split();
}
}

// Função acionada quando o jogador pressiona uma tecla
function onKeyPress(event) {
switch (event.keyCode) {
case 87: // W
feeding = true;
feed();
break;
case 83: // S
var x = window.innerWidth / 2;
var y = window.innerHeight / 2;
var eventMouseMove = new MouseEvent('mousemove', { clientX: x, clientY: y });
document.querySelector("canvas").dispatchEvent(eventMouseMove);
break;
case 16: // Shift
case 52: // 4
doSplitTrick();
break;
case 81: // Q
doCustomSplit();
break;
case 82: // R
closeStats();
rspwn(document.getElementById('nick').value);
break;
default:
break;
}
}

// Função acionada quando o jogador solta uma tecla
function onKeyRelease(event) {
if (event.keyCode == 87) { // W
feeding = false;
}
}

// Função para adicionar event listeners para as teclas pressionadas e soltas
function addEventListeners() {
document.addEventListener('keydown', onKeyPress);
document.addEventListener('keyup', onKeyRelease);
}

// Função para inicializar o script
function init() {
addEventListeners();
}

// Inicializa o script quando a página é carregada
window.addEventListener('load', init);

})();

QingJ © 2025

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