// ==UserScript== // @name Xeraphinite - zombs.io // @namespace http://tampermonkey.net/ // @version 1.21 // @description fontawesome icons added! // @author rdm, god of simping // @match http://zombs.io/ // @icon https://cdn.discordapp.com/attachments/854376044522242059/907931471518502922/flowerxeraphinite.png // @grant none // @require https://greasyfork.org/scripts/47911-font-awesome-all-js/code/Font-awesome%20AllJs.js?version=275337 // @downloadURL none // ==/UserScript== // v0.1: basic html and css added // v0.2: html and css done (except party hud) // v0.3: all html and css done // v0.4: some functions added // v0.41: added credits // v0.5: reworked sell menu // v0.6: find it out yourself // v0.61: small adjustments, almost ready for release // v0.7: added crossbow toolbar icon and afs // v0.8: autobow added // v0.9: marker functions, v1.0? // v1.0: official release, added changelog button // v1.1: added rendering options, pretty big update imo // v1.2: fixed scre logger, added some small functions /* remove cringe icons & intro styles */ document.getElementsByClassName('hud-intro-name')[0].setAttribute('maxlength', 29); document.querySelectorAll('.ad-unit, .hud-intro-left, .hud-intro-youtuber, .hud-intro-footer, .hud-intro-stone, .hud-intro-tree, .hud-intro-social, .hud-intro-more-games').forEach(el => el.remove()); let cssTitle = ` .hud-intro::before { background-image: url('https://cdn.discordapp.com/attachments/854376044522242059/907880671610040330/background.jpg'); background-size: cover; } .btn:hover { cursor: pointer; } .border-theme { border: 3px solid #2eacbf; border-radius: 4px; background: none; transition: all 0.15s ease-in-out; } .border-theme:hover { cursor: pointer; border-color: #10c7e3; } .btn-theme { background-color: #1eacbf; } .btn-theme:hover { background-color: #10c7e3; } .hud-intro .hud-intro-form .hud-intro-play { background-color: #1da9bf; } .hud-intro .hud-intro-form .hud-intro-play:hover { background-color: #10c7e3; } .hud-intro .hud-intro-corner-bottom-right .hud-name-changelog-full { display: block; background: rgba(0, 0, 0, 0.2); color: rgba(255, 255, 255, 0.4); text-decoration: none; font-size: 17px; padding: 3px 8px; border-radius: 0 0 4px 4px; transition: all 0.15s ease-in-out; } .hud-intro .hud-intro-corner-bottom-right .hud-name-changelog-full:hover { color: rgba(255, 255, 255, 0.8); } `; let styles = document.createElement("style"); styles.appendChild(document.createTextNode(cssTitle)); document.head.appendChild(styles); styles.type = "text/css"; document.getElementsByClassName('hud-intro-corner-bottom-left')[0].insertAdjacentHTML("afterbegin", ` `); document.getElementsByClassName('hud-intro-corner-bottom-right')[0].insertAdjacentHTML("afterbegin", ` View game changelog `); document.getElementsByClassName('hud-intro-corner-top-left')[0].insertAdjacentHTML("afterbegin", `

Credits

+ ehScripts

+ Trollers

+ Duck

`); let crdt = document.getElementsByClassName('crdt')[0]; let xera = document.getElementsByClassName('xera')[0]; crdt.style.display = "none"; xera.addEventListener('click', function() { if(crdt.style.display == "none" || crdt.style.display == "") { crdt.style.display = "block"; } else { crdt.style.display = "none"; }; }); /* random character gen */ var availableCharacters = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890~!@#$%^&*()_+`-=[]{};':,./<>?\|"; var textLength = 29; var text = ""; for (let i = 0; i < textLength; i++) text += availableCharacters[Math.floor(Math.random() * availableCharacters.length)]; /* name stuffs here */ document.getElementsByClassName('hud-intro-name')[0].setAttribute('maxlength', 29); let guide = document.getElementsByClassName("hud-intro-guide")[0]; guide.innerHTML = `

Name Options



