Agario Macro Eject

An agar.io extension to eject mass quickly

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Agario Macro Eject
// @namespace    Macro!
// @version      0.5
// @description  An agar.io extension to eject mass quickly
// @author       Vex
// @match        http://agar.io/*
// @match        http://agariohub.net/*
// @grant        none
// ==/UserScript==

var feedChar = "E"; /* The key you want to macro feed with */
var speed = 3; /* The number of milliseconds in between feeds, The greater you make it, the slower it shoots */

feedChar = feedChar.toUpperCase().charCodeAt(0);

var interval;
var switchy = false;
$(document).on('keydown', function(e) {
	if(e.keyCode == feedChar) {
		if(switchy) {
			return;
		}
		switchy = true;
		interval = setInterval(function() {
			$("body").trigger($.Event("keydown", {
				keyCode: 87
			}));
			$("body").trigger($.Event("keyup", {
				keyCode: 87
			}));
		}, speed);
	}
});

$(document).on('keyup', function(e) {
	if(e.keyCode == feedChar) {
		switchy = false;
		clearInterval(interval);
		return;
	}
});