zombs.io user scripts
// ==UserScript==
// @name |TC|Auto Upgrage + Auto Sell + Auto Harvester + MORE !!!
// @namespace http://tampermonkey.net/
// @version 0.1
// @description go to scripts its the best
// @author Kurt
// @match http://zombs.io/
// @grant none
// ==/UserScript==
window.addEventListener("load", function(e) {
zombs.io user scripts How to use it? zombs.io user scripts
var menu = document.getElementsByClassName("hud-menu-scripts")[0];
var AHRC_html = `
Enable AHRC!
`;
var SELLALL_html = `
Enable Sell All!
`;
var UPGRADEALL_html = `
zombs.io user scripts How to get it? zombs.io user scripts
Enable Upgrade All!
`;
menu.innerHTML += AHRC_html;
menu.innerHTML += SELLALL_html;
menu.innerHTML += UPGRADEALL_html;
var css = `
`;
function REFUEL() {
var entities = Game.currentGame.world.entities;
for(var uid in entities) {
if(!entities.hasOwnProperty(uid)) continue;
var obj = entities[uid];
zombs.io user scripts PasteShr zombs.io user scripts
if(obj.fromTick.model == "Harvester") {
let e = Game.currentGame.world.getEntityByUid(obj.fromTick.uid).getTargetTick();
let i = Math.floor(e.depositMax);
Game.currentGame.network.sendRpc({
name: "AddDepositToHarvester",
uid: obj.fromTick.uid,
deposit: i
});
}
}
zombs.io user scripts PasteShr zombs.io user scripts
}
function COLLECT() {
var entities = Game.currentGame.world.entities;
for(var uid in entities) {
if(!entities.hasOwnProperty(uid)) continue;
var obj = entities[uid];
if(obj.fromTick.model == "Harvester") {
Game.currentGame.network.sendRpc({
name: "CollectHarvester",
zombs.io user scripts How to use it? zombs.io user scripts
uid: obj.fromTick.uid
});
}
}
}
function SELLALL() {
var entities = Game.currentGame.world.entities;
for(var uid in entities) {
if(!entities.hasOwnProperty(uid)) continue;
zombs.io user scripts How to use it? zombs.io user scripts
var obj = entities[uid];
if(obj.fromTick.model !== "GoldStash") {
Game.currentGame.network.sendRpc({
name: "DeleteBuilding",
uid: obj.fromTick.uid
});
}
}
}
zombs.io user scripts How to use it? zombs.io user scripts
function UPGRADEALL() {
var entities = Game.currentGame.world.entities;
for(var uid in entities) {
if(!entities.hasOwnProperty(uid)) continue;
var obj = entities[uid];
if(obj.fromTick.model !== "GoldStash") {
Game.currentGame.network.sendRpc({
name: "UpgradeBuilding",
uid: obj.fromTick.uid
});
zombs.io user scripts PasteShr zombs.io user scripts
}
}
}
function UPGRADESTASH() {
var entities = Game.currentGame.world.entities;
for(var uid in entities) {
if(!entities.hasOwnProperty(uid)) continue;
var obj = entities[uid];
if(obj.fromTick.model == "GoldStash") {
zombs.io user scripts How to use it? zombs.io user scripts
Game.currentGame.network.sendRpc({
name: "UpgradeBuilding",
uid: obj.fromTick.uid
});
}
}
}
var enableAHRC = document.getElementsByClassName("AHRCbtn")[0];
var enableAHRCTxt = document.getElementsByClassName("AHRCtxt")[0];
zombs.io user scripts How to use it? zombs.io user scripts
var id = null;
enableAHRC.addEventListener("click", function(e) {
if(enableAHRCTxt.innerText == "Enable AHRC!") {
id = setInterval(function() {
COLLECT();
REFUEL();
}, 1000);
enableAHRCTxt.innerText = "Disable AHRC!";
} else {
enableAHRCTxt.innerText = "Enable AHRC!";
zombs.io user scripts How to get it for free? zombs.io user scripts
clearInterval(id);
id = null;
}
});
document.body.insertAdjacentHTML("beforeend", css);
enableAHRC.classList.add("bttn-dark");
var enableSELLALL = document.getElementsByClassName("SELLALLbtn")[0];
var enableSELLALLTxt = document.getElementsByClassName("SELLALLtxt")[0];
zombs.io user scripts How to get it for free? zombs.io user scripts
enableSELLALL.addEventListener("click", function(e) {
if(enableSELLALLTxt.innerText == "Enable Sell All!") {
id = setInterval(function() {
SELLALL();
}, 1);
enableSELLALLTxt.innerText = "Disable Sell All!";
} else {
enableSELLALLTxt.innerText = "Enable Sell All!";
clearInterval(id);
id = null;
zombs.io user scripts PasteShr zombs.io user scripts
}
});
document.body.insertAdjacentHTML("beforeend", css);
enableSELLALL.classList.add("bttn-dark");
var enableUPGRADEALL = document.getElementsByClassName("UPGRADEALLbtn")[0];
var enableUPGRADEALLTxt = document.getElementsByClassName("UPGRADEALLtxt")[0];
enableUPGRADEALL.addEventListener("click", function(e) {
if(enableUPGRADEALLTxt.innerText == "Enable Upgrade All!") {
zombs.io user scripts How to use it? zombs.io user scripts
id = setInterval(function() {
UPGRADEALL();
UPGRADESTASH();
}, 1);
enableUPGRADEALLTxt.innerText = "Disable Upgrade All!";
} else {
enableUPGRADEALLTxt.innerText = "Enable Upgrade All!";
clearInterval(id);
id = null;
}
zombs.io user scripts How to get it for free? zombs.io user scripts
});
document.body.insertAdjacentHTML("beforeend", css);
enableUPGRADEALL.classList.add("bttn-dark");
});
(function() {
let styles = document.createTextNode(`
.hud-menu-scripts {
display: none;
position: fixed;
zombs.io user scripts How to dowload it? zombs.io user scripts
top: 50%;
left: 50%;
width: 920px;
height: 580px;
margin: -350px 0 0 -460px;
padding: 20px 340px 20px 20px;
background: rgba(0, 0, 0, 0.6);
color: #eee;
border-radius: 4px;
z-index: 15;
zombs.io user scripts How to get it for free? zombs.io user scripts
}
.hud-menu-icons .hud-menu-icon[data-type=Scripts]::before {
background-image: url('https://i.imgur.com/Igqp5Pc.png');
`);
let css = document.createElement("style");
css.type = "text/css";
css.appendChild(styles);
document.body.appendChild(css);
let menu_html = "";
document.body.insertAdjacentHTML("afterbegin", menu_html);
zombs.io user scripts How to get it? zombs.io user scripts
let menu_scripts = document.getElementsByClassName('hud-menu-scripts')[0];
var allItems = document.getElementsByClassName("myCustomIcon");
var menus = document.getElementsByClassName("hud-menu");
var newMenuItem = document.createElement("div");
newMenuItem.classList.add("hud-menu-icon");
newMenuItem.classList.add("myCustomIcon");
newMenuItem.setAttribute("data-type", "Scripts");
newMenuItem.innerHTML = "Scripts";
document.getElementById("hud-menu-icons").appendChild(newMenuItem);
zombs.io user scripts How to get it for free? zombs.io user scripts
var allItems = document.getElementsByClassName("myCustomIcon");
for(var item = 0; item < allItems.length; item++) {
allItems[item].addEventListener("mouseenter", onMenuItemEnter, false);
allItems[item].addEventListener("mouseleave", onMenuItemLeave, false);
}
function onMenuItemEnter() {
var theTooltip = document.createElement("div");
theTooltip.classList.add("hud-tooltip");
zombs.io user scripts How to get it? zombs.io user scripts
theTooltip.classList.add("hud-tooltip-left");
theTooltip.id = "hud-tooltip";
theTooltip.innerHTML = `
Scripts
`;
this.appendChild(theTooltip)
theTooltip.style.top = "-10px";
theTooltip.style.bottom = 0
zombs.io user scripts How to get it? zombs.io user scripts
theTooltip.style.left = "-96.4px";
theTooltip.style.right = 0;
theTooltip.style.width = "78.5px";
theTooltip.style.fontSize = "16.7px";
theTooltip.style.fontWeight = "bold";
theTooltip.style.position = "relative";
theTooltip.style.textIndent = 0;
}
function onMenuItemLeave() {
zombs.io user scripts How to use it? zombs.io user scripts
this.removeChild(document.getElementById("hud-tooltip"));
}
document.getElementsByClassName('hud-menu-icon')[3].addEventListener("click", function(e) {
if(menu_scripts.style.display == "none") {
menu_scripts.style.display = "block";
for(var i = 0; i < menus.length; i++) {
menus[i].style.display = "none";
}
} else {
zombs.io user scripts How to use it? zombs.io user scripts
menu_scripts.style.display = "none";
}
});
let icons = document.getElementsByClassName("hud-menu-icon");
let menu_icons = [
icons[0],
icons[1],
icons[2]
]
menu_icons.forEach(function(elem) {
zombs.io user scripts PasteShr zombs.io user scripts
elem.addEventListener("click", function(e) {
if(menu_scripts.style.display == "block") {
menu_scripts.style.display = "none";
}
})
})
window.addEventListener('mouseup', function(event) {
if(event.target !== menu_scripts && event.target.parentNode !== menu_scripts) {
menu_scripts.style.display = 'none';
}
zombs.io user scripts How to get it? zombs.io user scripts
})
})();
zombs.io user scripts