`; function invisiblename() { document.getElementsByClassName('hud-intro-name')[0].value = "ㅤ"; }; function randomname() { document.getElementsByClassName('hud-intro-name')[0].value = `${text}`; }; document.querySelector('.hud-intro-invisible').addEventListener('click', invisiblename); document.querySelector('.hud-intro-random').addEventListener('click', randomname); /* ui styles */ let blackShadowCSS = ` .hud-menu-icons .hud-menu-icon::before { filter: drop-shadow(1px 1px 0px #000) drop-shadow(-1px 1px 0px #000) drop-shadow(1px -1px 0px #000) drop-shadow(-1px -1px 0px #000) } `; let blackShadowStyle = document.createElement('style'); blackShadowStyle.innerHTML = blackShadowCSS; document.body.append(blackShadowStyle); document.getElementsByClassName('hud-top-right')[0].insertAdjacentHTML("beforeend", `
`); document.getElementsByClassName('hud-top-right')[0].insertAdjacentHTML("beforeend", `
`); var xyshow = document.createElement("p"); xyshow.style = 'position: relative;top: 17px;right: 0px;font-weight: 900;font-family: "Hammersmith One";text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 0.5px 0.5px #fff, -0.5px -0.5px 0 #fff, 0.5px -0.5px 0 #fff, -0.5px 0.5px 0 #fff;'; xyshow.innerHTML = "loading x/y coordinate"; xyshow.className = "xyshowcoordinate"; document.querySelector(".hud-bottom-left").appendChild(xyshow); let cssMain = ` .hud-chat .hud-chat-message { white-space: unset; word-break: break-word; } #hud-menu-party { top: 51%; width: 610px; height: 480px; background-color: rgba(28, 178, 201, 0.5); border: 5px solid white; } .hud-menu-party .hud-party-tag { width: 120px; } .hud-menu-party .hud-party-share { width: 280px; } .hud-menu-party .hud-party-grid .hud-party-link.is-active { background: #1cb2c9 !important; } .hud-menu-party .hud-party-visibility { background: #1cb2c9; } .hud-menu-party .hud-party-visibility:hover, .hud-menu-party .hud-party-visibility:active { background: #1cb2c9; } .hud-popup-overlay .hud-popup-confirmation .hud-confirmation-actions .btn.btn-green { background: #1cb2c9; } #hud-menu-shop { top: 54.5%; left: 50.5%; width: 690px; height: 500px; background-color: rgba(28, 178, 201, 0.5); border: 5px solid white; margin: -350px 0 0 -350px; padding: 20px 20px 20px 20px; } .hud-menu-shop .hud-shop-grid .hud-shop-item .hud-shop-item-actions .hud-shop-actions-equip { background: #12c0db; } .hud-menu-shop .hud-shop-grid .hud-shop-item .hud-shop-item-actions .hud-shop-actions-equip:hover, .hud-menu-shop .hud-shop-grid .hud-shop-item .hud-shop-item-actions .hud-shop-actions-equip:active { background: #1cb2c9; } .hud-menu-shop .hud-shop-grid .hud-shop-item .hud-shop-item-actions .hud-shop-actions-equip.is-disabled { background: none; } .hud-menu-shop .hud-shop-grid .hud-shop-item[data-item=HatComingSoon] .hud-shop-item-coming-soon { background: none; } #hud-menu-settings { height: 550px; background-color: rgba(28, 178, 201, 0.5); border: 5px solid white; } .hud-menu-settings .hud-xera-grid { display: block; height: 460px; padding: 10px; margin-top: 18px; background: rgba(0, 0, 0, 0.2); overflow: auto; } .hud-respawn .hud-respawn-info .hud-respawn-btn { background: #1abfd9; } .hud-respawn .hud-respawn-info .hud-respawn-btn:hover { background: #1abfd9; } #hud-building-overlay { background-color: rgba(28, 178, 201, 0.5); border: 1px solid white; } .btn.btn-green.hud-building-upgrade { background-color: #17bed1; } .hud-building-overlay .hud-tooltip-health .hud-tooltip-health-bar { background: #17d1c2; } .hud-building-overlay .hud-building-upgrade.is-disabled { background: #17bed1 !important; } .hud-menu-icons .hud-menu-icon[data-type=More]::before { background-image: url("https://media.discordapp.net/attachments/870020008128958525/876133010360107048/unknown.png"); background-size: 30px; } .hud-menu-more { background-color: rgba(28, 178, 201, 0.5); border: 5px solid white; } ::-webkit-scrollbar { width: 12px; height: 0px; background-color: #F5F5F5; } ::-webkit-scrollbar-thumb { background-color: #2eacbf; } `; let stylesMain = document.createElement("style"); stylesMain.appendChild(document.createTextNode(cssMain)); document.head.appendChild(stylesMain); stylesMain.type = "text/css"; /* main code incoming */ // // // /* main css */ let menu = document.querySelector("#hud-menu-settings"); menu.style.overflow = "auto"; menu.innerHTML = `


Sell







lte's sell numpad sucks lol

Build




no more useless spaces of code

Chat




thats all for chat, right now

Miscellaneous




AITO when?

Help



General

+ Record base(s): You can save a base with the button, "Record Base!", and build the saved base with "Build Recorded Base!" button. In case you need to delete for another one, just click "Delete Recorded Base!".

+ Upgrade All: Automatically upgrades everything in your base to maximum tier possible.

+ AHRC: Stands for "Automatic Harvester Resource Collector", automatically refills your harvester(s) and collects them back to you.

+ Exact RSS Counter: "De-truncate" your resource stats.

+ Join party by PSK function: PSK stands for Party Share Key, use this to join your previous parties!


Keybinds

- // Enable show other players' RSS.

= // Toggle Exact RSS Counter.

~ // Add a marker on the minimap.


Notice

While this script does auto-heal your player and pet, it however does not auto-respawn your pet, or your player.

Toggle showing other players' RSS is a one-time choice! Once enabled, cannot be turned off.

AFS is included in the script, please remember that it'll only equip the shield next wave.

Autobow is toggled by holding bow (any tier) and hitting "Space" key.

Markers once placed, cannot be deleted.



Xeraphinite, v1.2

`; function modm() { if(menu.style.display == "none" || menu.style.display == "") { menu.style.display = "block"; } else { menu.style.display = "none"; }; }; /* main code */ var showRSS = false; var AHRC = false; var upgradeAll = false; var petTimeout = false; var hardcoreMode = false; var heal = true; var autobow = false; var myPosx; var myPosy; let myPlayer; let myPet; game.network.addEntityUpdateHandler(() => { if (game.network.connected) { if(upgradeAll) { let entities = game.world.entities; for (var uid in entities) { if (!entities.hasOwnProperty(uid)) continue; var obj = entities[uid]; game.network.sendRpc({ name: "UpgradeBuilding", uid: obj.fromTick.uid }) } } if (AHRC) { let entities = game.world.entities for (let uid in entities) { if (!entities.hasOwnProperty(uid)) continue; let obj = entities[uid]; game.network.sendRpc({ name: "CollectHarvester", uid: obj.fromTick.uid }); if (obj.fromTick.model === "Harvester" && obj.fromTick.tier === 1) { game.network.sendRpc({ name: "AddDepositToHarvester", uid: obj.fromTick.uid, deposit: 0.07 }); } if (obj.fromTick.model === "Harvester" && obj.fromTick.tier === 2) { game.network.sendRpc({ name: "AddDepositToHarvester", uid: obj.fromTick.uid, deposit: 0.11 }); } if (obj.fromTick.model === "Harvester" && obj.fromTick.tier === 3) { game.network.sendRpc({ name: "AddDepositToHarvester", uid: obj.fromTick.uid, deposit: 0.17 }); } if (obj.fromTick.model === "Harvester" && obj.fromTick.tier === 4) { game.network.sendRpc({ name: "AddDepositToHarvester", uid: obj.fromTick.uid, deposit: 0.22 }); } if (obj.fromTick.model === "Harvester" && obj.fromTick.tier === 5) { game.network.sendRpc({ name: "AddDepositToHarvester", uid: obj.fromTick.uid, deposit: 0.25 }); } if (obj.fromTick.model === "Harvester" && obj.fromTick.tier === 6) { game.network.sendRpc({ name: "AddDepositToHarvester", uid: obj.fromTick.uid, deposit: 0.28 }); } if (obj.fromTick.model === "Harvester" && obj.fromTick.tier === 7) { game.network.sendRpc({ name: "AddDepositToHarvester", uid: obj.fromTick.uid, deposit: 0.42 }); } if (obj.fromTick.model === "Harvester" && obj.fromTick.tier === 8) { game.network.sendRpc({ name: "AddDepositToHarvester", uid: obj.fromTick.uid, deposit: 0.65 }); } } } if (showRSS) { Object.entries(game.world.entities).forEach((stuff => { if (stuff[1].targetTick.entityClass === "PlayerEntity") { var newName = stuff[1].targetTick.name + `\n Wood:` + game.world.entities[stuff[1].targetTick.uid].targetTick.wood + `\n Stone: ` + game.world.entities[stuff[1].targetTick.uid].targetTick.stone + `\n Gold: ` + game.world.entities[stuff[1].targetTick.uid].targetTick.gold + `\n Tokens:` + game.world.entities[stuff[1].targetTick.uid].targetTick.token + `\n\n\n`; game.world.entities[stuff[1].targetTick.uid].currentModel.nameEntity.setString(newName); } })) game.world.localPlayer.entity.currentModel.nameEntity.setString(game.ui.playerTick.name) } if (heal) { if (myPlayer) { let playerHealth = (myPlayer.health/myPlayer.maxHealth) * 100; if (playerHealth <= 50) { if (!window.playerTimeout_1) { window.playerTimeout_1 = true; setTimeout(() => { window.playerTimeout_1 = false; }, 300) healPlayer(); } } } } if (heal) { if (myPet) { let petHealth = (myPet.health/myPet.maxHealth) * 100; if (petHealth <= 50) { if (!petTimeout) { petTimeout = true; setTimeout(() => { petTimeout = false; }, 300); game.network.sendRpc({ "name": "BuyItem", "itemName": "PetHealthPotion", "tier": 1 }) game.network.sendRpc({ "name": "EquipItem", "itemName": "PetHealthPotion", "tier": 1 }) } } } } if (autobow) { game.network.sendInput({space: 0}) game.network.sendInput({space: 1}) } myPosx = game.ui.playerTick.position.x; myPosy = game.ui.playerTick.position.y; if (game.ui.playerTick) { if ( xyshow.innerHTML != `X: ${Math.round(myPosx)-13}, Y: ${Math.round(myPosy)-13}`) { xyshow.innerHTML = `X: ${Math.round(myPosx - 13)}, Y: ${Math.round(myPosy) - 13}`; } } } }); function healPlayer() { Game.currentGame.network.sendRpc({ "name": "EquipItem", "itemName": "HealthPotion", "tier": 1 }) Game.currentGame.network.sendRpc({ "name": "BuyItem", "itemName": "HealthPotion", "tier": 1 }) } document.getElementsByClassName("0i")[0].addEventListener('click', function() { Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete all towers?", 1e4, function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type !== "GoldStash") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } game.ui.components.PopupOverlay.showHint("Sold all."); }) }) document.getElementsByClassName("1i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "Wall") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("2i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "Door") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("3i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "SlowTrap") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("4i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "ArrowTower") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("5i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "CannonTower") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("6i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "MeleeTower") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("7i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "BombTower") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("8i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "MagicTower") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("9i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "GoldMine") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("10i")[0].addEventListener('click', function() { for(let uid in game.ui.buildings) { if(game.ui.buildings[uid].type == "Harvester") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.ui.buildings[uid].uid }); } } }) document.getElementsByClassName("11i")[0].addEventListener('click', function() { for(let uid in game.world.entities) { if(game.world.entities[uid].fromTick.model == "PetCARL" || game.world.entities[uid].fromTick.model == "PetMiner") { Game.currentGame.network.sendRpc({ name: "DeleteBuilding", uid: game.world.entities[uid].fromTick.uid }); } } }) document.getElementsByClassName("3i2")[0].addEventListener('click', function() { upgradeAll = !upgradeAll; document.getElementsByClassName("3i2")[0].className = "btn btn-green 3i2"; document.getElementsByClassName("3i2")[0].innerText = "Enable Upgrade All!"; if (upgradeAll) { document.getElementsByClassName("3i2")[0].className = "btn btn-red 3i2"; document.getElementsByClassName("3i2")[0].innerText = "Disable Upgrade All!"; } }) document.getElementsByClassName("0i4")[0].addEventListener('click', function() { AHRC = !AHRC; document.getElementsByClassName("0i4")[0].className = "btn btn-theme 0i4"; document.getElementsByClassName("0i4")[0].innerText = "Activate AHRC!"; if (AHRC) { document.getElementsByClassName("0i4")[0].className = "btn btn-red 0i4"; document.getElementsByClassName("0i4")[0].innerText = "Deactivate AHRC!"; } }) document.getElementsByClassName("1i4")[0].addEventListener('click', function() { window.frss = !window.frss document.getElementsByClassName("1i4")[0].className = "btn btn-theme 1i4"; document.getElementsByClassName("1i4")[0].innerText = "Enable Exact RSS Counter!"; if (window.frss) { document.getElementsByClassName("1i4")[0].className = "btn btn-red 1i4"; document.getElementsByClassName("1i4")[0].innerText = "Disable Exact RSS Counter!"; } }) document.getElementsByClassName("hud-Close-icon")[0].addEventListener("click", function () { menu.style.display = "none"; }); window.RecordBase = function(baseName) { Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base?", 1e4, function() { game.ui.components.PopupOverlay.showHint("Successfully recorded!"); let buildings = Game.currentGame.ui.buildings; let base = ""; let stash = GetGoldStash(); if (stash == undefined) { return } let stashPosition = { x: stash.x, y: stash.y } for (var uid in buildings) { if (!buildings.hasOwnProperty(uid)) { continue } let obj = buildings[uid] let x = Game.currentGame.ui.buildings[obj.uid].x - stashPosition.x let y = Game.currentGame.ui.buildings[obj.uid].y - stashPosition.y let building = Game.currentGame.ui.buildings[obj.uid].type let yaw = 180; base += "PlaceBuilding(stashPosition.x + " + x + ", stashPosition.y + " + y + ", '" + building + "', " + yaw + ");" } localStorage.RecordedBase1 = base }) } window.buildRecordedBase = function() { let waitForGoldStash = setInterval(function() { if (document.querySelectorAll("[data-building]")[10].classList[1] == "is-disabled") { stash = GetGoldStash(); if (stash == undefined) return stashPosition = { x: stash.x, y: stash.y } clearInterval(waitForGoldStash) game.ui.components.PopupOverlay.showHint("Base is successfully built!"); var basecode = localStorage.RecordedBase1 basecode = new Function(basecode) return basecode() } }, 275) } window.DeleteRecordedbase = function() { Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete recorded base?", 1e4, function() { game.ui.components.PopupOverlay.showHint("Recorded base has been successfully deleted!"); localStorage.RecordedBase1 = null; }) } function GetGoldStash() { for (let i in game.ui.buildings) { if (game.ui.buildings[i].type == "GoldStash") { return game.ui.buildings[i]; } } } window.PlaceBuilding = function(x, y, building, yaw) { Game.currentGame.network.sendRpc({ name: "MakeBuilding", x: x, y: y, type: building, yaw: yaw }) } // from main ultimate game.network.sendRpc2 = game.network.sendRpc; const placeWall = (x, y) => { game.network.sendRpc2({ name: 'MakeBuilding', x: x, y: y, type: "Wall", yaw: 0 }); }; game.network.sendRpc = (data) => { let gridPos = { x: data.x, y: data.y }; if(data.name === "MakeBuilding" && data.type === "Wall" && window.x3builds) { placeWall(gridPos.x, gridPos.y); placeWall(gridPos.x + 48, gridPos.y); placeWall(gridPos.x, gridPos.y + 48); placeWall(gridPos.x - 48, gridPos.y); placeWall(gridPos.x, gridPos.y - 48); placeWall(gridPos.x - 48, gridPos.y + 48); placeWall(gridPos.x + 48, gridPos.y - 48); placeWall(gridPos.x + 48, gridPos.y + 48); placeWall(gridPos.x - 48, gridPos.y - 48); }; game.network.sendRpc2(data); }; let dimension = 1; let upd = () => { const renderer = Game.currentGame.renderer; let canvasWidth = window.innerWidth * window.devicePixelRatio; let canvasHeight = window.innerHeight * window.devicePixelRatio; let ratio = canvasHeight / (1080 * dimension); renderer.scale = ratio; renderer.entities.setScale(ratio); renderer.ui.setScale(ratio); renderer.renderer.resize(canvasWidth, canvasHeight); renderer.viewport.width = renderer.renderer.width / renderer.scale + 2 * renderer.viewportPadding; renderer.viewport.height = renderer.renderer.height / renderer.scale + 2 * renderer.viewportPadding; }; const onWindowResize = () => { if (window.zoomonscroll) { upd(); console.log(dimension); } } // Zoom by Apex, modified by eh onWindowResize(); window.onresize = onWindowResize; window.onwheel = e => { if (e.deltaY > 0) { dimension += 0.02; } else if (e.deltaY < 0) { dimension -= 0.02; } onWindowResize(); } window.zoom = val => { dimension = val; upd(); }; game.network.addEntityUpdateHandler(() => { if(!window.zoomonscroll) { window.zoom(document.getElementById("zoomSlider").value); }; }); window.toggleZoS = () => { dimension -= 0.02; window.zoomonscroll = !window.zoomonscroll; let zs = document.getElementById("zsd"); zs.style.display = zs.style.display == "none" ? "block" : "none"; }; window.zoomOut = () => { let zs = document.getElementById("zoomSlider"); zs.value = parseInt(zs.value) + 1; }; window.zoomIn = () => { let zs = document.getElementById("zoomSlider"); zs.value = parseInt(zs.value) - 1; }; // cutdown version of ignition's zoom let blockedNames = []; window.blockPlayer = name => { game.ui.components.PopupOverlay.showConfirmation(`Are you sure you want to block ${name}?`, 3500, () => { blockedNames.push(name); for(let msg of Array.from(document.getElementsByClassName("hud-chat-message"))) { if(msg.childNodes[2].innerText === name) { let bl = msg.childNodes[0]; bl.innerHTML = "Unblock"; bl.style.color = "blue"; bl.onclick = () => { window.unblockPlayer(name); }; }; }; }, () => {}); }; window.unblockPlayer = name => { blockedNames.splice(blockedNames.indexOf(name), 1); for(let msg of Array.from(document.getElementsByClassName("hud-chat-message"))) { if(msg.childNodes[2].innerText === name) { let bl = msg.childNodes[0]; bl.innerHTML = "Block"; bl.style.color = "red"; bl.onclick = () => { window.blockPlayer(name); }; }; }; }; Game.currentGame.network.emitter.removeListener("PACKET_RPC", Game.currentGame.network.emitter._events.PACKET_RPC[1]); let onMessageReceived = (msg => { if(blockedNames.includes(msg.displayName) || window.chatDisabled) { return; }; let a = Game.currentGame.ui.getComponent("Chat"), b = msg.displayName.replace(/<(?:.|\n)*?>/gm, ''), c = msg.message.replace(/<(?:.|\n)*?>/gm, ''), d = a.ui.createElement(`
Block ${b}: ${c}
`); a.messagesElem.appendChild(d); a.messagesElem.scrollTop = a.messagesElem.scrollHeight; }) Game.currentGame.network.addRpcHandler("ReceiveChatMessage", onMessageReceived); // block chat messages, cutdown from ignition let chattoggle = document.getElementById("chattoggle"); window.toggleChat = () => { window.chatDisabled = !window.chatDisabled; let hcm = document.getElementsByClassName("hud-chat-messages")[0]; if(window.chatDisabled) { window.oldChatHTML = hcm.innerHTML; hcm.innerHTML = "

Disabled Chat

"; chattoggle.classList.add("btn-red"); chattoggle.classList.remove("btn-theme"); } else { hcm.innerHTML = window.oldChatHTML; chattoggle.classList.add("btn-theme"); chattoggle.classList.remove("btn-red"); }; }; // toggle chat, from ignition (function() { // modified private parties tab code, except the new tab in the party menu is used differently (not private parties) let getElement = (Element) => { return document.getElementsByClassName(Element); } let getId = (Element) => { return document.getElementById(Element); } getElement("hud-party-members")[0].style.display = "block"; getElement("hud-party-grid")[0].style.display = "none"; let privateTab2 = document.createElement("a"); privateTab2.className = "hud-party-tabs-link"; privateTab2.id = "privateTab2"; privateTab2.innerHTML = "Share Keys"; let privateHud2 = document.createElement("div"); privateHud2.className = "hud-private hud-party-grid"; privateHud2.id = "privateHud2"; privateHud2.style = "display: none;"; getElement("hud-party-tabs")[0].appendChild(privateTab2); getElement("hud-menu hud-menu-party")[0].insertBefore(privateHud2, getElement("hud-party-actions")[0]); getId("privateTab2").onclick = e => { for (let i = 0; i < getElement("hud-party-tabs-link").length; i++) { getElement("hud-party-tabs-link")[i].className = "hud-party-tabs-link"; } getId("privateTab2").className = "hud-party-tabs-link is-active"; getId("privateHud2").setAttribute("style", "display: block;"); if (getElement("hud-party-members")[0].getAttribute("style") == "display: block;") { getElement("hud-party-members")[0].setAttribute("style", "display: none;"); } if (getElement("hud-party-grid")[0].getAttribute("style") == "display: block;") { getElement("hud-party-grid")[0].setAttribute("style", "display: none;"); } if (getId("privateHud2").getAttribute("style") == "display: none;") { getId("privateHud2").setAttribute("style", "display: block;"); } } getElement("hud-party-tabs-link")[0].onmouseup = e => { getId("privateHud2").setAttribute("style", "display: none;"); if (getId("privateTab2").className == "hud-party-tabs-link is-active") { getId("privateTab2").className = "hud-party-tabs-link" } } getElement("hud-party-tabs-link")[1].onmouseup = e => { getId("privateHud2").setAttribute("style", "display: none;"); if (getId("privateTab2").className == "hud-party-tabs-link is-active") { getId("privateTab2").className = "hud-party-tabs-link" } } getId("privateHud2").innerHTML = `

Share Keys

`; game.network.addRpcHandler("PartyShareKey", function(e) { let psk = e.partyShareKey; let lnk = `http://zombs.io/#/${game.options.serverId}/${psk}/`; getId("privateHud2").innerHTML += `

${psk} [Link]

` }); document.getElementsByClassName("hud-party-actions")[0].insertAdjacentHTML("afterend", ` `); })(); // modified party tools from ignition const entirePop = document.getElementsByClassName("hud-intro-wrapper")[0].children[1]; const request = new XMLHttpRequest(); request.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { let data = JSON.parse(request.responseText); entirePop.innerHTML = `People in game now: ${data.players} - ${(data.players / data.capacity * 100).toFixed(2)}% / ${data.capacity}`; let servers = ["US East", "US West", "Europe", "Asia", "Australia", "South America"]; for (let i in servers) { game.ui.components.Intro.serverElem.children[i].setAttribute("label", `${servers[i]}: Population: ${data.regions[servers[i]].players}`); } } }; request.open("GET", "http://zombs.io/capacity", true); request.send(); // server pop by apex const fullRSS = () => { if(!window.frss) { return; }; let resources = ["wood", "stone", "gold"]; let pt = game.ui.playerTick; let rc = game.ui.components.Resources; for(let i = 0; i < resources.length; i++) { let rs = resources[i]; rc[`${rs}Elem`].innerHTML = Math.round(pt[rs]).toLocaleString("en"); }; rc.tokensElem.innerHTML = Math.round(pt.token).toLocaleString("en"); }; let sipt = setInterval(() => { game.ui.addListener('playerTickUpdate', fullRSS); }, 50); setTimeout(() => { clearInterval(sipt); }, 50); // full RSS from ignition, modified to refresh slower let toolbar = document.createElement("a"); toolbar.classList.add("hud-toolbar-item"); toolbar.classList.add("hud-toolbar-item-crossbow"); toolbar.setAttribute("data-item", "Bow"); toolbar.setAttribute("data-tier", "6"); document.getElementsByClassName("hud-toolbar-inventory")[0].appendChild(toolbar); document.getElementsByClassName("hud-toolbar-item-crossbow")[0].addEventListener("click", function() { Game.currentGame.network.sendRpc({ name: "BuyItem", itemName: "Crossbow", tier: 1}); Game.currentGame.network.sendRpc({ name: "EquipItem", itemName: "Crossbow", tier: 1}); }); // crossbow icon buy&equip var hasBeenInWorld2 = false; var hasBeenInWorld = false; game.network.addEnterWorldHandler(function () { setTimeout(() => { if (!hasBeenInWorld2) { var scoreLogged = 0; if(!hasBeenInWorld2) { hasBeenInWorld2 = true setInterval(() => { document.querySelector('#scorelog') .innerText = `Score in Wave ${game.ui.playerTick.wave}: ${scoreLogged}` }, 2000) } hasBeenInWorld2 = true; var oldScore = Game.currentGame.ui.playerTick.score, newScore = 0; Game.currentGame.network.addRpcHandler("DayCycle", (e) => { newScore = Game.currentGame.ui.playerTick.score; scoreLogged = ((newScore - oldScore).toLocaleString("en")); oldScore = Game.currentGame.ui.playerTick.score; }); const topCenter = document.querySelector(".hud-top-right"); let logElem; logElem = document.createElement('div'); logElem.innerHTML = `

Score in Wave 0: 0

`; topCenter.append(logElem); } }, 500) }) // working score logger function FixShield() { if (Game.currentGame.ui.playerTick.zombieShieldHealth < 85000) { Game.currentGame.network.sendRpc({name: "EquipItem", itemName: "ZombieShield", tier: Game.currentGame.ui.inventory.ZombieShield.tier}); } } Game.currentGame.network.addRpcHandler("DayCycle", FixShield); // ur avg afs var map = document.getElementById("hud-map"); let markerId = 1; window.addMarker = () => { map.insertAdjacentHTML("beforeend", `
${markerId++}
`) }; document.getElementsByClassName("hud-menu-icons")[0].insertAdjacentHTML("beforeend", `
`); document.body.insertAdjacentHTML('beforeend', `

Renderer





The ground will start/stop rendering.



All NPCs (including players, apparently) will start/stop rendering.



Trees, Stones, Crystals and Buildings will start/stop rendering. Can be a performance increase if you have travelled to too many places on the map...



Projectiles will start/stop rendering. Good for sitting in large bases!



Everything.

`); let smm = document.getElementsByClassName("hud-menu-more")[0]; smm.style.overflow = "auto"; window.moreMenu = () => { let mm = document.getElementsByClassName("hud-menu-more")[0]; if(["none", ""].includes(mm.style.display)) { mm.style.display = "block"; for(let i of Array.from(document.getElementsByClassName("hud-menu"))) { if(i.classList.contains('hud-menu-more')) { return; }; i.style.display = "none"; }; } else { mm.style.display = "none"; }; }; game.network.addEnterWorldHandler(() => { if(hasBeenInWorld) { return }; hasBeenInWorld = true; for(let i of Array.from(document.getElementsByClassName("hud-menu-icon"))) { console.log(i.dataset.type); if(i.dataset.type !== "More") { i.addEventListener('click', function() { document.getElementsByClassName("hud-menu-more")[0].style.display = "none"; }); }; }; let newCanvas = document.createElement("canvas"); newCanvas.style.position = "absolute"; newCanvas.style.top = "0"; newCanvas.style.left = "0"; window.mapElem.append(newCanvas); window.newCtx = newCanvas.getContext("2d"); }); document.getElementsByClassName("1z")[0].addEventListener('click', function() { window.ground(); document.getElementsByClassName("1z")[0].className = "btn btn-theme 1z"; document.getElementsByClassName("1z")[0].innerText = "Stop Rendering Ground?"; if (window.groundtoggle) { document.getElementsByClassName("1z")[0].className = "btn btn-red 1z"; document.getElementsByClassName("1z")[0].innerText = "Start Rendering Ground?"; } }) document.getElementsByClassName("1z1")[0].addEventListener('click', function() { window.grid(); document.getElementsByClassName("1z1")[0].className = "btn btn-green 1z1"; document.getElementsByClassName("1z1")[0].innerText = "Black Ground With Grid?"; if (window.gridtoggle) { document.getElementsByClassName("1z1")[0].className = "btn btn-red 1z1"; } }) document.getElementsByClassName("2z")[0].addEventListener('click', function() { window.npc(); document.getElementsByClassName("2z")[0].className = "btn btn-theme 2z"; document.getElementsByClassName("2z")[0].innerText = "Stop Rendering NPCs?"; if (window.npctoggle) { document.getElementsByClassName("2z")[0].className = "btn btn-red 2z"; document.getElementsByClassName("2z")[0].innerText = "Start Rendering NPCs?"; } }) document.getElementsByClassName("3z")[0].addEventListener('click', function() { window.env(); document.getElementsByClassName("3z")[0].className = "btn btn-theme 3z"; document.getElementsByClassName("3z")[0].innerText = "Stop Rendering Environment?"; if (window.envtoggle) { document.getElementsByClassName("3z")[0].className = "btn btn-red 3z"; document.getElementsByClassName("3z")[0].innerText = "Start Rendering Enviroment?"; } }) document.getElementsByClassName("4z")[0].addEventListener('click', function() { window.pjt(); document.getElementsByClassName("4z")[0].className = "btn btn-theme 4z"; document.getElementsByClassName("4z")[0].innerText = "Stop Rendering Projectiles?"; if (window.pjttoggle) { document.getElementsByClassName("4z")[0].className = "btn btn-red 4z"; document.getElementsByClassName("4z")[0].innerText = "Start Rendering Projectiles?"; } }) document.getElementsByClassName("5z")[0].addEventListener('click', function() { window.everything(); document.getElementsByClassName("5z")[0].className = "btn btn-theme 5z"; document.getElementsByClassName("5z")[0].innerText = `Stop Rendering Everything?`; if (window.everythingtoggle) { document.getElementsByClassName("5z")[0].className = "btn btn-red 5z"; document.getElementsByClassName("5z")[0].innerText = `Start Rendering Everything?`; } }) window.ground = () => { window.groundtoggle = !window.groundtoggle; let z1 = document.getElementById('addon') let z1button = document.getElementsByClassName("1z1")[0] if (window.groundtoggle) { game.renderer.ground.setVisible(false) z1.style.display = "block"; } else { game.renderer.ground.setVisible(true) game.renderer.ground.setAlpha(1) z1.style.display = "none"; } if (z1button.classList.contains('btn-red') && z1.style.display === "block") { game.renderer.ground.setVisible(true) game.renderer.ground.setAlpha(0.25) } } window.grid = () => { window.gridtoggle = !window.gridtoggle; if (window.gridtoggle) { game.renderer.ground.setVisible(true) game.renderer.ground.setAlpha(0.25) } else { game.renderer.ground.setVisible(false) } } window.npc = () => { window.npctoggle = !window.npctoggle; if (window.npctoggle) { game.renderer.npcs.setVisible(false) } else { game.renderer.npcs.setVisible(true) } } window.env = () => { window.envtoggle = !window.envtoggle; if (window.envtoggle) { game.renderer.scenery.setVisible(false) } else { game.renderer.scenery.setVisible(true) } } window.pjt = () => { window.pjttoggle = !window.pjttoggle; if (window.pjttoggle) { game.renderer.projectiles.setVisible(false) } else { game.renderer.projectiles.setVisible(true) } } window.everything = () => { window.everythingtoggle = !window.everythingtoggle; if (window.everythingtoggle) { game.renderer.scene.setVisible(false) } else { game.renderer.scene.setVisible(true) } } document.getElementsByClassName('hud')[0].addEventListener('mousedown', e => { if (!e.button) { game.network.sendPacket(3, { mouseDown: game.inputPacketCreator.screenToYaw(e.clientX, e.clientY) }) } smm.style.display = "none"; }) /* keybinds */ document.addEventListener('keyup', function (e) { if (e.key === "Enter" && game.ui.playerTick.dead === 1) { game.ui.components.Chat.startTyping(); }; if (e.key === "`") { window.addMarker(); game.ui.components.PopupOverlay.showHint(`Added Marker #${markerId-1}`); }; }); document.addEventListener("keydown", e => { if(document.activeElement.tagName.toLowerCase() !== "input" && document.activeElement.tagName.toLowerCase() !== "textarea") { if (e.keyCode == 189) { // key - showRSS = !showRSS; }; }; if(document.activeElement.tagName.toLowerCase() !== "input" && document.activeElement.tagName.toLowerCase() !== "textarea") { if (e.keyCode == 220) { hardcoreMode = !hardcoreMode; game.ui.components.PopupOverlay.showHint("Toggled Hardcore Mode."); }; }; if(document.activeElement.tagName.toLowerCase() !== "input" && document.activeElement.tagName.toLowerCase() !== "textarea") { if (hardcoreMode) { if (e.key === "!") { window.x3builds = !window.x3builds; game.ui.components.PopupOverlay.showHint("Toggled 3x3 Block."); }; }; }; if(document.activeElement.tagName.toLowerCase() !== "input" && document.activeElement.tagName.toLowerCase() !== "textarea") { if(e.key === "=") { document.getElementsByClassName("1i4")[0].click(); game.ui.components.PopupOverlay.showHint("Toggled Full RSS."); }; }; if(document.activeElement.tagName.toLowerCase() !== "input" && document.activeElement.tagName.toLowerCase() !== "textarea") { if(e.key === " " && game.ui.playerTick.weaponName === 'Bow') { autobow = true; }; if(game.ui.playerTick.weaponName !== 'Bow') { autobow = false; }; }; if(document.activeElement.tagName.toLowerCase() !== "input" && document.activeElement.tagName.toLowerCase() !== "textarea") { if(e.key === "x") { modm(); }; }; });