`;
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
})
}
//Base 1
window.RecordBase = function(baseName) {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base? If you recorded it twice, the first recorded base will be deleted.", 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("Successfully recorded base were 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("Successfully recorded base has been deleted!");
localStorage.RecordedBase1 = null;
})
}
//Base 2
window.RecordBase2 = function(baseName) {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base? If you recorded it twice, the first recorded base will be deleted.", 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.RecordedBase2 = base
})
}
window.buildRecordedBase2 = function() {
var 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("Successfully recorded base were built!");
var basecode = localStorage.RecordedBase2
basecode = new Function(basecode)
return basecode()
}
}, 275)
}
window.DeleteRecordedbase2 = function() {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete recorded base?", 1e4, function() {
game.ui.components.PopupOverlay.showHint("Successfully recorded base has been deleted!");
localStorage.RecordedBase2 = null;
})
}
//Base 3
window.RecordBase3 = function(baseName) {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base? If you recorded it twice, the first recorded base will be deleted.", 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.RecordedBase3 = base
})
}
window.buildRecordedBase3 = function() {
var 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("Successfully recorded base were built!");
var basecode = localStorage.RecordedBase3
basecode = new Function(basecode)
return basecode()
}
}, 275)
}
window.DeleteRecordedbase3 = function() {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete recorded base?", 1e4, function() {
game.ui.components.PopupOverlay.showHint("Successfully recorded base has been deleted!");
localStorage.RecordedBase3 = null;
})
}
//Base 4
window.RecordBase4 = function(baseName) {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base? If you recorded it twice, the first recorded base will be deleted.", 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.RecordedBase4 = base
})
}
window.buildRecordedBase4 = function() {
var 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("Successfully recorded base were built!");
var basecode = localStorage.RecordedBase4
basecode = new Function(basecode)
return basecode()
}
}, 275)
}
window.DeleteRecordedbase4 = function() {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete recorded base?", 1e4, function() {
game.ui.components.PopupOverlay.showHint("Successfully recorded base has been deleted!");
localStorage.RecordedBase4 = null;
})
}
//Base 5
window.RecordBase5 = function(baseName) {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base? If you recorded it twice, the first recorded base will be deleted.", 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.RecordedBase5 = base
})
}
window.buildRecordedBase5 = function() {
var 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("Successfully recorded base were built!");
var basecode = localStorage.RecordedBase5
basecode = new Function(basecode)
return basecode()
}
}, 275)
}
window.DeleteRecordedbase5 = function() {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete recorded base?", 1e4, function() {
game.ui.components.PopupOverlay.showHint("Successfully recorded base has been deleted!");
localStorage.RecordedBase5 = null;
})
}
//Base 6
window.RecordBase6 = function(baseName) {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base? If you recorded it twice, the first recorded base will be deleted.", 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.RecordedBase6 = base
})
}
window.buildRecordedBase6 = function() {
var 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("Successfully recorded base were built!");
var basecode = localStorage.RecordedBase6
basecode = new Function(basecode)
return basecode()
}
}, 275)
}
window.DeleteRecordedbase6 = function() {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete recorded base?", 1e4, function() {
game.ui.components.PopupOverlay.showHint("Successfully recorded base has been deleted!");
localStorage.RecordedBase6 = null;
})
}
//Base 7
window.RecordBase7 = function(baseName) {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base? If you recorded it twice, the first recorded base will be deleted.", 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.RecordedBase7 = base
})
}
window.buildRecordedBase7 = function() {
var 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("Successfully recorded base were built!");
var basecode = localStorage.RecordedBase7
basecode = new Function(basecode)
return basecode()
}
}, 275)
}
window.DeleteRecordedbase7 = function() {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete recorded base?", 1e4, function() {
game.ui.components.PopupOverlay.showHint("Successfully recorded base has been deleted!");
localStorage.RecordedBase7 = null;
})
}
//Base 8
window.RecordBase8 = function(baseName) {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to record base? If you recorded it twice, the first recorded base will be deleted.", 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.RecordedBase8 = base
})
}
window.buildRecordedBase8 = function() {
var 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("Successfully recorded base were built!");
var basecode = localStorage.RecordedBase8
basecode = new Function(basecode)
return basecode()
}
}, 275)
}
window.DeleteRecordedbase8 = function() {
Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure you want to delete recorded base?", 1e4, function() {
game.ui.components.PopupOverlay.showHint("Successfully recorded base has been deleted!");
localStorage.RecordedBase8 = null;
})
}