Message 25
Message 25
// @name Constellation
// @namespace -
// @author ewe kjys fr
// @version v4.5
// @description send mod
// @match *://*.moomoo.io/*
// @match *://dev.moomoo.io/*
// @run-at document_idle
// @grant none
// ==/UserScript==
let wingwingwing = false
let name1 = []
let wepgrind = false
let apper = false
let theaims = []
let outsidespike = []
let tracerere = []
let placement2 = []
let placement = []
let imastupidfuck = false
let teamHeal = []
let imhididididndinghaha = false
let pushdatsh = []
let MAUHAUAHAUHAH= []
let enemyHeal = []
let rebind = false
let hatbuy = []
let retraprape = false
let hpbar = []
let teler = []
let yarla = []
let killchatarray = [""]
let imsolegit = []
let teamSync = false
let pushline = false
let spamPLacer = false
let killper = false
let buildheal = []
let telerstop = []
let spikerstop = []
let antimega = false
let goofeh = false
let healtoggle = []
let pader = false
let paderstop = false
let replacement1 = []
let botTokens = [];
let generatedTokens = [];
let shamed = []
let spiker = []
let websocket = [];
let targetWS = [];
let names =
["Auriga","Centaurus","Serpens","Hydra","Corvus","Aries","Pisces","Aquarius","Cance
r","Aquila","Lynx"];
let botSids = []
//"Discord: vxyy0_", "1BasicNitroFor8Bots", "2BasicNitroFor12Bots", "DM Discord:
vxyy0_", "By viper"
let messages1 = [""]
let updatedURL = null;
let botActions = {connect: false,trap:false, mouseLock: true, massClan: false,
breaker: false, chat: false, botActions: false, follow: true, assassin: false,
setRep: false, close: false, circle: false, circleAngle: null, automill: true,
projectileSync: false};
let mouseActions = {X: null, Y: null, down: false, L: false, R: false}
function getEl(id) {
return document.getElementById(id);
}
// VISUAL:
config.anotherVisual = false;
config.useWebGl = false;
config.resetRender = false;
function waitTime(timeout) {
return new Promise((done) => {
setTimeout(() => {
done();
}, timeout);
});
}
// STORAGE:
let canStore;
if (typeof(Storage) !== "undefined") {
canStore = true;
}
function saveVal(name, val) {
if (canStore)
localStorage.setItem(name, val);
}
function deleteVal(name) {
if (canStore)
localStorage.removeItem(name);
}
function getSavedVal(name) {
if (canStore)
return localStorage.getItem(name);
return null;
}
// CONFIGS:
let gC = function(a, b) {
try {
let res = JSON.parse(getSavedVal(a));
if (typeof res === "object") {
return b;
} else {
return res;
}
} catch(e) {
alert("dieskid");
return b;
}
};
function setConfigs() {
return {
killChat: true,
autoBuy: true,
autoBuyEquip: true,
autoPush: true,
revTick: false,
spikeTick: false,
predictTick: true,
autoPlace: true,
autoReplace: true,
antiTrap: true,
slowOT: true,
attackDir: true,
noDir: false,
showDir: true,
autoRespawn: true
};
}
function setConfigs2() {
return {
spike: true,
spikeStopper: false,
teled: true,
teleStopper: false,
paded: true,
padedStopper: true,
goofy: false
};
}
function setConfigs3() {
return {
hp: true,
buildHP: true,
tracer: false,
teamHealnum: false,
enemyHealNum: true,
shame: false,
autoPushLine: true,
placer: false
};
}
// MENU FUNCTIONS:
window.changeMenu = function() {};
window.debug = function() {};
window.toggleNight = function() {};
window.wasdMode = function() {};
// PAGE 1:
window.startGrind = function() {};
// PAGE 3:
window.connectFillBots = function() { };
window.destroyFillBots = function() { };
window.tryConnectBots = function() { };
window.destroyBots = function() { };
window.resBuild = function() { };
window.toggleBotsCircle = function() { };
window.toggleVisual = function() { };
// SOME FUNCTIONS:
window.prepareUI = function() {};
window.leave = function() {};
class deadfuturechickenmodrevival {
constructor(flarez, lore) {
this.inGame = false;
this.lover = flarez + lore;
this.baby = "ae86";
this.isBlack = 0;
this.webSocket = undefined;
this.checkBaby = function () {
this.baby !== "ae86" ? this.isBlack++ : this.isBlack--;
if (this.isBlack >= 1) return "bl4cky";
return "noting for you";
};
this.x2 = 0;
this.y2 = 0;
this.chat = "nOOB";
this.summon = function (tmpObj) {
this.x2 = tmpObj.x;
this.y2 = tmpObj.y;
this.chat = tmpObj.name + "";
};
this.commands = function (cmd) {
cmd == "rv3link" && window.open("https://florr.io/");
cmd == "woah" &&
window.open("https://www.youtube.com/watch?v=MO0AGukzj6M");
return cmd;
};
this.dayte = "11yearold";
this.memeganoob = "69yearold";
this.startDayteSpawn = function (tmpObj) {
let ratio = setInterval(() => {
this.x2 = tmpObj.x + 20;
this.y2 = tmpObj.y - 20;
this.chat = "UR SO BAD LOL";
if (tmpObj.name == "ae86") {
this.chat = "omg ae86 go run";
setTimeout(() => {
this.inGame = false;
clearInterval(ratio);
}, 1000);
}
}, 1234);
};
this.AntiChickenModV69420 = function (tmpObj) {
};
}
};
class HtmlAction {
constructor(element) {
this.element = element;
}
add(code) {
if (!this.element) return undefined;
this.element.innerHTML += code;
}
newLine(amount) {
let result = `<br>`;
if (amount > 0) {
result = ``;
for (let i = 0; i < amount; i++) {
result += `<br>`;
}
}
this.add(result);
}
checkBox(setting) {
let newCheck = `<input type="checkbox"`;
if (setting.id) {
newCheck += ` id="${setting.id}"`;
}
if (setting.class) {
newCheck += ` class="${setting.class}"`;
}
if (setting.style) {
newCheck += ` style="${setting.style.replaceAll(" ",
"")}"`;
}
if (setting.checked) {
newCheck += ` checked`;
}
if (setting.onclick) {
newCheck += ` onclick="${setting.onclick}"`;
}
newCheck += `>`;
this.add(newCheck);
text(setting) {
let newText = `<input type="text"`;
setting.id && (newText += ` id="${setting.id}"`);
setting.style && (newText += ` style="$
{setting.style.replaceAll(" ", "")}"`);
setting.class && (newText += ` class="${setting.class}"`);
setting.size && (newText += ` size="${setting.size}"`);
setting.maxLength && (newText += ` maxLength="$
{setting.maxLength}"`);
setting.value && (newText += ` value="${setting.value}"`);
setting.placeHolder && (newText += ` placeholder="$
{setting.placeHolder.replaceAll(" ", " ")}"`);
newText += `>`;
this.add(newText);
}
select(setting) {
let newSelect = `<select`;
setting.id && (newSelect += ` id="${setting.id}"`);
setting.style && (newSelect += ` style="$
{setting.style.replaceAll(" ", "")}"`);
setting.class && (newSelect += ` class="${setting.class}"`);
newSelect += `>`;
for (let options in setting.option) {
newSelect += `<option value="$
{setting.option[options].id}"`;
setting.option[options].selected && (newSelect += `
selected`);
newSelect += `>${options}</option>`;
}
newSelect += `</select>`;
this.add(newSelect);
}
button(setting) {
let newButton = `<button`;
setting.id && (newButton += ` id="${setting.id}"`);
setting.class && (newButton += ` class="${setting.class} menuB
toggleButton"`);
setting.style && (newButton += ` style="${setting.style}"`);
if (setting.toggle) {
let isChecked = false;
newButton += ` onclick="toggleButton(this, '$
{setting.onclickOn}', '${setting.innerHTMLOn}', '${setting.onclickOff}', '$
{setting.innerHTMLOff}')">`;
newButton += `${isChecked ? setting.innerHTMLOn :
setting.innerHTMLOff}</button>`;
} else {
setting.onclick && (newButton += ` onclick="$
{setting.onclick}"`);
newButton += `>${setting.innerHTML}</button>`;
}
this.add(newButton);
}
selectMenu(setting) {
let newSelect = `<select`;
if (!setting.id) {
alert("please put id skid");
return;
}
window[setting.id + "Func"] = function() {};
setting.id && (newSelect += ` id="${setting.id}"`);
setting.style && (newSelect += ` style="$
{setting.style.replaceAll(" ", "")}"`);
setting.class && (newSelect += ` class="${setting.class}"`);
newSelect += ` onchange="window.${setting.id + 'Func'}()"`;
newSelect += `>`;
let last;
let i = 0;
for (let options in setting.menu) {
newSelect += `<option value="option_${options}" id="O_$
{options}"`;
setting.menu[options] && (newSelect += ` checked`);
newSelect += ` style="color: ${setting.menu[options] ?
'#000' : '#fff'}; background: ${setting.menu[options] ? '#8ecc51' : '#cc5151'};">$
{options}</option>`;
i++;
}
newSelect += `</select>`;
this.add(newSelect);
i = 0;
for (let options in setting.menu) {
window[options + "Func"] = function() {
setting.menu[options] = getEl("check_" +
options).checked ? true : false;
saveVal(options, setting.menu[options]);
getEl("O_" + options).style.color =
setting.menu[options] ? "#000" : "#fff";
getEl("O_" + options).style.background =
setting.menu[options] ? "#8ecc51" : "#cc5151";
};
this.checkBox({id: "check_" + options, style: `display: ${i
== 0 ? "inline-block" : "none"};`, class: "checkB", onclick: `window.${options +
'Func'}()`, checked: setting.menu[options]});
i++;
}
tabs(setting) {
let tabContainer = `<div class="tab-container" id="$
{setting.id}">`;
let tabNav = `<div class="tab-nav">`;
let tabContent = `<div class="tab-content">`;
tabNav += `</div>`;
tabContent += `</div>`;
tabContainer += tabNav + tabContent + `</div>`;
this.add(tabContainer);
let script = `
<script>
function showTab(containerId, index) {
const tabs = document.querySelectorAll('#' + containerId +
' .tab-panel');
tabs.forEach((tab, i) => {
tab.style.display = i === index ? 'block' : 'none';
});
}
</script>
`;
this.add(script);
}
}
class Html {
constructor() {
this.element = null;
this.action = null;
this.divElement = null;
set(id) {
this.element = getEl(id);
this.action = new HtmlAction(this.element);
}
resetHTML(text) {
if (text) {
this.element.innerHTML = ``;
} else {
this.element.innerHTML = ``;
}
}
setStyle(style) {
this.element.style = style;
}
setCSS(style) {
this.action.add(`<style>` + style + `</style>`);
}
}
/* Button styling */
#clear-button {
position: absolute;
top: 82%;
right: 25px;
background: #000;
color: #fff;
border: none;
border-radius: 5px;
padding: 5px 10px;
cursor: pointer;
font-size: 14px;
z-index: 1001; /* Ensure it is above the menu */
}
#clear-button:hover {
background: #333;
}
/* Slide-in effect */
@keyframes slideInFromBottom {
from {
transform: translateY(100%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.menu-notification.slide-in {
animation: slideInFromBottom 0.5s forwards;
}
@keyframes slideUp {
from {
transform: translateY(100%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.menu-notification.show {
animation: slideUp 0.5s forwards;
}
/* Glowing text */
.menu-notification .glow {
color: var(--glow-color);
font-weight: bold;
opacity: 0.9;
animation: glowAnimation 1.5s infinite;
}
@keyframes glowAnimation {
0% { opacity: 0.9; }
50% { opacity: 1; }
100% { opacity: 0.9; }
}
/* Colored text */
.menu-notification .color-yellow {
color: #ffeb3b;
}
.menu-notification .color-red {
color: #f44336;
}
.menu-notification .color-green {
color: #4caf50;
}
.menu-notification .color-blue {
color: #2196f3;
}
`;
document.head.appendChild(menuStyle);
const clearButton = document.createElement('button');
clearButton.id = 'clear-button';
clearButton.textContent = 'Clear';
menuBox.appendChild(notificationContainer);
document.body.appendChild(menuBox);
container.appendChild(notification);
.notification.slide-down {
transform: translateY(100%);
}
@keyframes slideIn {
from {
transform: scale(0.9) translateY(-10px);
opacity: 0;
}
to {
transform: scale(1) translateY(0);
opacity: 1;
}
}
.notification.show {
animation: slideIn 0.5s forwards;
}
/* Glowing text */
.notification .glow {
color: var(--glow-color); /* Set color for glow effect */
font-weight: bold; /* Optional: make text bold for better visibility */
opacity: 0.8; /* Adjust opacity for glow effect */
animation: glowAnimation 1.5s infinite;
}
@keyframes glowAnimation {
0% { opacity: 0.8; }
50% { opacity: 1; }
100% { opacity: 0.8; }
}
/* Colored text */
.notification .color-yellow {
color: #ffc107; /* Yellow */
}
.notification .color-red {
color: #dc3545; /* Red */
}
.notification .color-green {
color: #28a745; /* Green */
}
.notification .color-pink {
color: #e83e8c; /* Pink */
}
.notification .color-blue {
color: #007bff; /* Blue */
}
`;
document.head.appendChild(style);
function showNotification(...args) {
const container = document.getElementById('notification-container')
|| document.createElement('div');
if (!document.getElementById('notification-container')) {
container.id = 'notification-container';
document.body.appendChild(container);
}
container.appendChild(notification);
document.body.appendChild(menuContainer);
// Add styles
let style = document.createElement('style');// background:
url('https://steamuserimages-a.akamaihd.net/ugc/914668728147106035/7764DB84E4FCACCA
132D4EF9D594ED8185CA66CF/?imw=5000&imh=5000&ima=fit&impolicy=Letterbox&imcolor=
%23000000&letterbox=false') no-repeat center center;
style.innerHTML = `
.tm-menu-content {
display: flex;
flex-direction: column;
height: 100%;
border-radius: 15px;
overflow: hidden;
background:
url('https://steamuserimages-a.akamaihd.net/ugc/914668728147106035/7764DB84E4FCACCA
132D4EF9D594ED8185CA66CF/?imw=5000&imh=5000&ima=fit&impolicy=Letterbox&imcolor=
%23000000&letterbox=false') no-repeat center center;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
position: relative;
backdrop-filter: blur(5px);
}
.tm-tabs {
display: flex;
flex-wrap: wrap;
justify-content: center;
background: rgba(0, 0, 0, 0.6);
padding: 10px;
}
.tm-tabcontainer {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.tm-tabcontents {
flex: 1;
overflow: auto;
}
#chatbox-container, #killchatbox-container {
margin-top: 20px;
border: 1px solid #e0f2f1; /* Light teal border */
border-radius: 8px;
padding: 10px;
background-color: #f0f4f5; /* Light gray background */
}
#chatbox-display, #killchatbox-display {
max-height: 150px;
overflow-y: auto;
border-bottom: 1px solid #e0f2f1;
padding: 5px;
margin-bottom: 10px;
color: #333;
}
#chatbox-input, #killchatbox-input {
width: 100%;
padding: 10px;
border: 1px solid #e0f2f1;
border-radius: 8px;
background-color: #ffffff; /* White input background for clarity */
}
@keyframes tabGlow {
0% { box-shadow: 0 0 10px rgba(0, 188, 212, 0.3); }
50% { box-shadow: 0 0 30px rgba(0, 188, 212, 0.5); }
100% { box-shadow: 0 0 10px rgba(0, 188, 212, 0.3); }
}
@keyframes buttonShine {
0% { box-shadow: 0 0 10px rgba(0, 188, 212, 0.3); }
50% { box-shadow: 0 0 20px rgba(0, 188, 212, 0.6); }
100% { box-shadow: 0 0 10px rgba(0, 188, 212, 0.3); }
}
.tm-tabs button {
padding: 10px 20px;
margin: 0 5px;
border: none;
border-radius: 10px;
background: rgba(255, 255, 255, 0.2); /* Slightly opaque white */
color: #ffffff;
font-size: 14px;
cursor: pointer;
outline: none;
position: relative;
transition: background 0.3s ease, color 0.3s ease;
}
.tm-tabs button:hover {
background: rgba(255, 255, 255, 0.4);
}
.tm-tabs button.active {
background: rgba(255, 255, 255, 0.5);
animation: tabGlow 1.5s infinite;
}
.tm-tabcontent {
display: none;
padding: 15px;
border-top: 1px solid #e0f2f1;
background: rgba(255, 255, 255, 0.7);
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
height: calc(100% - 50px); /* Adjusted to fit above the buttons */
overflow: auto;
}
.tm-tabcontent.show {
display: block;
}
.tm-button {
padding: 10px;
margin: 5px 0;
border: none;
border-radius: 10px;
background-color: #c5cae9; /* Light blue background */
color: #000000; /* Dark text for contrast */
font-size: 14px;
cursor: pointer;
transition: background-color 0.3s ease, box-shadow 0.3s ease;
position: relative;
}
.tm-button:hover {
background-color: #9fa8da; /* Slightly darker light blue on hover */
animation: buttonShine 1.5s infinite;
}
.tm-button.active {
background-color: #7986cb; /* More intense light blue for active state */
box-shadow: 0 0 15px rgba(0, 188, 212, 0.5);
}
.tm-button:focus {
outline: none;
}
#tm-menu-header {
font-size: 24px;
color: #ffffff;
padding: 10px;
text-align: center;
background: rgba(0, 0, 0, 0.5);
border-radius: 10px;
margin-bottom: 10px;
position: relative;
}
.tm-buttons-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 10px;
background: none; /* No background color */
border-top: 1px solid #e0f2f1; /* Optional border if desired */
border-radius: 10px;
}
`;
document.head.appendChild(style);
let editingIndex = null; // Store the index of the message being edited
let editingIndex2 = null; // Store the index of the message being edited in
killchatarray
deleteButton.addEventListener('click', () => {
killchatarray.splice(index, 1); // Remove message from array
displayKillChatMessages(); // Update message display
});
messageContainer.appendChild(messageElement);
messageContainer.appendChild(deleteButton);
chatboxDisplay2.appendChild(messageContainer);
});
// Scroll to bottom
chatboxDisplay2.scrollTop = chatboxDisplay2.scrollHeight;
}
if (message) {
if (editingIndex2 !== null) {
// Replace existing message if editing
killchatarray[editingIndex2] = message;
editingIndex2 = null; // Reset editing index
} else {
// Add new message
killchatarray.push(message);
}
// Clear input
input.value = '';
}
}
});
deleteButton.addEventListener('click', () => {
messages1.splice(index, 1); // Remove message from array
displayMessages(); // Update message display
});
messageContainer.appendChild(messageElement);
messageContainer.appendChild(deleteButton);
chatboxDisplay.appendChild(messageContainer);
});
// Scroll to bottom
chatboxDisplay.scrollTop = chatboxDisplay.scrollHeight;
}
document.getElementById('chatbox-input').addEventListener('keydown',
function(event) {
if (event.key === 'Enter'&& document.activeElement.id.toLowerCase() !==
'chatbox') {
event.preventDefault();
const input = document.getElementById('chatbox-input');
const message = input.value.trim();
if (message) {
if (editingIndex !== null) {
// Replace existing message if editing
messages1[editingIndex] = message;
editingIndex = null; // Reset editing index
} else {
// Add new message
messages1.push(message);
}
// Clear input
input.value = '';
}
}
});
if (header) {
header.onmousedown = dragMouseDown;
} else {
element.onmousedown = dragMouseDown;
}
function dragMouseDown(e) {
e = e || window.event;
e.preventDefault();
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
document.onmousemove = elementDrag;
}
function elementDrag(e) {
e = e || window.event;
e.preventDefault();
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
element.style.top = (element.offsetTop - pos2) + "px";
element.style.left = (element.offsetLeft - pos1) + "px";
}
function closeDragElement() {
document.onmouseup = null;
document.onmousemove = null;
}
}
});
.particle {
position: absolute;
background-color: rgba(97, 218, 251, 0.5);
border-radius: 50%;
opacity: 0.7;
animation: particles 3s infinite ease-in-out;
}
.particle:nth-child(1) {
width: 5px;
height: 5px;
top: 20%;
left: 15%;
animation-duration: 3s;
}
.particle:nth-child(2) {
width: 10px;
height: 10px;
top: 40%;
left: 35%;
animation-duration: 4s;
}
.particle:nth-child(3) {
width: 7px;
height: 7px;
top: 60%;
left: 55%;
animation-duration: 2.5s;
}
.cselect {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 14px;
padding: 10px;
border: 2px solid rgba(97, 218, 251, 0.5);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(8px);
color: #f8f8f8;
cursor: pointer;
transition: border-color 0.3s;
appearance: none; /* Remove default styling */
-webkit-appearance: none; /* Remove default styling in WebKit browsers */
-moz-appearance: none; /* Remove default styling in Mozilla browsers */
}
.particle:nth-child(5) {
width: 6px;
height: 6px;
top: 50%;
left: 85%;
animation-duration: 4.5s;
}
@keyframes float {
0% { transform: translateY(0); }
50% { transform: translateY(-5px); }
100% { transform: translateY(0); }
}
.tabItem {
padding: 6px 12px;
margin-right: 5px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(8px);
border: 1px solid rgba(97, 218, 251, 0.5);
border-radius: 5px;
color: #f8f8f8;
text-align: center;
transition: transform 0.3s, box-shadow 0.3s;
cursor: pointer;
flex-shrink: 0;
min-width: 80px;
max-width: 120px;
overflow: hidden;
position: relative;
box-shadow: 0 0 5px rgba(97, 218, 251, 0.5);
}
.tabItem:hover {
transform: scale(1.1);
box-shadow: 0 0 10px rgba(97, 218, 251, 0.7), 0 0 20px rgba(97, 218, 251, 0.7),
0 0 30px rgba(97, 218, 251, 0.7);
}
.menuBackButton {
position: absolute;
top: 20px;
right: 10px;
cursor: pointer;
padding: 8px 12px;
background-color: #3e434d;
border: 1px solid #61dafb;
border-radius: 5px;
color: #f8f8f8;
transition: background-color 0.3s, transform 0.3s;
}
.menuBackButton:hover {
background-color: #61dafb;
transform: translateY(-2px);
}
.menuBackButton:active {
transform: scale(1.1);
}
.customCheckbox {
appearance: none;
width: 20px;
height: 20px;
border: 2px solid #ccc;
border-radius: 50%;
cursor: pointer;
position: relative;
transition: border-color 0.3s, background-color 0.3s;
}
.customCheckbox:checked {
background-color: #282c34;
border-color: #61dafb;
}
.customCheckbox:checked::after {
content: '';
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 10px;
height: 10px;
border-radius: 50%;
background-color: #61dafb;
}
.customText {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 14px;
padding: 10px;
border: 2px solid #61dafb;
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(8px);
color: #f8f8f8;
transition: border-color 0.3s, background-color 0.3s;
}
.customText:focus {
border-color: #21a1f1;
}
.selectMenu {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 14px;
padding: 10px;
border: 2px solid #ccc;
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(8px);
color: #282c34;
cursor: pointer;
transition: border-color 0.3s;
}
.selectMenu:hover {
border-color: #61dafb;
}
.button {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 16px;
padding: 12px 20px;
border: 2px solid #61dafb;
border-radius: 5px;
background-color: #282c34;
color: #f8f8f8;
cursor: pointer;
transition: background-color 0.3s, transform 0.3s;
}
.button:hover {
background-color: #21a1f1;
transform: translateY(-2px);
}
.button:active {
transform: scale(1.05);
}
/* Flex container for tabs */
.tabNavigation {
display: flex;
cursor: pointer;
border-bottom: 2px solid #61dafb;
margin-bottom: 10px;
padding: 0;
list-style: none;
}
/* Menu content */
.menuC {
display: none;
font-family: 'Hammersmith One', sans-serif;
font-size: 14px;
max-height: 200px;
user-select: none;
margin-top: 10px;
transition: max-height 0.5s ease;
overflow-y: auto;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(8px);
border: 1px solid rgba(97, 218, 251, 0.5);
}
#menuDiv {
display: none; /* Initially hide the menu */
}
`;
.chMainDiv {
font-family: "Ubuntu";
color: #fff;
font-size: 16px;
max-height: 215px;
overflow-y: scroll;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 1) rgba(255, 255, 255, .5);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
overflow-x: hidden;
}
.chMainDiv::-webkit-scrollbar {
width: 8px;
}
.chMainDiv::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.5);
}
.chMainDiv::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.7);
}
.chMainBox {
display: none;
position: absolute;
left: 10px;
color: #fff;
bottom: 10px;
width: 380px;
height: 25px;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 5px;
color: rgba(255, 255, 255, 0.75);
font-family: "HammerSmith One";
font-size: 12px;
}
.chatMessage {
margin-bottom: 5px;
padding: 5px;
border-radius: 5px;
}
`);*/
HTML.startDiv({
id: "mChDiv",
class: "chDiv"
}, (html) => {
HTML.addDiv({
id: "mChMain",
class: "chMainDiv",
appendID: "mChDiv"
}, (html) => {});
html.text({
id: "mChBox",
class: "chMainBox",
// placeHolder: `To chat click here or press "Enter" key`
});
});
menuChatBox.value = "";
menuChatBox.addEventListener("focus", () => {
menuCBFocus = true;
});
menuChatBox.addEventListener("blur", () => {
menuCBFocus = false;
});
function resetMenuChText() {
menuChats.innerHTML = ``;
menuChCounts = 0;
}
resetMenuChText();
let mStatus = document.createElement("div");
mStatus.id = "status";
getEl("gameUI").appendChild(mStatus);
HTML.set("status");
HTML.setStyle(`
display: flex;
position: fixed;
top: 20px; /* Adjust as needed */
left: 50%; /* Align to the middle of the screen */
transform: translateX(-50%);
color: #ddd; /* Default text color */
font: 18px Hammersmith One; /* Increased font size */
`);
HTML.resetHTML();
HTML.setCSS(`
.sizing {
font-size: 18px; /* Increased font size */
}
.mod {
font-size: 18px; /* Increased font size */
display: inline-block;
color: black; /* Text color */
text-shadow: 2px 2px 4px #b35900; /* Dark orange shadow */
}
.separator {
font-size: 18px; /* Increased font size */
color: black; /* Separator color */
margin: 0 8px; /* Adjusted spacing between elements */
text-shadow: 2px 2px 4px #b35900; /* Dark orange shadow */
}
`);
/*function modLog() {
let logs = [];
for (let i = 0; i < arguments.length; i++) {
logs.push(arguments[i]);
}
getEl("modLog").innerHTML = logs;
}*/
let WS = undefined;
let socketID = undefined;
WebSocket.prototype.nsend = WebSocket.prototype.send;
WebSocket.prototype.send = function (message) {
if (!WS) {
console.log(this);
WS = this;
WS.addEventListener("message", function (msg) {
getMessage(msg);
});
WS.addEventListener("close", (event) => {
if (event.code == 4001) {
window.location.reload();
}
});
}
if (WS == this) {
dontSend = false;
// SEND MESSAGE:
if (type == "6") {
if (data[0]) {
// ANTI PROFANITY:
let profanity = [];
let tmpString;
profanity.forEach((profany) => {
if (data[0].indexOf(profany) > -1) {
tmpString = "";
for (let i = 0; i < profany.length; ++i) {
if (i == 1) {
tmpString += String.fromCharCode(0);
}
tmpString += profany[i];
}
let re = new RegExp(profany, "g");
data[0] = data[0].replace(re, tmpString);
}
});
// FIX CHAT:
data[0] = data[0].slice(0, 30);
}
} else if (type == "L") {
// MAKE SAME CLAN:
data[0] = data[0] + (String.fromCharCode(0).repeat(7));
data[0] = data[0].slice(0, 7);
} else if (type == "M") {
// APPLY CYAN COLOR:
data[0].name = data[0].name == "" ? "unknown" :
data[0].name;
data[0].moofoll = true;
data[0].skin = data[0].skin == 10 ? "__proto__" :
data[0].skin;
lastsp = [data[0].name, data[0].moofoll, data[0].skin];
} else if (type == "D") {
if ((my.lastDir == data[0]) || [null,
undefined].includes(data[0])) {
dontSend = true;
} else {
my.lastDir = data[0];
}
} else if (type == "d") {
if (!data[2]) {
dontSend = true;
} else {
if (![null, undefined].includes(data[1])) {
my.lastDir = data[1];
}
}
} else if (type == "K") {
if (!data[1]) {
dontSend = true;
}
} else if (type == "S") {
instaC.wait = !instaC.wait;
dontSend = true;
} else if (type == "a") {
if (data[1]) {
if (player.moveDir == data[0]) {
dontSend = true;
}
player.moveDir = data[0];
} else {
dontSend = true;
}
}
if (!dontSend) {
let binary = window.msgpack.encode([type, data]);
this.nsend(binary);
// START COUNT:
if (!firstSend.sec) {
firstSend.sec = true;
setTimeout(() => {
firstSend.sec = false;
secPacket = 0;
}, secTime);
}
secPacket++;
}
} else {
this.nsend(message);
}
}
function packet(type) {
// EXTRACT DATA ARRAY:
let data = Array.prototype.slice.call(arguments, 1);
// SEND MESSAGE:
let binary = window.msgpack.encode([type, data]);
WS.send(binary);
}
function origPacket(type) {
// EXTRACT DATA ARRAY:
let data = Array.prototype.slice.call(arguments, 1);
// SEND MESSAGE:
let binary = window.msgpack.encode([type, data]);
WS.nsend(binary);
}
window.leave = function() {
origPacket("kys", {
"frvr is so bad": true,
"sidney is too good": true,
"dev are too weak": true,
});
};
//...lol
let io = {
send: packet
};
function getMessage(message) {
let data = new Uint8Array(message.data);
let parsed = window.msgpack.decode(data);
let type = parsed[0];
data = parsed[1];
let events = {
A: setInitData,
//B: disconnect,
C: setupGame,
D: addPlayer,
E: removePlayer,
a: updatePlayers,
G: updateLeaderboard,
H: loadGameObject,
I: loadAI,
J: animateAI,
K: gatherAnimation,
L: wiggleGameObject,
M: shootTurret,
N: updatePlayerValue,
O: updateHealth,
P: killPlayer,
Q: killObject,
R: killObjects,
S: updateItemCounts,
T: updateAge,
U: updateUpgrades,
V: updateItems,
X: addProjectile,
Y: remProjectile,
//Z: serverShutdownNotice,
//0: addAlliance,
//1: deleteAlliance,
2: allianceNotification,
3: setPlayerTeam,
4: setAlliancePlayers,
5: updateStoreItems,
6: receiveChat,
7: updateMinimap,
8: showText,
9: pingMap,
//0: pingSocketResponse,
};
if (type == "io-init") {
socketID = data[0];
} else {
if (events[type]) {
events[type].apply(undefined, data);
}
}
}
// MATHS:
Math.lerpAngle = function (value1, value2, amount) {
let difference = Math.abs(value2 - value1);
if (difference > Math.PI) {
if (value1 > value2) {
value2 += Math.PI * 2;
} else {
value1 += Math.PI * 2;
}
}
let value = value2 + ((value1 - value2) * amount);
if (value >= 0 && value <= Math.PI * 2) return value;
return value % (Math.PI * 2);
};
// REOUNDED RECTANGLE:
CanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r)
{
if (w < 2 * r) r = w / 2;
if (h < 2 * r) r = h / 2;
if (r < 0)
r = 0;
this.beginPath();
this.moveTo(x+r, y);
this.arcTo(x+w, y, x+w, y+h, r);
this.arcTo(x+w, y+h, x, y+h, r);
this.arcTo(x, y+h, x, y, r);
this.arcTo(x, y, x+w, y, r);
this.closePath();
return this;
};
// GLOBAL VALUES:
let player;
let playerSID;
let tmpObj;
let my = {
reloaded: false,
waitHit: 0,
autoAim: false,
revAim: false,
ageInsta: true,
reSync: false,
bullTick: 0,
anti0Tick: 0,
antiSync: false,
safePrimary: function (tmpObj) {
return [0, 8].includes(tmpObj.primaryIndex);
},
safeSecondary: function (tmpObj) {
return [10, 11, 14].includes(tmpObj.secondaryIndex);
},
lastDir: 0,
autoPush: false,
pushData: {}
}
function findPlayerBySID(sid) {
return findSID(players, sid);
}
function findAIBySID(sid) {
return findSID(ais, sid);
}
function findObjectBySid(sid) {
return findSID(gameObjects, sid);
}
function findProjectileBySid(sid) {
return findSID(gameObjects, sid);
}
// ON LOAD:
let inWindow = true;
window.onblur = function () {
inWindow = false;
};
window.onfocus = function () {
inWindow = true;
if (player && player.alive) {
// resetMoveDir();
}
};
if(!endpoints.length){
endpoints.push(map.getCentreNode());
}
let currentNode;
while(openSet.length){
currentNode = openSet.remove(0)
if(endpoints.some((goal) => goal.x == currentNode.x && goal.y ==
currentNode.y)){
break;
}
//recontruct path
if(!endpoints.some((goal) => goal.x == currentNode.x && goal.y ==
currentNode.y)){
currentNode = map.getLowest('h');
}
let output = [];
while(currentNode.parent){
let nextNode = currentNode.parent;
let d = Math.round(Math.atan2(nextNode.y - currentNode.y, nextNode.x -
currentNode.x) / Math.PI * 4);
if(d < 0){d+=8};
output.push(d);
currentNode = nextNode;
}
output = new Uint8Array(output.reverse()).buffer;
self.postMessage(output, [output]);
}
//approximate hypot
function fastHypot(a, b){
const c = Math.SQRT2-1;
a = Math.abs(a);
b = Math.abs(b);
if(a > b){
let temp = a;
a = b;
b = temp;
}
return (c * a) + b
}
//pathfinding instance
class WorkerAStar{
constructor(size = 1440, resolution = 8){
//setup essential variables
this.size = size;
this.res = resolution;
this.prevPos = {};
this.prevPath = [];//might change
//setup worker
this.blob = new Blob([
WorkerCode
], {
type: "application/javascript"
})
this.url = URL.createObjectURL(this.blob);
this.worker = new Worker(this.url);
this.worker.url = this.url;
//message receiving
this.worker.onmessage = (msg) => {
this.attemptFulfil(new Uint8Array(msg.data));
}
//error handling
this.worker.onerror = (err) => {
throw err;
}
this.initiateCanvas();
//test canvas
var canvasMap = document.createElement("CANVAS");
canvasMap.id = 'canvasMap';
document.body.append(canvasMap);
canvasMap.style.zIndex = "-1";
canvasMap.style = "display: none;";
this.mapWriter = canvasMap.getContext("2d");
canvasMap.width = Math.ceil(this.size * 2 / this.res) + 1;
canvasMap.height = Math.ceil(this.size * 2 / this.res) + 1;
}
//attempts to recieve a message
attemptFulfil(msg, depth = 0){
if(this.resolve){
//relay message onward
this.resolve(msg);
this.resolve = null;
}else{
//allow 5 attempts to recieve
if(depth < 5){
setTimeout(() => {
//could have just passed function as param, but
this is more "consistent"
this.attemptFulfil(msg, depth + 1);
}, 0);
}else{
console.error("Unexpected Message from Worker at ",
this);
}
}
}
this.ctx.beginPath();
this.ctx.arc(x, y, r / this.res, 0, Circle);
this.ctx.fill();
}
}
this.ctx.fillStyle = "#FFFF00";
//put players on canvas here
for(let player of nears) {
let x = (player.x - this.prevPos.x + this.size) / this.res;
let y = (player.y - this.prevPos.y + this.size) / this.res;
let r = 70;
this.ctx.beginPath();
this.ctx.arc(x, y, r / this.res, 0, Circle);
this.ctx.fill();
}
this.prevPath.unshift(currPos);
}
return;
}
//requests a path/calculation
async pathTo(positions){
//fix positions
if(!(positions instanceof Array)){
positions = [positions];
}
await this.initCalc(positions);
return this.getPath();
}
}
if(args[0] == "path"){
//start pathfinding(assuming there is a goal)
if(this.goal.type){
this.goal.pathing = true;
this.pathfinder.clearPath();
}
}else if(args[0] == "stop"){
if(this.goal.pathing){
this.goal.pathing = false;
this.pathfinder.clearPath();
io.send("a", null, 1);
}
}else if(args[0] == "goal" || args[0] == "goto"){
//goal sets goal
//goto sets a path and starts walking towards it
if(isNaN(parseInt(args[1]))){
if(args[1] == "x"){
//get to a x position
//<goal/goto> x [Number: x position]
let pos = parseInt(args[2]);
if(pos >= 0 && pos <= 14400){
this.goal.pathing = args[0] == "goto";
this.goal.type = "xpos";
this.goal.pos.x = pos;
}
}else if(args[1] == "y"){
//get to a y position
//<goal/goto> y [Number: y position]
let pos = parseInt(args[2]);
if(pos >= 0 && pos <= 14400){
this.goal.pathing = args[0] == "goto";
this.goal.type = "ypos";
this.goal.pos.y = pos;
}
}else if(args[0] == "goal" && !args[1]){
this.goal.type = "pos";
this.goal.pos.x = this.self.x;
this.goal.pos.y = this.self.y;
}
}else{
//get to a x and y position
//<goal/goto> [x: Number] [y: Number]
let xPos = parseInt(args[1]);
let yPos = parseInt(args[2]);
if(xPos >= 0 && xPos <= 14400 && yPos >= 0 && yPos <=
14400){
this.goal.pathing = args[0] == "goto";
this.goal.type = "pos";
this.goal.pos.x = xPos;
this.goal.pos.y = yPos;
}
}
}else if(args[0] == "thisway" || args[0] == "project"){
//project my position x distance from my position
//thisway [distance: Number] [angle(optional): Number]
let amt = parseInt(args[1]);
let dir = parseFloat(args[2]) || this.self.dir;
if(!isNaN(amt) && this.self.x && this.self.y &&
this.self.dir){
this.goal.type = "pos";
this.goal.pos.x = Math.max(0, Math.min(14400,
this.self.x + Math.cos(dir) * amt));
this.goal.pos.y = Math.max(0, Math.min(14400,
this.self.y + Math.sin(dir) * amt));
}
}else if(args[0] == "follow" || args[0] == "flw"){
if(args[1] == "player" || args[1] == "ply"){
//follow player <[ID: Number]/all(default)>
this.goal.pathing = true;
this.goal.type = "player";
if(args[2]){
this.goal.entity = args.slice(2).join(" ");
}else{
this.goal.entity = -1;
}
}else if(args[1] == "team"){
//follow team
this.goal.pathing = true;
this.goal.type = "team";
}else if(args[1] == "animal"){
this.goal.pathing = true;
this.goal.type = "animal";
if(args[2]){
this.goal.entity = args[2];
}else{
this.goal.entity = -1;
}
}
}else if(args[0] == "find" || args[0] == "fnd"){
//finds a object: natural or placed
//find [id: Number]
//find [name: String] [owner(optional): Number]
}else if(args[0] == "waypoint" || args[0] == "wp"){
if(args[1] == "set"){
//waypoint set [name: String]
if(Boolean(args[2]) && !this.waypoints[args[2]]){
this.waypoints[args[2]] = {
x: this.self.x,
y: this.self.y,
}
}
}else if(args[1] == "del"){
//waypoint del [name: String]
delete this.waypoints[args[2]];
}else if(args[1] == "goto"){
//waypoint goto [name: String]
if(this.waypoints[args[2]]?.x &&
this.waypoints[args[2]]?.y){
this.goal.pathing = true;
this.goal.type = "pos";
this.goal.pos.x = this.waypoints[args[2]].x;
this.goal.pos.y = this.waypoints[args[2]].y;
}
}
}else if(args[0] == "wander" || args[0] == "wnd"){
this.goal.pathing = true;
this.goal.type = "wander";
this.goal.pos.x = Math.random() * 14400;
this.goal.pos.y = Math.random() * 14400;
}else if(args[0] == "autopushtest"){
this.goal.pathing = true;
this.goal.type = "autoPushAlign";
this.goal.pos.x = Math.random() * 14400;
this.goal.pos.y = Math.random() * 14400;
}
}
//for autopush
setPosAlign(x, y) {
this.goal.pathing = true;
this.goal.type = "autoPushAlign";
this.goal.pos.x = x;
this.goal.pos.y = y;
}
//determines if we are nearing goal
reachedGoal(){
if(this.goal.type == "xpos"){
return Math.abs(this.self.x - this.goal.pos.x) <
this.pathfinder.estimatedSpeed;
}else if(this.goal.type == "ypos"){
return Math.abs(this.self.y - this.goal.pos.y) <
this.pathfinder.estimatedSpeed;
}else if(this.goal.type == "pos" || this.goal.type ==
"wander"|| this.goal.type == "autoPushAlign"){
return Math.hypot(this.self.x - this.goal.pos.x,
this.self.y - this.goal.pos.y) < this.pathfinder.estimatedSpeed;
}
}
async updatePlayers(players){
if(this.goal.pathing){
let finalGoal;
if(this.goal.type == "xpos"){
//go towards x position
finalGoal = [];
for(let i = -this.pathfinder.size; i <=
this.pathfinder.size; i++){
finalGoal.push({
x: this.goal.pos.x,
y: this.self.y + i * this.pathfinder.res,
})
}
}else if(this.goal.type == "ypos"){
//go towards y position
finalGoal = [];
for(let i = -this.pathfinder.size; i <=
this.pathfinder.size;i += 3){
finalGoal.push({
x: this.self.x + i * this.pathfinder.res,
y: this.goal.pos.y,
})
}
}else if(this.goal.type == "pos" || this.goal.type ==
"wander" || this.goal.type == "autoPushAlign"){
//simple go towards position
finalGoal = {
x: this.goal.pos.x,
y: this.goal.pos.y,
};
}else if(this.goal.type == "player"){
//do pathfinding for following player
if(this.goal.entity === -1){
finalGoal = [];
for(let player of players){
if(player.visible && player.sid !=
this.self.sid){
finalGoal.push(player)
}
}
if(!finalGoal.length){
finalGoal = null;
}
}else{
for(let player of players){
if(player.visible && player.sid !=
this.self.sid && (player.sid == this.goal.entity || player.name ==
this.goal.entity)){
finalGoal = player;
break;
}
}
}
}else if(this.goal.type == "team"){
//follow teammates
finalGoal = [];
for(let player of players){
if(player.team == this.self.team && player.sid !=
this.self.sid){
finalGoal.push(player)
}
}
if(!finalGoal.length || !this.self.team){
finalGoal = null;
}
}
if(finalGoal){
if(this.reachedGoal()){
if(this.goal.type == "wander"){
this.goal.pos.x = Math.random() * 14400;
this.goal.pos.y = Math.random() * 14400;
}else if(this.goal.type == "autoPushAlign"){
// alert("autopush alignment completed");
// if(AutoPush.active) {
AutoPush.hasAligned = true;
// }
this.goal.pathing = false;
}else{
this.goal.pathing = false;
}
this.pathfinder.clearPath();
io.send("a", null, 1);
}else{
let path = await Pathfinder.pathTo(finalGoal);
if(path){
io.send("a", path.ang, 1);
}else{
io.send("a", null, 1);
}
}
}
}
}
async updateAnimals(animals){
if(this.goal.type == "animal" && this.goal.pathing){
let finalGoal;
if(this.goal.entity === -1){
finalGoal = [];
for(let animal of animals){
if(animal.visible && animal.sid != this.self.sid){
finalGoal.push(animal)
}
}
if(!finalGoal.length){
finalGoal = null;
}
}else{
for(let animal of animals){
if(animal.visible && (animal.sid ==
this.goal.entity || animal.name == this.goal.entity)){
finalGoal = animal;
break;
}
}
}
if(this.reachedGoal()){
this.pathfinder.clearPath();
this.goal.pathing = false;
io.send("a", null, 1);
}else if(finalGoal){
let path = await this.pathfinder.pathTo(finalGoal);
if(path){
io.send("a", path.ang, 1);
}else{
io.send("a", null, 1);
}
}
}
}
async addBuilding(obj){
await new Promise((resolve) => {
let id = setInterval(() => {
if(!this.pathfinder.resolve){
resolve();
clearInterval(id);
}
})
})
let path = this.pathfinder.getPath();
let dist = path?.dist + this.pathfinder.estimatedSpeed /
this.pathfinder.res + 3;
dist = Math.min(this.pathfinder.prevPath.length - 1,
Math.trunc(dist));
if(dist){
for(let i = dist; i >= 0; i--){
let point = this.pathfinder.prevPath[i];
if(Math.hypot(point.x - obj.x, point.y - obj.y) <
obj.scale + 35){
this.pathfinder.prevPath =
this.pathfinder.prevPath.slice(i);
break;
}
}
}
this.updatePlayers(players);
}
}
var Tach = new Tachyon(Pathfinder);
/* PATHFINDER END */
class Utils {
constructor() {
// MATH UTILS:
let mathABS = Math.abs,
mathCOS = Math.cos,
mathSIN = Math.sin,
mathPOW = Math.pow,
mathSQRT = Math.sqrt,
mathATAN2 = Math.atan2,
mathPI = Math.PI;
// GLOBAL UTILS:
this.round = function(n, v) {
return Math.round(n * v) / v;
};
this.toRad = function (angle) {
return angle * (mathPI / 180);
};
this.toAng = function (radian) {
return radian / (mathPI / 180);
};
this.randInt = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
this.randFloat = function (min, max) {
return Math.random() * (max - min + 1) + min;
};
this.lerp = function (value1, value2, amount) {
return value1 + (value2 - value1) * amount;
};
this.getDist = function (t, n, i = "", o = "") {
return Math.hypot(
t[`x${i || ""}`] - n[`x${o || ""}`],
t[`y${i || ""}`] - n[`y${o || ""}`]
);
}
this.decel = function (val, cel) {
if (val > 0)
val = Math.max(0, val - cel);
else if (val < 0)
val = Math.min(0, val + cel);
return val;
};
this.getDistance = function (x1, y1, x2, y2) {
return mathSQRT((x2 -= x1) * x2 + (y2 -= y1) * y2);
};
this.getDist = function (tmp1, tmp2, type1, type2) {
let tmpXY1 = {
x: type1 == 0 ? tmp1.x : type1 == 1 ? tmp1.x1 : type1
== 2 ? tmp1.x2 : type1 == 3 && tmp1.x3,
y: type1 == 0 ? tmp1.y : type1 == 1 ? tmp1.y1 : type1
== 2 ? tmp1.y2 : type1 == 3 && tmp1.y3,
};
let tmpXY2 = {
x: type2 == 0 ? tmp2.x : type2 == 1 ? tmp2.x1 : type2
== 2 ? tmp2.x2 : type2 == 3 && tmp2.x3,
y: type2 == 0 ? tmp2.y : type2 == 1 ? tmp2.y1 : type2
== 2 ? tmp2.y2 : type2 == 3 && tmp2.y3,
};
return mathSQRT((tmpXY2.x -= tmpXY1.x) * tmpXY2.x +
(tmpXY2.y -= tmpXY1.y) * tmpXY2.y);
};
this.getDirection = function (x1, y1, x2, y2) {
return mathATAN2(y1 - y2, x1 - x2);
};
this.getDirect = function (tmp1, tmp2, type1, type2) {
let tmpXY1 = {
x: type1 == 0 ? tmp1.x : type1 == 1 ? tmp1.x1 : type1
== 2 ? tmp1.x2 : type1 == 3 && tmp1.x3,
y: type1 == 0 ? tmp1.y : type1 == 1 ? tmp1.y1 : type1
== 2 ? tmp1.y2 : type1 == 3 && tmp1.y3,
};
let tmpXY2 = {
x: type2 == 0 ? tmp2.x : type2 == 1 ? tmp2.x1 : type2
== 2 ? tmp2.x2 : type2 == 3 && tmp2.x3,
y: type2 == 0 ? tmp2.y : type2 == 1 ? tmp2.y1 : type2
== 2 ? tmp2.y2 : type2 == 3 && tmp2.y3,
};
return mathATAN2(tmpXY1.y - tmpXY2.y, tmpXY1.x - tmpXY2.x);
};
this.getAngleDist = function (a, b) {
let p = mathABS(b - a) % (mathPI * 2);
return (p > mathPI ? (mathPI * 2) - p : p);
};
this.isNumber = function (n) {
return (typeof n == "number" && !isNaN(n) && isFinite(n));
};
this.isString = function (s) {
return (s && typeof s == "string");
};
this.kFormat = function (num) {
return num > 999 ? (num / 1000).toFixed(1) + "k" : num;
};
this.sFormat = function (num) {
let fixs = [
{num: 1e3, string: "k"},
{num: 1e6, string: "m"},
{num: 1e9, string: "b"},
{num: 1e12, string: "q"}
].reverse();
let sp = fixs.find(v => num >= v.num);
if (!sp) return num;
return (num / sp.num).toFixed(1) + sp.string;
};
this.capitalizeFirst = function (string) {
return string.charAt(0).toUpperCase() + string.slice(1);
};
this.fixTo = function (n, v) {
return parseFloat(n.toFixed(v));
};
this.sortByPoints = function (a, b) {
return parseFloat(b.points) - parseFloat(a.points);
};
this.lineInRect = function (recX, recY, recX2, recY2, x1, y1,
x2, y2) {
let minX = x1;
let maxX = x2;
if (x1 > x2) {
minX = x2;
maxX = x1;
}
if (maxX > recX2)
maxX = recX2;
if (minX < recX)
minX = recX;
if (minX > maxX)
return false;
let minY = y1;
let maxY = y2;
let dx = x2 - x1;
if (Math.abs(dx) > 0.0000001) {
let a = (y2 - y1) / dx;
let b = y1 - a * x1;
minY = a * minX + b;
maxY = a * maxX + b;
}
if (minY > maxY) {
let tmp = maxY;
maxY = minY;
minY = tmp;
}
if (maxY > recY2)
maxY = recY2;
if (minY < recY)
minY = recY;
if (minY > maxY)
return false;
return true;
};
this.containsPoint = function (element, x, y) {
let bounds = element.getBoundingClientRect();
let left = bounds.left + window.scrollX;
let top = bounds.top + window.scrollY;
let width = bounds.width;
let height = bounds.height;
function touchStart(e) {
_this.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (element.onmouseover)
element.onmouseover(e);
isHovering = true;
}
function touchMove(e) {
_this.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (_this.containsPoint(element, e.pageX, e.pageY)) {
if (!isHovering) {
if (element.onmouseover)
element.onmouseover(e);
isHovering = true;
}
} else {
if (isHovering) {
if (element.onmouseout)
element.onmouseout(e);
isHovering = false;
}
}
}
function touchEnd(e) {
_this.mousifyTouchEvent(e);
window.setUsingTouch(true);
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
if (isHovering) {
if (element.onclick)
element.onclick(e);
if (element.onmouseout)
element.onmouseout(e);
isHovering = false;
}
}
};
this.removeAllChildren = function (element) {
while (element.hasChildNodes()) {
element.removeChild(element.lastChild);
}
};
this.generateElement = function (config) {
let element = document.createElement(config.tag || "div");
// UPDATE:
this.update = function(delta) {
if (this.life) {
this.life -= delta;
if (config.anotherVisual) {
this.y -= this.speed * delta * this.acc;
this.acc -= delta / (this.maxLife / 2.5);
if (this.life <= 200) {
if (this.alpha > 0) {
this.alpha = Math.max(0, this.alpha -
(delta / 300));
}
} else {
if (this.alpha < 1) {
this.alpha = Math.min(1, this.alpha +
(delta / 100));
}
}
this.x += this.ranX;
} else {
this.y -= this.speed * delta;
}
this.scale += this.scaleSpeed * delta;
if (this.scale >= this.maxScale) {
this.scale = this.maxScale;
this.scaleSpeed *= -1;
} else if (this.scale <= this.startScale) {
this.scale = this.startScale;
this.scaleSpeed = 0;
}
if (this.life <= 0) {
this.life = 0;
}
}
};
// RENDER:
this.render = function(ctxt, xOff, yOff) {
ctxt.lineWidth = 10;
ctxt.fillStyle = this.color;
ctxt.font = this.scale + "px " + (config.anotherVisual ?
"Arial" : "Hammersmith One");
if (config.anotherVisual) {
ctxt.globalAlpha = this.alpha;
ctxt.strokeStyle = darkOutlineColor;
ctxt.strokeText(this.text, this.x - xOff, this.y -
yOff);
}
ctxt.fillText(this.text, this.x - xOff, this.y - yOff);
ctxt.globalAlpha = 1;
};
}
};
class Textmanager {
// TEXT MANAGER:
constructor() {
this.texts = [];
this.stack = [];
// UPDATE:
this.update = function(delta, ctxt, xOff, yOff) {
ctxt.textBaseline = "middle";
ctxt.textAlign = "center";
for (let i = 0; i < this.texts.length; ++i) {
if (this.texts[i].life) {
this.texts[i].update(delta);
this.texts[i].render(ctxt, xOff, yOff);
}
}
};
// SHOW TEXT:
this.showText = function(x, y, scale, speed, life, text, color)
{
let tmpText;
for (let i = 0; i < this.texts.length; ++i) {
if (!this.texts[i].life) {
tmpText = this.texts[i];
break;
}
}
if (!tmpText) {
tmpText = new Animtext();
this.texts.push(tmpText);
}
tmpText.init(x, y, scale, speed, life, text, color);
// INIT:
this.init = function (x, y, dir, scale, type, data, owner) {
data = data || {};
this.sentTo = {};
this.gridLocations = [];
this.active = true;
this.alive = true;
this.doUpdate = data.doUpdate;
this.x = x;
this.y = y;
if (config.anotherVisual) {
this.dir = dir + Math.PI;
} else {
this.dir = dir;
}
this.lastDir = dir;
this.xWiggle = 0;
this.yWiggle = 0;
this.visScale = scale;
this.scale = scale;
this.type = type;
this.id = data.id;
this.owner = owner;
this.name = data.name;
this.isItem = (this.id != undefined);
this.group = data.group;
this.maxHealth = data.health;
this.health = this.maxHealth;
this.layer = 2;
if (this.group != undefined) {
this.layer = this.group.layer;
} else if (this.type == 0) {
this.layer = 3;
} else if (this.type == 2) {
this.layer = 0;
} else if (this.type == 4) {
this.layer = -1;
}
this.colDiv = data.colDiv || 1;
this.blocker = data.blocker;
this.ignoreCollision = data.ignoreCollision;
this.dontGather = data.dontGather;
this.hideFromEnemy = data.hideFromEnemy;
this.friction = data.friction;
this.projDmg = data.projDmg;
this.dmg = data.dmg;
this.pDmg = data.pDmg;
this.pps = data.pps;
this.zIndex = data.zIndex || 0;
this.turnSpeed = data.turnSpeed;
this.req = data.req;
this.trap = data.trap;
this.healCol = data.healCol;
this.teleport = data.teleport;
this.boostSpeed = data.boostSpeed;
this.projectile = data.projectile;
this.shootRange = data.shootRange;
this.shootRate = data.shootRate;
this.shootCount = this.shootRate;
this.spawnPoint = data.spawnPoint;
this.onNear = 0;
this.breakObj = false;
this.alpha = data.alpha||1;
this.maxAlpha = data.alpha||1;
this.damaged = 0;
};
// GET HIT:
this.changeHealth = function (amount, doer) {
this.health += amount;
return (this.health <= 0);
};
// GET SCALE:
this.getScale = function (sM, ig) {
sM = sM || 1;
return this.scale * ((this.isItem || this.type == 2 ||
this.type == 3 || this.type == 4) ?
1 : (0.6 * sM)) * (ig ? 1 :
this.colDiv);
};
// VISIBLE TO PLAYER:
this.visibleToPlayer = function (player) {
return !(this.hideFromEnemy) || (this.owner && (this.owner
== player ||
// UPDATE:
this.update = function (delta) {
if (this.active) {
if (this.xWiggle) {
this.xWiggle *= Math.pow(0.99, delta);
}
if (this.yWiggle) {
this.yWiggle *= Math.pow(0.99, delta);
}
if (config.anotherVisual) {
let d2 = UTILS.getAngleDist(this.lastDir,
this.dir);
if (d2 > 0.01) {
this.dir += d2 / 5;
} else {
this.dir = this.lastDir;
}
} else {
if (this.turnSpeed && this.dmg) {
this.dir += this.turnSpeed * delta;
}
}
} else {
if (this.alive) {
this.alpha -= delta / (200 / this.maxAlpha);
this.visScale += delta / (this.scale / 2.5);
if (this.alpha <= 0) {
this.alpha = 0;
this.alive = false;
}
}
}
};
// CHECK TEAM:
this.isTeamObject = function (tmpObj) {
return this.owner == null ? true : (this.owner &&
tmpObj.sid == this.owner.sid || tmpObj.findAllianceBySid(this.owner.sid));
};
}
}
class Items {
constructor() {
// ITEM GROUPS:
this.groups = [{
id: 0,
name: "food",
layer: 0
}, {
id: 1,
name: "walls",
place: true,
limit: 30,
layer: 0
}, {
id: 2,
name: "spikes",
place: true,
limit: 15,
layer: 0
}, {
id: 3,
name: "mill",
place: true,
limit: 7,
layer: 1
}, {
id: 4,
name: "mine",
place: true,
limit: 1,
layer: 0
}, {
id: 5,
name: "trap",
place: true,
limit: 6,
layer: -1
}, {
id: 6,
name: "booster",
place: true,
limit: 12,
layer: -1
}, {
id: 7,
name: "turret",
place: true,
limit: 2,
layer: 1
}, {
id: 8,
name: "watchtower",
place: true,
limit: 12,
layer: 1
}, {
id: 9,
name: "buff",
place: true,
limit: 4,
layer: -1
}, {
id: 10,
name: "spawn",
place: true,
limit: 1,
layer: -1
}, {
id: 11,
name: "sapling",
place: true,
limit: 2,
layer: 0
}, {
id: 12,
name: "blocker",
place: true,
limit: 3,
layer: -1
}, {
id: 13,
name: "teleporter",
place: true,
limit: 2,
layer: -1
}];
// PROJECTILES:
this.projectiles = [{
indx: 0,
layer: 0,
src: "arrow_1",
dmg: 25,
speed: 1.6,
scale: 103,
range: 1000
}, {
indx: 1,
layer: 1,
dmg: 25,
scale: 20
}, {
indx: 0,
layer: 0,
src: "arrow_1",
dmg: 35,
speed: 2.5,
scale: 103,
range: 1200
}, {
indx: 0,
layer: 0,
src: "arrow_1",
dmg: 30,
speed: 2,
scale: 103,
range: 1200
}, {
indx: 1,
layer: 1,
dmg: 16,
scale: 20
}, {
indx: 0,
layer: 0,
src: "bullet_1",
dmg: 50,
speed: 3.6,
scale: 160,
range: 1400
}];
// WEAPONS:
this.weapons = [{
id: 0,
type: 0,
name: "tool hammer",
desc: "tool for gathering all resources",
src: "hammer_1",
length: 140,
width: 140,
xOff: -3,
yOff: 18,
dmg: 25,
range: 65,
gather: 1,
speed: 300
}, {
id: 1,
type: 0,
age: 2,
name: "hand axe",
desc: "gathers resources at a higher rate",
src: "axe_1",
length: 140,
width: 140,
xOff: 3,
yOff: 24,
dmg: 30,
spdMult: 1,
range: 70,
gather: 2,
speed: 400
}, {
id: 2,
type: 0,
age: 8,
pre: 1,
name: "great axe",
desc: "deal more damage and gather more resources",
src: "great_axe_1",
length: 140,
width: 140,
xOff: -8,
yOff: 25,
dmg: 35,
spdMult: 1,
range: 75,
gather: 4,
speed: 400
}, {
id: 3,
type: 0,
age: 2,
name: "short sword",
desc: "increased attack power but slower move speed",
src: "sword_1",
iPad: 1.3,
length: 130,
width: 210,
xOff: -8,
yOff: 46,
dmg: 35,
spdMult: 0.85,
range: 110,
gather: 1,
speed: 300
}, {
id: 4,
type: 0,
age: 8,
pre: 3,
name: "katana",
desc: "greater range and damage",
src: "samurai_1",
iPad: 1.3,
length: 130,
width: 210,
xOff: -8,
yOff: 59,
dmg: 40,
spdMult: 0.8,
range: 118,
gather: 1,
speed: 300
}, {
id: 5,
type: 0,
age: 2,
name: "polearm",
desc: "long range melee weapon",
src: "spear_1",
iPad: 1.3,
length: 130,
width: 210,
xOff: -8,
yOff: 53,
dmg: 45,
knock: 0.2,
spdMult: 0.82,
range: 142,
gather: 1,
speed: 700
}, {
id: 6,
type: 0,
age: 2,
name: "bat",
desc: "fast long range melee weapon",
src: "bat_1",
iPad: 1.3,
length: 110,
width: 180,
xOff: -8,
yOff: 53,
dmg: 20,
knock: 0.7,
range: 110,
gather: 1,
speed: 300
}, {
id: 7,
type: 0,
age: 2,
name: "daggers",
desc: "really fast short range weapon",
src: "dagger_1",
iPad: 0.8,
length: 110,
width: 110,
xOff: 18,
yOff: 0,
dmg: 20,
knock: 0.1,
range: 65,
gather: 1,
hitSlow: 0.1,
spdMult: 1.13,
speed: 100
}, {
id: 8,
type: 0,
age: 2,
name: "stick",
desc: "great for gathering but very weak",
src: "stick_1",
length: 140,
width: 140,
xOff: 3,
yOff: 24,
dmg: 1,
spdMult: 1,
range: 70,
gather: 7,
speed: 400
}, {
id: 9,
type: 1,
age: 6,
name: "hunting bow",
desc: "bow used for ranged combat and hunting",
src: "bow_1",
req: ["wood", 4],
length: 120,
width: 120,
xOff: -6,
yOff: 0,
Pdmg: 25,
projectile: 0,
spdMult: 0.75,
speed: 600
}, {
id: 10,
type: 1,
age: 6,
name: "great hammer",
desc: "hammer used for destroying structures",
src: "great_hammer_1",
length: 140,
width: 140,
xOff: -9,
yOff: 25,
dmg: 10,
Pdmg: 10,
spdMult: 0.88,
range: 75,
sDmg: 7.5,
gather: 1,
speed: 400
}, {
id: 11,
type: 1,
age: 6,
name: "wooden shield",
desc: "blocks projectiles and reduces melee damage",
src: "shield_1",
length: 120,
width: 120,
shield: 0.2,
xOff: 6,
yOff: 0,
Pdmg: 0,
spdMult: 0.7
}, {
id: 12,
type: 1,
age: 8,
pre: 9,
name: "crossbow",
desc: "deals more damage and has greater range",
src: "crossbow_1",
req: ["wood", 5],
aboveHand: true,
armS: 0.75,
length: 120,
width: 120,
xOff: -4,
yOff: 0,
Pdmg: 35,
projectile: 2,
spdMult: 0.7,
speed: 700
}, {
id: 13,
type: 1,
age: 9,
pre: 12,
name: "repeater crossbow",
desc: "high firerate crossbow with reduced damage",
src: "crossbow_2",
req: ["wood", 10],
aboveHand: true,
armS: 0.75,
length: 120,
width: 120,
xOff: -4,
yOff: 0,
Pdmg: 30,
projectile: 3,
spdMult: 0.7,
speed: 230
}, {
id: 14,
type: 1,
age: 6,
name: "mc grabby",
desc: "steals resources from enemies",
src: "grab_1",
length: 130,
width: 210,
xOff: -8,
yOff: 53,
dmg: 0,
Pdmg: 0,
steal: 250,
knock: 0.2,
spdMult: 1.05,
range: 125,
gather: 0,
speed: 700
}, {
id: 15,
type: 1,
age: 9,
pre: 12,
name: "musket",
desc: "slow firerate but high damage and range",
src: "musket_1",
req: ["stone", 10],
aboveHand: true,
rec: 0.35,
armS: 0.6,
hndS: 0.3,
hndD: 1.6,
length: 205,
width: 205,
xOff: 25,
yOff: 0,
Pdmg: 50,
projectile: 5,
hideProjectile: true,
spdMult: 0.6,
speed: 1500
}];
// ITEMS:
this.list = [{
group: this.groups[0],
name: "apple",
desc: "restores 20 health when consumed",
req: ["food", 10],
consume: function (doer) {
return doer.changeHealth(20, doer);
},
scale: 22,
holdOffset: 15,
healing: 20,
itemID: 0,
itemAID: 16,
}, {
age: 3,
group: this.groups[0],
name: "cookie",
desc: "restores 40 health when consumed",
req: ["food", 15],
consume: function (doer) {
return doer.changeHealth(40, doer);
},
scale: 27,
holdOffset: 15,
healing: 40,
itemID: 1,
itemAID: 17,
}, {
age: 7,
group: this.groups[0],
name: "cheese",
desc: "restores 30 health and another 50 over 5 seconds",
req: ["food", 25],
consume: function (doer) {
if (doer.changeHealth(30, doer) || doer.health < 100) {
doer.dmgOverTime.dmg = -10;
doer.dmgOverTime.doer = doer;
doer.dmgOverTime.time = 5;
return true;
}
return false;
},
scale: 27,
holdOffset: 15,
healing: 30,
itemID: 2,
itemAID: 18,
}, {
group: this.groups[1],
name: "wood wall",
desc: "provides protection for your village",
req: ["wood", 10],
projDmg: true,
health: 380,
scale: 50,
holdOffset: 20,
placeOffset: -5,
itemID: 3,
itemAID: 19,
}, {
age: 3,
group: this.groups[1],
name: "stone wall",
desc: "provides improved protection for your village",
req: ["stone", 25],
health: 900,
scale: 50,
holdOffset: 20,
placeOffset: -5,
itemID: 4,
itemAID: 20,
}, {
age: 7,
group: this.groups[1],
name: "castle wall",
desc: "provides powerful protection for your village",
req: ["stone", 35],
health: 1500,
scale: 52,
holdOffset: 20,
placeOffset: -5,
itemID: 5,
itemAID: 21,
}, {
group: this.groups[2],
name: "spikes",
desc: "damages enemies when they touch them",
req: ["wood", 20, "stone", 5],
health: 400,
dmg: 20,
scale: 49,
spritePadding: -23,
holdOffset: 8,
placeOffset: -5,
itemID: 6,
itemAID: 22,
}, {
age: 5,
group: this.groups[2],
name: "greater spikes",
desc: "damages enemies when they touch them",
req: ["wood", 30, "stone", 10],
health: 500,
dmg: 35,
scale: 52,
spritePadding: -23,
holdOffset: 8,
placeOffset: -5,
itemID: 7,
itemAID: 23,
}, {
age: 9,
group: this.groups[2],
name: "poison spikes",
desc: "poisons enemies when they touch them",
req: ["wood", 35, "stone", 15],
health: 600,
dmg: 30,
pDmg: 5,
scale: 52,
spritePadding: -23,
holdOffset: 8,
placeOffset: -5,
itemID: 8,
itemAID: 24,
}, {
age: 9,
group: this.groups[2],
name: "spinning spikes",
desc: "damages enemies when they touch them",
req: ["wood", 30, "stone", 20],
health: 500,
dmg: 45,
turnSpeed: 0.003,
scale: 52,
spritePadding: -23,
holdOffset: 8,
placeOffset: -5,
itemID: 9,
itemAID: 25,
}, {
group: this.groups[3],
name: "windmill",
desc: "generates gold over time",
req: ["wood", 50, "stone", 10],
health: 400,
pps: 1,
turnSpeed: 0.0016,
spritePadding: 25,
iconLineMult: 12,
scale: 45,
holdOffset: 20,
placeOffset: 5,
itemID: 10,
itemAID: 26,
}, {
age: 5,
group: this.groups[3],
name: "faster windmill",
desc: "generates more gold over time",
req: ["wood", 60, "stone", 20],
health: 500,
pps: 1.5,
turnSpeed: 0.0025,
spritePadding: 25,
iconLineMult: 12,
scale: 47,
holdOffset: 20,
placeOffset: 5,
itemID: 11,
itemAID: 27,
}, {
age: 8,
group: this.groups[3],
name: "power mill",
desc: "generates more gold over time",
req: ["wood", 100, "stone", 50],
health: 800,
pps: 2,
turnSpeed: 0.005,
spritePadding: 25,
iconLineMult: 12,
scale: 47,
holdOffset: 20,
placeOffset: 5,
itemID: 12,
itemAID: 28,
}, {
age: 5,
group: this.groups[4],
type: 2,
name: "mine",
desc: "allows you to mine stone",
req: ["wood", 20, "stone", 100],
iconLineMult: 12,
scale: 65,
holdOffset: 20,
placeOffset: 0,
itemID: 13,
itemAID: 29,
}, {
age: 5,
group: this.groups[11],
type: 0,
name: "sapling",
desc: "allows you to farm wood",
req: ["wood", 150],
iconLineMult: 12,
colDiv: 0.5,
scale: 110,
holdOffset: 50,
placeOffset: -15,
itemID: 14,
itemAID: 30,
}, {
age: 4,
group: this.groups[5],
name: "pit trap",
desc: "pit that traps enemies if they walk over it",
req: ["wood", 30, "stone", 30],
trap: true,
ignoreCollision: true,
hideFromEnemy: true,
health: 500,
colDiv: 0.2,
scale: 50,
holdOffset: 20,
placeOffset: -5,
alpha: 0.6,
itemID: 15,
itemAID: 31,
}, {
age: 4,
group: this.groups[6],
name: "boost pad",
desc: "provides boost when stepped on",
req: ["stone", 20, "wood", 5],
ignoreCollision: true,
boostSpeed: 1.5,
health: 150,
colDiv: 0.7,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 16,
itemAID: 32,
}, {
age: 7,
group: this.groups[7],
doUpdate: true,
name: "turret",
desc: "defensive structure that shoots at enemies",
req: ["wood", 200, "stone", 150],
health: 800,
projectile: 1,
shootRange: 700,
shootRate: 2200,
scale: 43,
holdOffset: 20,
placeOffset: -5,
itemID: 17,
itemAID: 33,
}, {
age: 7,
group: this.groups[8],
name: "platform",
desc: "platform to shoot over walls and cross over water",
req: ["wood", 20],
ignoreCollision: true,
zIndex: 1,
health: 300,
scale: 43,
holdOffset: 20,
placeOffset: -5,
itemID: 18,
itemAID: 34,
}, {
age: 7,
group: this.groups[9],
name: "healing pad",
desc: "standing on it will slowly heal you",
req: ["wood", 30, "food", 10],
ignoreCollision: true,
healCol: 15,
health: 400,
colDiv: 0.7,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 19,
itemAID: 35,
}, {
age: 9,
group: this.groups[10],
name: "spawn pad",
desc: "you will spawn here when you die but it will
dissapear",
req: ["wood", 100, "stone", 100],
health: 400,
ignoreCollision: true,
spawnPoint: true,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 20,
itemAID: 36,
}, {
age: 7,
group: this.groups[12],
name: "blocker",
desc: "blocks building in radius",
req: ["wood", 30, "stone", 25],
ignoreCollision: true,
blocker: 300,
health: 400,
colDiv: 0.7,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 21,
itemAID: 37,
}, {
age: 7,
group: this.groups[13],
name: "teleporter",
desc: "teleports you to a random point on the map",
req: ["wood", 60, "stone", 60],
ignoreCollision: true,
teleport: true,
health: 200,
colDiv: 0.7,
scale: 45,
holdOffset: 20,
placeOffset: -5,
itemID: 22,
itemAID: 38
}];
// ASSIGN IDS:
for (let i = 0; i < this.list.length; ++i) {
this.list[i].id = i;
if (this.list[i].pre) this.list[i].pre = i -
this.list[i].pre;
}
// TROLOLOLOL:
if (typeof window !== "undefined") {
function shuffle(a) {
for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a;
}
//shuffle(this.list);
}
}
}
class Objectmanager {
constructor(GameObject, gameObjects, UTILS, config, players,
server) {
let mathFloor = Math.floor,
mathABS = Math.abs,
mathCOS = Math.cos,
mathSIN = Math.sin,
mathPOW = Math.pow,
mathSQRT = Math.sqrt;
this.ignoreAdd = false;
this.hitObj = [];
// DISABLE OBJ:
this.disableObj = function (obj) {
obj.active = false;
if (config.anotherVisual) {
} else {
obj.alive = false;
}
};
// ADD NEW:
let tmpObj;
this.add = function (sid, x, y, dir, s, type, data, setSID,
owner) {
tmpObj = findObjectBySid(sid);
if (!tmpObj) {
tmpObj = gameObjects.find((tmp) => !tmp.active);
if (!tmpObj) {
tmpObj = new GameObject(sid);
gameObjects.push(tmpObj);
}
}
if (setSID) {
tmpObj.sid = sid;
}
tmpObj.init(x, y, dir, s, type, data, owner);
Tach.addBuilding(tmpObj);
};
// DISABLE BY SID:
this.disableBySid = function (sid) {
let find = findObjectBySid(sid);
if (find) {
this.disableObj(find);
}
};
// CHECK IF PLACABLE:
this.checkItemLocation = function (x, y, s, sM, indx,
ignoreWater, placer) {
let cantPlace = gameObjects.find((tmp) => tmp.active &&
UTILS.getDistance(x, y, tmp.x, tmp.y) < s + (tmp.blocker ? tmp.blocker :
tmp.getScale(sM, tmp.isItem)));
if (cantPlace) return false;
if (!ignoreWater && indx != 18 && y >= config.mapScale / 2
- config.riverWidth / 2 && y <= config.mapScale / 2 + config.riverWidth / 2) return
false;
return true;
};
}
}
class Projectile {
constructor(players, ais, objectManager, items, config, UTILS,
server) {
// INIT:
this.init = function (indx, x, y, dir, spd, dmg, rng, scl,
owner) {
this.active = true;
this.tickActive = true;
this.indx = indx;
this.x = x;
this.y = y;
this.x2 = x;
this.y2 = y;
this.dir = dir;
this.skipMov = true;
this.speed = spd;
this.dmg = dmg;
this.scale = scl;
this.range = rng;
this.r2 = rng;
this.owner = owner;
};
// UPDATE:
this.update = function (delta) {
if (this.active) {
let tmpSpeed = this.speed * delta;
if (!this.skipMov) {
this.x += tmpSpeed * Math.cos(this.dir);
this.y += tmpSpeed * Math.sin(this.dir);
this.range -= tmpSpeed;
if (this.range <= 0) {
this.x += this.range * Math.cos(this.dir);
this.y += this.range * Math.sin(this.dir);
tmpSpeed = 1;
this.range = 0;
this.active = false;
}
} else {
this.skipMov = false;
}
}
};
this.tickUpdate = function (delta) {
if (this.tickActive) {
let tmpSpeed = this.speed * delta;
if (!this.skipMov) {
this.x2 += tmpSpeed * Math.cos(this.dir);
this.y2 += tmpSpeed * Math.sin(this.dir);
this.r2 -= tmpSpeed;
if (this.r2 <= 0) {
this.x2 += this.r2 * Math.cos(this.dir);
this.y2 += this.r2 * Math.sin(this.dir);
tmpSpeed = 1;
this.r2 = 0;
this.tickActive = false;
}
} else {
this.skipMov = false;
}
}
};
}
};
class Store {
constructor() {
// STORE HATS:
this.hats = [{
id: 45,
name: "Shame!",
dontSell: true,
price: 0,
scale: 120,
desc: "hacks are for winners"
}, {
id: 51,
name: "Moo Cap",
price: 0,
scale: 120,
desc: "coolest mooer around"
}, {
id: 50,
name: "Apple Cap",
price: 0,
scale: 120,
desc: "apple farms remembers"
}, {
id: 28,
name: "Moo Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 29,
name: "Pig Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 30,
name: "Fluff Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 36,
name: "Pandou Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 37,
name: "Bear Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 38,
name: "Monkey Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 44,
name: "Polar Head",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 35,
name: "Fez Hat",
price: 0,
scale: 120,
desc: "no effect"
}, {
id: 42,
name: "Enigma Hat",
price: 0,
scale: 120,
desc: "join the enigma army"
}, {
id: 43,
name: "Blitz Hat",
price: 0,
scale: 120,
desc: "hey everybody i'm blitz"
}, {
id: 49,
name: "Bob XIII Hat",
price: 0,
scale: 120,
desc: "like and subscribe"
}, {
id: 57,
name: "Pumpkin",
price: 50,
scale: 120,
desc: "Spooooky"
}, {
id: 8,
name: "Bummle Hat",
price: 100,
scale: 120,
desc: "no effect"
}, {
id: 2,
name: "Straw Hat",
price: 500,
scale: 120,
desc: "no effect"
}, {
id: 15,
name: "Winter Cap",
price: 600,
scale: 120,
desc: "allows you to move at normal speed in snow",
coldM: 1
}, {
id: 5,
name: "Cowboy Hat",
price: 1000,
scale: 120,
desc: "no effect"
}, {
id: 4,
name: "Ranger Hat",
price: 2000,
scale: 120,
desc: "no effect"
}, {
id: 18,
name: "Explorer Hat",
price: 2000,
scale: 120,
desc: "no effect"
}, {
id: 31,
name: "Flipper Hat",
price: 2500,
scale: 120,
desc: "have more control while in water",
watrImm: true
}, {
id: 1,
name: "Marksman Cap",
price: 3000,
scale: 120,
desc: "increases arrow speed and range",
aMlt: 1.3
}, {
id: 10,
name: "Bush Gear",
price: 3000,
scale: 160,
desc: "allows you to disguise yourself as a bush"
}, {
id: 48,
name: "Halo",
price: 3000,
scale: 120,
desc: "no effect"
}, {
id: 6,
name: "Soldier Helmet",
price: 4000,
scale: 120,
desc: "reduces damage taken but slows movement",
spdMult: 0.94,
dmgMult: 0.75
}, {
id: 23,
name: "Anti Venom Gear",
price: 4000,
scale: 120,
desc: "makes you immune to poison",
poisonRes: 1
}, {
id: 13,
name: "Medic Gear",
price: 5000,
scale: 110,
desc: "slowly regenerates health over time",
healthRegen: 3
}, {
id: 9,
name: "Miners Helmet",
price: 5000,
scale: 120,
desc: "earn 1 extra gold per resource",
extraGold: 1
}, {
id: 32,
name: "Musketeer Hat",
price: 5000,
scale: 120,
desc: "reduces cost of projectiles",
projCost: 0.5
}, {
id: 7,
name: "Bull Helmet",
price: 6000,
scale: 120,
desc: "increases damage done but drains health",
healthRegen: -5,
dmgMultO: 1.5,
spdMult: 0.96
}, {
id: 22,
name: "Emp Helmet",
price: 6000,
scale: 120,
desc: "turrets won't attack but you move slower",
antiTurret: 1,
spdMult: 0.7
}, {
id: 12,
name: "Booster Hat",
price: 6000,
scale: 120,
desc: "increases your movement speed",
spdMult: 1.16
}, {
id: 26,
name: "Barbarian Armor",
price: 8000,
scale: 120,
desc: "knocks back enemies that attack you",
dmgK: 0.6
}, {
id: 21,
name: "Plague Mask",
price: 10000,
scale: 120,
desc: "melee attacks deal poison damage",
poisonDmg: 5,
poisonTime: 6
}, {
id: 46,
name: "Bull Mask",
price: 10000,
scale: 120,
desc: "bulls won't target you unless you attack them",
bullRepel: 1
}, {
id: 14,
name: "Windmill Hat",
topSprite: true,
price: 10000,
scale: 120,
desc: "generates points while worn",
pps: 1.5
}, {
id: 11,
name: "Spike Gear",
topSprite: true,
price: 10000,
scale: 120,
desc: "deal damage to players that damage you",
dmg: 0.45
}, {
id: 53,
name: "Turret Gear",
topSprite: true,
price: 10000,
scale: 120,
desc: "you become a walking turret",
turret: {
proj: 1,
range: 700,
rate: 2500
},
spdMult: 0.7
}, {
id: 20,
name: "Samurai Armor",
price: 12000,
scale: 120,
desc: "increased attack speed and fire rate",
atkSpd: 0.78
}, {
id: 58,
name: "Dark Knight",
price: 12000,
scale: 120,
desc: "restores health when you deal damage",
healD: 0.4
}, {
id: 27,
name: "Scavenger Gear",
price: 15000,
scale: 120,
desc: "earn double points for each kill",
kScrM: 2
}, {
id: 40,
name: "Tank Gear",
price: 15000,
scale: 120,
desc: "increased damage to buildings but slower movement",
spdMult: 0.3,
bDmg: 3.3
}, {
id: 52,
name: "Thief Gear",
price: 15000,
scale: 120,
desc: "steal half of a players gold when you kill them",
goldSteal: 0.5
}, {
id: 55,
name: "Bloodthirster",
price: 20000,
scale: 120,
desc: "Restore Health when dealing damage. And increased
damage",
healD: 0.25,
dmgMultO: 1.2,
}, {
id: 56,
name: "Assassin Gear",
price: 20000,
scale: 120,
desc: "Go invisible when not moving. Can't eat. Increased
speed",
noEat: true,
spdMult: 1.1,
invisTimer: 1000
}];
// STORE ACCESSORIES:
this.accessories = [{
id: 12,
name: "Snowball",
price: 1000,
scale: 105,
xOff: 18,
desc: "no effect"
}, {
id: 9,
name: "Tree Cape",
price: 1000,
scale: 90,
desc: "no effect"
}, {
id: 10,
name: "Stone Cape",
price: 1000,
scale: 90,
desc: "no effect"
}, {
id: 3,
name: "Cookie Cape",
price: 1500,
scale: 90,
desc: "no effect"
}, {
id: 8,
name: "Cow Cape",
price: 2000,
scale: 90,
desc: "no effect"
}, {
id: 11,
name: "Monkey Tail",
price: 2000,
scale: 97,
xOff: 25,
desc: "Super speed but reduced damage",
spdMult: 1.35,
dmgMultO: 0.2
}, {
id: 17,
name: "Apple Basket",
price: 3000,
scale: 80,
xOff: 12,
desc: "slowly regenerates health over time",
healthRegen: 1
}, {
id: 6,
name: "Winter Cape",
price: 3000,
scale: 90,
desc: "no effect"
}, {
id: 4,
name: "Skull Cape",
price: 4000,
scale: 90,
desc: "no effect"
}, {
id: 5,
name: "Dash Cape",
price: 5000,
scale: 90,
desc: "no effect"
}, {
id: 2,
name: "Dragon Cape",
price: 6000,
scale: 90,
desc: "no effect"
}, {
id: 1,
name: "Super Cape",
price: 8000,
scale: 90,
desc: "no effect"
}, {
id: 7,
name: "Troll Cape",
price: 8000,
scale: 90,
desc: "no effect"
}, {
id: 14,
name: "Thorns",
price: 10000,
scale: 115,
xOff: 20,
desc: "no effect"
}, {
id: 15,
name: "Blockades",
price: 10000,
scale: 95,
xOff: 15,
desc: "no effect"
}, {
id: 20,
name: "Devils Tail",
price: 10000,
scale: 95,
xOff: 20,
desc: "no effect"
}, {
id: 16,
name: "Sawblade",
price: 12000,
scale: 90,
spin: true,
xOff: 0,
desc: "deal damage to players that damage you",
dmg: 0.15
}, {
id: 13,
name: "Angel Wings",
price: 15000,
scale: 138,
xOff: 22,
desc: "slowly regenerates health over time",
healthRegen: 3
}, {
id: 19,
name: "Shadow Wings",
price: 15000,
scale: 138,
xOff: 22,
desc: "increased movement speed",
spdMult: 1.1
}, {
id: 18,
name: "Blood Wings",
price: 20000,
scale: 178,
xOff: 26,
desc: "restores health when you deal damage",
healD: 0.2
}, {
id: 21,
name: "Corrupt X Wings",
price: 20000,
scale: 178,
xOff: 26,
desc: "deal damage to players that damage you",
dmg: 0.25
}];
}
};
class ProjectileManager {
constructor(Projectile, projectiles, players, ais, objectManager,
items, config, UTILS, server) {
this.addProjectile = function (x, y, dir, range, speed, indx,
owner, ignoreObj, layer, inWindow) {
let tmpData = items.projectiles[indx];
let tmpProj;
for (let i = 0; i < projectiles.length; ++i) {
if (!projectiles[i].active) {
tmpProj = projectiles[i];
break;
}
}
if (!tmpProj) {
tmpProj = new Projectile(players, ais, objectManager,
items, config, UTILS, server);
tmpProj.sid = projectiles.length;
projectiles.push(tmpProj);
}
tmpProj.init(indx, x, y, dir, speed, tmpData.dmg, range,
tmpData.scale, owner);
tmpProj.ignoreObj = ignoreObj;
tmpProj.layer = layer || tmpData.layer;
tmpProj.inWindow = inWindow;
tmpProj.src = tmpData.src;
return tmpProj;
};
}
};
class AiManager {
// AI MANAGER:
constructor(ais, AI, players, items, objectManager, config, UTILS,
scoreCallback, server) {
// AI TYPES:
this.aiTypes = [{
id: 0,
src: "cow_1",
killScore: 150,
health: 500,
weightM: 0.8,
speed: 0.00095,
turnSpeed: 0.001,
scale: 72,
drop: ["food", 50]
}, {
id: 1,
src: "pig_1",
killScore: 200,
health: 800,
weightM: 0.6,
speed: 0.00085,
turnSpeed: 0.001,
scale: 72,
drop: ["food", 80]
}, {
id: 2,
name: "Bull",
src: "bull_2",
hostile: true,
dmg: 20,
killScore: 1000,
health: 1800,
weightM: 0.5,
speed: 0.00094,
turnSpeed: 0.00074,
scale: 78,
viewRange: 800,
chargePlayer: true,
drop: ["food", 100]
}, {
id: 3,
name: "Bully",
src: "bull_1",
hostile: true,
dmg: 20,
killScore: 2000,
health: 2800,
weightM: 0.45,
speed: 0.001,
turnSpeed: 0.0008,
scale: 90,
viewRange: 900,
chargePlayer: true,
drop: ["food", 400]
}, {
id: 4,
name: "Wolf",
src: "wolf_1",
hostile: true,
dmg: 8,
killScore: 500,
health: 300,
weightM: 0.45,
speed: 0.001,
turnSpeed: 0.002,
scale: 84,
viewRange: 800,
chargePlayer: true,
drop: ["food", 200]
}, {
id: 5,
name: "Quack",
src: "chicken_1",
dmg: 8,
killScore: 2000,
noTrap: true,
health: 300,
weightM: 0.2,
speed: 0.0018,
turnSpeed: 0.006,
scale: 70,
drop: ["food", 100]
}, {
id: 6,
name: "MOOSTAFA",
nameScale: 50,
src: "enemy",
hostile: true,
dontRun: true,
fixedSpawn: true,
spawnDelay: 60000,
noTrap: true,
colDmg: 100,
dmg: 40,
killScore: 8000,
health: 18000,
weightM: 0.4,
speed: 0.0007,
turnSpeed: 0.01,
scale: 80,
spriteMlt: 1.8,
leapForce: 0.9,
viewRange: 1000,
hitRange: 210,
hitDelay: 1000,
chargePlayer: true,
drop: ["food", 100]
}, {
id: 7,
name: "Treasure",
hostile: true,
nameScale: 35,
src: "crate_1",
fixedSpawn: true,
spawnDelay: 120000,
colDmg: 200,
killScore: 5000,
health: 20000,
weightM: 0.1,
speed: 0.0,
turnSpeed: 0.0,
scale: 70,
spriteMlt: 1.0
}, {
id: 8,
name: "MOOFIE",
src: "wolf_2",
hostile: true,
fixedSpawn: true,
dontRun: true,
hitScare: 4,
spawnDelay: 30000,
noTrap: true,
nameScale: 35,
dmg: 10,
colDmg: 100,
killScore: 3000,
health: 7000,
weightM: 0.45,
speed: 0.0015,
turnSpeed: 0.002,
scale: 90,
viewRange: 800,
chargePlayer: true,
drop: ["food", 1000]
}, {
id: 9,
name: "💀MOOFIE",
src: "wolf_2",
hostile: !0,
fixedSpawn: !0,
dontRun: !0,
hitScare: 50,
spawnDelay: 6e4,
noTrap: !0,
nameScale: 35,
dmg: 12,
colDmg: 100,
killScore: 3e3,
health: 9e3,
weightM: .45,
speed: .0015,
turnSpeed: .0025,
scale: 94,
viewRange: 1440,
chargePlayer: !0,
drop: ["food", 3e3],
minSpawnRange: .85,
maxSpawnRange: .9
}, {
id: 10,
name: "💀Wolf",
src: "wolf_1",
hostile: !0,
fixedSpawn: !0,
dontRun: !0,
hitScare: 50,
spawnDelay: 3e4,
dmg: 10,
killScore: 700,
health: 500,
weightM: .45,
speed: .00115,
turnSpeed: .0025,
scale: 88,
viewRange: 1440,
chargePlayer: !0,
drop: ["food", 400],
minSpawnRange: .85,
maxSpawnRange: .9
}, {
id: 11,
name: "💀Bully",
src: "bull_1",
hostile: !0,
fixedSpawn: !0,
dontRun: !0,
hitScare: 50,
dmg: 20,
killScore: 5e3,
health: 5e3,
spawnDelay: 1e5,
weightM: .45,
speed: .00115,
turnSpeed: .0025,
scale: 94,
viewRange: 1440,
chargePlayer: !0,
drop: ["food", 800],
minSpawnRange: .85,
maxSpawnRange: .9
}];
// SPAWN AI:
this.spawn = function (x, y, dir, index) {
let tmpObj = ais.find((tmp) => !tmp.active);
if (!tmpObj) {
tmpObj = new AI(ais.length, objectManager, players,
items, UTILS, config, scoreCallback, server);
ais.push(tmpObj);
}
tmpObj.init(x, y, dir, index, this.aiTypes[index]);
return tmpObj;
};
}
};
class AI {
constructor(sid, objectManager, players, items, UTILS, config,
scoreCallback, server) {
this.sid = sid;
this.isAI = true;
this.nameIndex = UTILS.randInt(0, config.cowNames.length - 1);
// INIT:
this.init = function (x, y, dir, index, data) {
this.x = x;
this.y = y;
this.startX = data.fixedSpawn ? x : null;
this.startY = data.fixedSpawn ? y : null;
this.xVel = 0;
this.yVel = 0;
this.zIndex = 0;
this.dir = dir;
this.dirPlus = 0;
this.index = index;
this.src = data.src;
if (data.name) this.name = data.name;
this.weightM = data.weightM;
this.speed = data.speed;
this.killScore = data.killScore;
this.turnSpeed = data.turnSpeed;
this.scale = data.scale;
this.maxHealth = data.health;
this.leapForce = data.leapForce;
this.health = this.maxHealth;
this.chargePlayer = data.chargePlayer;
this.viewRange = data.viewRange;
this.drop = data.drop;
this.dmg = data.dmg;
this.hostile = data.hostile;
this.dontRun = data.dontRun;
this.hitRange = data.hitRange;
this.hitDelay = data.hitDelay;
this.hitScare = data.hitScare;
this.spriteMlt = data.spriteMlt;
this.nameScale = data.nameScale;
this.colDmg = data.colDmg;
this.noTrap = data.noTrap;
this.spawnDelay = data.spawnDelay;
this.hitWait = 0;
this.waitCount = 1000;
this.moveCount = 0;
this.targetDir = 0;
this.active = true;
this.alive = true;
this.runFrom = null;
this.chargeTarget = null;
this.dmgOverTime = {};
};
let tmpRatio = 0;
let animIndex = 0;
this.animate = function (delta) {
if (this.animTime > 0) {
this.animTime -= delta;
if (this.animTime <= 0) {
this.animTime = 0;
this.dirPlus = 0;
tmpRatio = 0;
animIndex = 0;
} else {
if (animIndex == 0) {
tmpRatio += delta / (this.animSpeed *
config.hitReturnRatio);
this.dirPlus = UTILS.lerp(0, this.targetAngle,
Math.min(1, tmpRatio));
if (tmpRatio >= 1) {
tmpRatio = 1;
animIndex = 1;
}
} else {
tmpRatio -= delta / (this.animSpeed * (1 -
config.hitReturnRatio));
this.dirPlus = UTILS.lerp(0, this.targetAngle,
Math.max(0, tmpRatio));
}
}
}
};
// ANIMATION:
this.startAnim = function () {
this.animTime = this.animSpeed = 600;
this.targetAngle = Math.PI * 0.8;
tmpRatio = 0;
animIndex = 0;
};
};
};
class Petal {
constructor(x, y) {
this.x = x;
this.y = y;
this.damage = 10;
this.health = 10;
this.maxHealth = this.health;
this.active = false;
this.alive = false;
this.timer = 1500;
this.time = 0;
this.damaged = 0;
this.alpha = 1;
this.scale = 9;
this.visScale = this.scale;
}
};
class addCh {
constructor(x, y, chat, tmpObj) {
this.x = x;
this.y = y;
this.alpha = 0;
this.active = true;
this.alive = false;
this.chat = chat;
this.owner = tmpObj;
};
};
class DeadPlayer {
constructor(x, y, dir, buildIndex, weaponIndex, weaponVariant,
skinColor, scale, name) {
this.x = x;
this.y = y;
this.lastDir = dir;
this.dir = dir + Math.PI;
this.buildIndex = buildIndex;
this.weaponIndex = weaponIndex;
this.weaponVariant = weaponVariant;
this.skinColor = skinColor;
this.scale = scale;
this.visScale = 0;
this.name = name;
this.alpha = 1;
this.active = true;
this.animate = function(delta) {
let d2 = UTILS.getAngleDist(this.lastDir, this.dir);
if (d2 > 0.01) {
this.dir += d2 / 20;
} else {
this.dir = this.lastDir;
}
if (this.visScale < this.scale) {
this.visScale += delta / (this.scale / 2);
if (this.visScale >= this.scale) {
this.visScale = this.scale;
}
}
this.alpha -= delta / 30000;
if (this.alpha <= 0) {
this.alpha = 0;
this.active = false;
}
}
}
};
class Player {
constructor(id, sid, config, UTILS, projectileManager,
objectManager, players, ais, items, hats, accessories, server, scoreCallback,
iconCallback) {
this.id = id;
this.sid = sid;
this.tmpScore = 0;
this.team = null;
this.latestSkin = 0;
this.oldSkinIndex = 0;
this.skinIndex = 0;
this.latestTail = 0;
this.oldTailIndex = 0;
this.tailIndex = 0;
this.hitTime = 0;
this.lastHit = 0;
this.tails = {};
for (let i = 0; i < accessories.length; ++i) {
if (accessories[i].price <= 0)
this.tails[accessories[i].id] = 1;
}
this.skins = {};
for (let i = 0; i < hats.length; ++i) {
if (hats[i].price <= 0)
this.skins[hats[i].id] = 1;
}
this.points = 0;
this.dt = 0;
this.hidden = false;
this.itemCounts = {};
this.isPlayer = true;
this.pps = 0;
this.moveDir = undefined;
this.skinRot = 0;
this.lastPing = 0;
this.iconIndex = 0;
this.skinColor = 0;
this.dist2 = 0;
this.aim2 = 0;
this.maxSpeed = 1;
this.chat = {
message: null,
count: 0
};
this.backupNobull = false;
this.circle = false;
this.circleRad = 200;
this.circleRadSpd = 0.1;
this.cAngle = 0;
// SPAWN:
this.spawn = function (moofoll) {
this.attacked = false;
this.death = false;
this.spinDir = 0;
this.sync = false;
this.antiBull = 0;
this.bullTimer = 0;
this.poisonTimer = 0;
this.active = true;
this.alive = true;
this.lockMove = false;
this.lockDir = false;
this.minimapCounter = 0;
this.chatCountdown = 0;
this.shameCount = 0;
this.shameTimer = 0;
this.sentTo = {};
this.gathering = 0;
this.gatherIndex = 0;
this.shooting = {};
this.shootIndex = 9;
this.autoGather = 0;
this.animTime = 0;
this.animSpeed = 0;
this.mouseState = 0;
this.buildIndex = -1;
this.weaponIndex = 0;
this.weaponCode = 0;
this.weaponVariant = 0;
this.primaryIndex = undefined;
this.secondaryIndex = undefined;
this.dmgOverTime = {};
this.noMovTimer = 0;
this.maxXP = 300;
this.XP = 0;
this.age = 1;
this.kills = 0;
this.upgrAge = 2;
this.upgradePoints = 0;
this.x = 0;
this.y = 0;
this.oldXY = {
x: 0,
y: 0
};
this.zIndex = 0;
this.xVel = 0;
this.yVel = 0;
this.slowMult = 1;
this.dir = 0;
this.dirPlus = 0;
this.targetDir = 0;
this.targetAngle = 0;
this.maxHealth = 100;
this.health = this.maxHealth;
this.oldHealth = this.maxHealth;
this.damaged = 0;
this.scale = config.playerScale;
this.speed = config.playerSpeed;
this.resetMoveDir();
this.resetResources(moofoll);
this.items = [0, 3, 6, 10];
this.weapons = [0];
this.shootCount = 0;
this.weaponXP = [];
this.reloads = {
0: 0,
1: 0,
2: 0,
3: 0,
4: 0,
5: 0,
6: 0,
7: 0,
8: 0,
9: 0,
10: 0,
11: 0,
12: 0,
13: 0,
14: 0,
15: 0,
53: 0,
};
this.bowThreat = {
9: 0,
12: 0,
13: 0,
15: 0,
};
this.damageThreat = 0;
this.inTrap = false;
this.canEmpAnti = false;
this.empAnti = false;
this.soldierAnti = false;
this.poisonTick = 0;
this.bullTick = 0;
this.setPoisonTick = false;
this.setBullTick = false;
this.antiTimer = 2;
};
// RESET RESOURCES:
this.resetResources = function (moofoll) {
for (let i = 0; i < config.resourceTypes.length; ++i) {
this[config.resourceTypes[i]] = moofoll ? 100 : 0;
}
};
// ADD ITEM:
this.getItemType = function(id) {
let findindx = this.items.findIndex((ids) => ids == id);
if (findindx != -1) {
return findindx;
} else {
return items.checkItem.index(id, this.items);
}
};
// SET DATA:
this.setData = function (data) {
this.id = data[0];
this.sid = data[1];
this.name = data[2];
this.x = data[3];
this.y = data[4];
this.dir = data[5];
this.health = data[6];
this.maxHealth = data[7];
this.scale = data[8];
this.skinColor = data[9];
};
this.bullTimer -= 1;
if (this.bullTimer <= 0) {
this.setBullTick = false;
this.bullTick = game.tick - 1;
this.bullTimer = config.serverUpdateRate;
}
this.poisonTimer -= 1;
if (this.poisonTimer <= 0) {
this.setPoisonTick = false;
this.poisonTick = game.tick - 1;
this.poisonTimer = config.serverUpdateRate;
}
};
this.update = function(delta) {
if (this.sid == playerSID) {
this.circleRad = 200||0;
this.circleRadSpd = .1||0;
this.cAngle += this.circleRadSpd;
}
if (this.active) {
// MOVE:
let gear = {
skin: findID(hats, this.skinIndex),
tail: findID(accessories, this.tailIndex)
}
let spdMult = ((this.buildIndex >= 0) ? 0.5 : 1) *
(items.weapons[this.weaponIndex].spdMult || 1) * (gear.skin ? (gear.skin.spdMult ||
1) : 1) * (gear.tail ? (gear.tail.spdMult || 1) : 1) * (this.y <=
config.snowBiomeTop ? ((gear.skin && gear.skin.coldM) ? 1 : config.snowSpeed) : 1)
* this.slowMult;
this.maxSpeed = spdMult;
}
};
let tmpRatio = 0;
let animIndex = 0;
this.animate = function(delta) {
if (this.animTime > 0) {
this.animTime -= delta;
if (this.animTime <= 0) {
this.animTime = 0;
this.dirPlus = 0;
tmpRatio = 0;
animIndex = 0;
} else {
if (animIndex == 0) {
tmpRatio += delta / (this.animSpeed *
config.hitReturnRatio);
this.dirPlus = UTILS.lerp(0, this.targetAngle,
Math.min(1, tmpRatio));
if (tmpRatio >= 1) {
tmpRatio = 1;
animIndex = 1;
}
} else {
tmpRatio -= delta / (this.animSpeed * (1-
config.hitReturnRatio));
this.dirPlus = UTILS.lerp(0, this.targetAngle,
Math.max(0, tmpRatio));
}
}
}
};
// GATHER ANIMATION:
this.startAnim = function (didHit, index) {
this.animTime = this.animSpeed =
items.weapons[index].speed;
this.targetAngle = (didHit ? -config.hitAngle : -Math.PI);
tmpRatio = 0;
animIndex = 0;
};
// CAN SEE:
this.canSee = function(other) {
if (!other) return false;
let dx = Math.abs(other.x - this.x) - other.scale;
let dy = Math.abs(other.y - this.y) - other.scale;
return dx <= (config.maxScreenWidth / 2) * 1.3 && dy <=
(config.maxScreenHeight / 2) * 1.3;
};
// SHAME SYSTEM:
this.judgeShame = function () {
if (this.oldHealth < this.health) {
if (this.hitTime) {
let timeSinceHit = game.tick - this.hitTime;
this.lastHit = game.tick;
this.hitTime = 0;
if (timeSinceHit < 2) {
this.shameCount++;
} else {
this.shameCount = Math.max(0, this.shameCount -
2);
}
}
} else if (this.oldHealth > this.health) {
this.hitTime = game.tick;
}
};
this.addShameTimer = function () {
this.shameCount = 0;
this.shameTimer = 30;
let interval = setInterval(() => {
this.shameTimer--;
if (this.shameTimer <= 0) {
clearInterval(interval);
}
}, 1000);
};
// CHECK TEAM:
this.isTeam = function (tmpObj) {
return (this == tmpObj || (this.team && this.team ==
tmpObj.team));
};
checkPlace(player.getItemType(22),getSafeDir, 1,);
}
}
if (this.reloads[this.primaryIndex] == 0 &&
this.reloads[this.weaponIndex] == 0) {
this.antiBull++;
game.tickBase(() => {
this.antiBull = 0;
}, 1);
}
}
}
}
};
}
};
// SOME CODES:
function sendUpgrade(index) {
player.reloads[index] = 0;
packet("H", index);
}
// HEALING:
function soldierMult() {
return player.latestSkin == 6 ? 0.75 : 1;
}
function healthBased() {
if (player.health == 100)
return 0;
if ((player.skinIndex != 45 && player.skinIndex != 56)) {
return Math.ceil((100 - player.health) /
items.list[player.items[0]].healing);
}
return 0;
}
function getAttacker(damaged) {
let attackers = enemy.filter(tmp => {
//let damages = new Damages(items);
//let dmg = damages.weapons[tmp.weaponIndex];
//let by = tmp.weaponIndex < 9 ? [dmg[0], dmg[1], dmg[2],
dmg[3]] : [dmg[0], dmg[1]];
let rule = {
//one: tmp.dist2 <= 300,
//two: by.includes(damaged),
three: tmp.attacked
}
return /*rule.one && rule.two && */rule.three;
});
return attackers;
}
function healer() {
for (let i = 0; i < healthBased(); i++) {
place(0, getAttackDir());
}
}
function stray(ape){
if(traps.inTrap){
instaC.canSpikeTick = false;
}
}
function sprat(a){
}
function antiSyncHealing(timearg) {
if(!near.primaryIndex == 7){
my.antiSync = true;
let healAnti = setInterval(() => {
if (player.shameCount < 5) {
place(0, getAttackDir());
}
}, 75);
setTimeout(() => {
clearInterval(healAnti);
setTimeout(() => {
my.antiSync = false;
}, game.tickRate);
}, game.tickRate);
}
}
let nearSpike = []
let nearTele = []
let nearPad = []
nearSpike = false
function biomeGear(mover, returns) {
if(imsolegit){
if (player.y2 >= config.mapScale / 2 - config.riverWidth / 2 &&
player.y2 <= config.mapScale / 2 + config.riverWidth / 2) {
if (returns) return 31;
buyEquip(31, 0);
} else {
if(player.shameCount >0){
} else if (player.y2 <= config.snowBiomeTop) {
if (returns) return mover && player.moveDir ==
undefined ? 6 : 15;
buyEquip(mover && player.moveDir == undefined ? 6 : 15,
0);
} else {
if (returns) return mover && player.moveDir ==
undefined ? 6: 12;
buyEquip(mover && player.moveDir == undefined ? 6 : 12,
0);
}
}
if (returns) return 0;
nearSpike = false
}
}
function woah(mover) {
buyEquip(mover && player.moveDir == undefined ? 13 : 11, 1);
}
if (cantPlace) continue;
buyEquip(6,0)
buyEquip(6,0)
buyEquip(6,0)
return true;
}
}
} catch (err) {
return null;
}
return false;
}
this.protect = function (aim) {
if (!configs.antiTrap) return;
if (player.items[2] && near.dist2 <= 300){
this.testCanPlace(4, -(Math.PI / 2), (Math.PI / 2),
(Math.PI / 18), aim + Math.PI);
this.antiTrapped = true;
}
};
let lastPlacementTime = 0;
function calculateStartAngle(baseAngle, additionalFactor) {
return baseAngle + additionalFactor; // Adjust as needed
}
this.autoPlace = function () {
if (placement&& imsolegit) {
if (enemy.length) {
throttlePlacement(() => {
if (gameObjects.length) {
let near2 = {
inTrap: false,
};
if (nearTrap) {
near2.inTrap = true;
} else {
near2.inTrap = false;
}
if(outsidespike){
this.testCanPlace(2, -
(Math.PI / 24), (Math.PI / 24), (Math.PI / 24), near.aim2, 1);
instaC.canSpikeTick = false;
instaC.syncHit = false;
}
if (player.items[4] == 15) {
// Test for placement over a
full 360 degrees
let startAngle = -(Math.PI); //
Start at -180 degrees (full left)
let endAngle = (Math.PI); //
End at 180 degrees (full right)
let stepSize = (Math.PI /
48); // Increase step size for wider spread, but not too dense
this.testCanPlace(4,
startAngle, endAngle, stepSize, 1);
} } else{
if (nearTrap && near.dist2 >=
nearTrap.scale + near.scale+55 && !traps.inTrap && near.dist2 <= 285) {
if (player.items[4] == 15)
{
// Test for placement
over a full 360 degrees
let startAngle = -
(Math.PI); // Start at -180 degrees (full left)
let endAngle =
(Math.PI); // End at 180 degrees (full right)
let stepSize = (Math.PI
/ 48); // Increase step size for wider spread, but not too dense
this.testCanPlace(4,
startAngle, endAngle, stepSize, 1);
}
}
}
}
});
}
if (gameObjects.length) {
let near2 = {
inTrap: false,
};
if (nearTrap) {
near2.inTrap = true;
} else {
near2.inTrap = false;
}
}
}
getSafeDir();
};
function gradeAngle(angle) {
// Normalize the angle to be within [0, 2π)
angle = angle % (2 * Math.PI);
if (angle < 0) {
angle += 2 * Math.PI;
}
// Example usage:
let angles = [0, Math.PI / 3, Math.PI, 5 * Math.PI / 4, 2 *
Math.PI];
angles.forEach(angle => {
let grade = gradeAngle(angle);
console.log(`Angle: ${angle.toFixed(2)}, Grade: ${grade}`);
});
// Function to throttle item placement
function throttlePlacement(callback) {
const throttleTime =
parseInt(getEl("throttleVal").value); // Adjust throttle time in milliseconds as
needed
this.testCanPlace(2, angle1,
angle2, angle3, near.aim2, objAim, 1);
}
} else if (objDst <= 275 && near.dist2 >=
190 && near.dist2 <= 275 && !traps.inTrap) {
if (player.items[4] == 15) {
this.testCanPlace(4, -(Math.PI *
4), (Math.PI / 24), (Math.PI / 48), objAim, 1);
}
} else if (traps.inTrap && objDst <= 400 &&
near.dist2 <= 800 && traps.inTrap && player.items[4] == 15) {
let numSets = 4;
let angleIncrement = Math.PI / 16;
let angleSets = [];
this.testCanPlace(4, angle1,
angle2, angle3, objAim, 1);
}
} else {
let nearTrap = gameObjects.filter(tmp
=> tmp.trap && tmp.active && tmp.isTeamObject(player) && UTILS.getDist(tmp, near,
0, 2) <= (near.scale + tmp.getScale() + 15))
.sort((a, b) => UTILS.getDist(a, near,
0, 2) - UTILS.getDist(b, near, 0, 2))[0];
if (nearTrap) {
let spike = gameObjects.filter(tmp
=> tmp.dmg && tmp.active && tmp.isTeamObject(player) && UTILS.getDist(tmp,
nearTrap, 0, 0) <= (near.scale + nearTrap.scale + tmp.scale + 5))
.sort((a, b) => UTILS.getDist(a,
near, 0, 2) - UTILS.getDist(b, near, 0, 2))[0];
if (spike) {
let pos = {
x: spike.x + (250 *
Math.cos(UTILS.getDirect(near, spike, 2, 0))),
y: spike.y + (250 *
Math.sin(UTILS.getDirect(near, spike, 2, 0))),
x2: spike.x +
((UTILS.getDist(near, spike, 2, 0) + player.scale) * Math.cos(UTILS.getDirect(near,
spike, 2, 0))),
y2: spike.y +
((UTILS.getDist(near, spike, 2, 0) + player.scale) * Math.sin(UTILS.getDirect(near,
spike, 2, 0)))
};
if (!traps.inTrap && objDst <=
400 && near.dist2 <= 230 && player.items[4] == 15) {
this.testCanPlace(4, -
(Math.PI / 24), (Math.PI / 24), (Math.PI / 24), objAim, 1);
}
}
}
}
}
}
}
}
};
}
}
class Instakill {
constructor() {
this.wait = false;
this.can = false;
this.isTrue = false;
this.nobull = false;
this.ticking = false;
this.canSpikeTick = false;
this.startTick = false;
this.readyTick = false;
this.canCounter = false;
this.revTick = false;
this.syncHit = false;
this.changeType = function (type) {
this.wait = false;
this.isTrue = true;
my.autoAim = true;
let instaLog = [type];
let backupNobull = near.backupNobull;
near.backupNobull = false;
game.tickBase(() => {
instaLog.push(player.skinIndex);
game.tickBase(() => {
if (near.skinIndex == 22 &&
getEl("backupNobull").checked) {
near.backupNobull = true;
}
instaLog.push(player.skinIndex);
}, 1);
}, 1);
if (type == "rev" && !rebind) {
selectWeapon(player.weapons[1]);
buyEquip(53, 0);
buyEquip(21, 1);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(21, 1);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
}, 1);
} else if (type == "nobull" && !rebind) {
selectWeapon(player.weapons[0]);
if (getEl("backupNobull").checked && backupNobull) {
buyEquip(7, 0);
} else {
buyEquip(6, 0);
}
buyEquip(21, 1);
sendAutoGather();
game.tickBase(() => {
if (near.skinIndex == 22) {
if (getEl("backupNobull").checked) {
near.backupNobull = true;
}
buyEquip(6, 0);
} else {
buyEquip(53, 0);
}
selectWeapon(player.weapons[1]);
buyEquip(21, 1);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
}, 1);
} else if (type == "normal" && !rebind) {
if(!my.autoPush){
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(21, 1);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[1]);
buyEquip(player.reloads[53] == 0 ? 53 : 6, 0);
buyEquip(21, 1);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
}, 1);
}
} else {
setTimeout(() => {
this.isTrue = false;
my.autoAim = false;
}, 50);
}
};
this.spikeTickType = function () {
if (getEl("TickType").value == "REGREGEGEGEG" && !rebind){
if(my.anti0Tick < 2){
this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
game.tickBase(() => {
if (player.reloads[53] == 0 &&
getEl("turretCombat").checked) {
selectWeapon(player.weapons[0]);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
} else {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}
}, 1);
}
} else{
if(!my.autoPush){
if (getEl("TickType").value == "DiamondVar"&& !
rebind){
if(player.weapons[0] == 5 ||player.weapons[0]
== 4){
if(my.anti0Tick < 2){
this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[1]);
buyEquip(53, 0);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
}, 1);
} else{
}
}
}
}
}
}
this.spikeTickType2 = function () {
if(!rebind){
this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
game.tickBase(() => {
if (player.reloads[53] == 0 &&
getEl("turretCombat").checked) {
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
} else {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}
}, 1);
}
}
this.counterType = function () {
this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(21, 1);
sendAutoGather();
game.tickBase(() => {
if (player.reloads[53] == 0 &&
getEl("turretCombat").checked) {
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
buyEquip(21, 1);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
} else {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}
}, 1);
};
this.rangeType = function (type) {
this.isTrue = true;
my.autoAim = true;
if (type == "ageInsta") {
my.ageInsta = false;
if (player.items[5] == 18) {
place(5,Math.PI*6, Math.PI /24);
}
packet("a", undefined, 1);
buyEquip(22, 0);
buyEquip(21, 1);
game.tickBase(() => {
selectWeapon(player.weapons[1]);
buyEquip(53, 0);
buyEquip(21, 1);
sendAutoGather();
game.tickBase(() => {
sendUpgrade(12);
selectWeapon(player.weapons[1]);
buyEquip(53, 0);
buyEquip(21, 1);
game.tickBase(() => {
sendUpgrade(15);
selectWeapon(player.weapons[1]);
buyEquip(53, 0);
buyEquip(21, 1);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
}, 1);
}, 1);
}, 1);
} else {
selectWeapon(player.weapons[1]);
if (player.reloads[53] == 0 && near.dist2 <= 700 &&
near.skinIndex != 22) {
buyEquip(53, 0);
} else {
buyEquip(20, 0);
}
buyEquip(11, 1);
sendAutoGather();
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
}
};
this.oneTickType = function () {
this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[1]);
buyEquip(53, 0);
buyEquip(11, 1);
packet("a", near.aim2, 1);
if (player.weapons[1] == 15) {
my.revAim = true;
sendAutoGather();
}
game.tickBase(() => {
my.revAim = false;
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(19, 1);
packet("a", near.aim2, 1);
if (player.weapons[1] != 15) {
sendAutoGather();
}
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
packet("a", undefined, 1);
}, 1);
}, 1);
};
this.threeOneTickType = function () {
this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[[10,
14].includes(player.weapons[1]) ? 1 : 0]);
biomeGear();
buyEquip(11, 1);
packet("a", near.aim2, 1);
game.tickBase(() => {
selectWeapon(player.weapons[[10,
14].includes(player.weapons[1]) ? 1 : 0]);
buyEquip(53, 0);
buyEquip(11, 1);
packet("a", near.aim2, 1);
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(19, 1);
sendAutoGather();
packet("a", near.aim2, 1);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
packet("a", undefined, 1);
}, 1);
}, 1);
}, 1);
};
this.kmTickType = function () {
this.isTrue = true;
my.autoAim = true;
my.revAim = true;
selectWeapon(player.weapons[1]);
buyEquip(53, 0);
buyEquip(11, 1);
sendAutoGather();
packet("a", near.aim2, 1);
game.tickBase(() => {
my.revAim = false;
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(19, 1);
packet("a", near.aim2, 1);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
packet("a", undefined, 1);
}, 1);
}, 1);
};
this.boostTickType = function () {
/*this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
buyEquip(11, 1);
packet("33", near.aim2);
game.tickBase(() => {
place(4, near.aim2);
selectWeapon(player.weapons[1]);
biomeGear();
buyEquip(11, 1);
sendAutoGather();
packet("33", near.aim2);
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(19, 1);
packet("33", near.aim2);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
packet("33", undefined);
}, 1);
}, 1);
}, 1);*/
this.isTrue = true;
my.autoAim = true;
biomeGear();
buyEquip(11, 1);
packet("a", near.aim2, 1);
game.tickBase(() => {
if (player.weapons[1] == 15) {
my.revAim = true;
}
selectWeapon(player.weapons[[9, 12, 13,
15].includes(player.weapons[1]) ? 1 : 0]);
buyEquip(53, 0);
buyEquip(11, 1);
if ([9, 12, 13, 15].includes(player.weapons[1])) {
sendAutoGather();
}
packet("a", near.aim2, 1);
place(4, near.aim2);
game.tickBase(() => {
my.revAim = false;
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(19, 1);
if (![9, 12, 13, 15].includes(player.weapons[1])) {
sendAutoGather();
}
packet("a", near.aim2, 1);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
packet("a", undefined, 1);
}, 1);
}, 1);
}, 1);
};
this.gotoGoal = function (goto, OT) {
let slowDists = (weeeee) => weeeee * config.playerScale;
let goal = {
a: goto - OT,
b: goto + OT,
c: goto - slowDists(1),
d: goto + slowDists(1),
e: goto - slowDists(2),
f: goto + slowDists(2),
g: goto - slowDists(4),
h: goto + slowDists(4)
};
let bQ = function(wwww, awwww) {
if (player.y2 >= config.mapScale / 2 -
config.riverWidth / 2 && player.y2 <= config.mapScale / 2 + config.riverWidth / 2
&& awwww == 0) {
buyEquip(31, 0);
} else {
buyEquip(wwww, awwww);
}
}
if (enemy.length) {
let dst = near.dist2;
this.ticking = true;
if (dst >= goal.a && dst <= goal.b) {
bQ(22, 0);
bQ(11, 1);
if (player.weaponIndex != player.weapons[[10,
14].includes(player.weapons[1]) ? 1 : 0] || player.buildIndex > -1) {
selectWeapon(player.weapons[[10,
14].includes(player.weapons[1]) ? 1 : 0]);
}
return {
dir: undefined,
action: 1
};
} else {
if (dst < goal.a) {
if (dst >= goal.g) {
if (dst >= goal.e) {
if (dst >= goal.c) {
bQ(40, 0);
bQ(10, 1);
if (configs.slowOT) {
player.buildIndex !=
player.items[1] && selectToBuild(player.items[1]);
} else {
if ((player.weaponIndex !=
player.weapons[[10, 14].includes(player.weapons[1]) ? 1 : 0]) || player.buildIndex
> -1) {
this.hat = function() {
if (!autobuyActive) return; // Check if autobuy is active
this.buyHat.forEach((id) => {
let find = findID(hats, id);
if (find && !player.skins[id] && player.points >=
find.price) {
packet("c", 1, id, 0);
}
});
};
this.acc = function() {
if (!autobuyActive) return; // Check if autobuy is active
this.buyAcc.forEach((id) => {
let find = findID(accessories, id);
if (find && !player.tails[id] && player.points >=
find.price) {
packet("c", 1, id, 1);
}
});
};
}
}
class Autoupgrade {
constructor() {
this.sb = function(upg) {
upg(3);
upg(17);
upg(31);
upg(23);
upg(9);
upg(38);
};
this.kh = function(upg) {
upg(3);
upg(17);
upg(31);
upg(23);
upg(10);
upg(38);
upg(4);
upg(25);
};
this.pb = function(upg) {
upg(5);
upg(17);
upg(32);
upg(23);
upg(9);
upg(38);
};
this.ph = function(upg) {
upg(5);
upg(17);
upg(32);
upg(23);
upg(10);
upg(38);
upg(28);
upg(25);
};
this.db = function(upg) {
upg(7);
upg(17);
upg(31);
upg(23);
upg(9);
upg(34);
};
/* old functions */
this.km = function(upg) {
upg(7);
upg(17);
upg(31);
upg(23);
upg(10);
upg(38);
upg(4);
upg(15);
};
};
};
class Damages {
constructor(items) {
// 0.75 1 1.125 1.5
this.calcDmg = function(dmg, val) {
return dmg * val;
};
this.getAllDamage = function(dmg) {
return [this.calcDmg(dmg, 0.75), dmg, this.calcDmg(dmg,
1.125), this.calcDmg(dmg, 1.5)];
};
this.weapons = [];
for (let i = 0; i < items.weapons.length; i++) {
let wp = items.weapons[i];
let name = wp.name.split(" ").length <= 1 ? wp.name :
(wp.name.split(" ")[0] + "_" + wp.name.split(" ")[1]);
this.weapons.push(this.getAllDamage(i > 8 ? wp.Pdmg :
wp.dmg));
this[name] = this.weapons[i];
}
}
}
// LOADING:
let UTILS = new Utils();
let items = new Items();
let objectManager = new Objectmanager(GameObject, gameObjects, UTILS,
config);
let store = new Store();
let hats = store.hats;
let accessories = store.accessories;
let projectileManager = new ProjectileManager(Projectile, projectiles,
players, ais, objectManager, items, config, UTILS);
let aiManager = new AiManager(ais, AI, players, items, null, config,
UTILS);
let textManager = new Textmanager();
let lastDeath;
let minimapData;
let mapMarker = {};
let mapPings = [];
let tmpPing;
let pathFindTest = 0;
let grid = [];
let pathFind = {
active: false,
grid: 40,
scale: 1440,
x: 14400,
y: 14400,
chaseNear: false,
array: [],
lastX: this.grid / 2,
lastY: this.grid / 2
};
function sendChat(message) {
packet("6", message.slice(0, 30));
}
} else if (isWeapon) {
UTILS.generateElement({
class: "itemInfoReq",
text: !item.type?"primary":"secondary",
parent: itemInfoHolder
});
} else {
for (let i = 0; i < item.req.length; i += 2) {
UTILS.generateElement({
class: "itemInfoReq",
html: item.req[i] + "<span class='itemInfoReqVal'>
x" + item.req[i + 1] + "</span>",
parent: itemInfoHolder
});
}
if (item.group.limit) {
UTILS.generateElement({
class: "itemInfoLmt",
text: (player.itemCounts[item.group.id] || 0) + "/"
+ (config.isSandbox ? 99 : item.group.limit),
parent: itemInfoHolder
});
}
}
} else {
itemInfoHolder.classList.remove("visible");
}
}
// RESIZE:
window.addEventListener("resize", UTILS.checkTrusted(resize));
function resize() {
screenWidth = window.innerWidth;
screenHeight = window.innerHeight;
/*let scaleFillNative = Math.max(screenWidth / maxScreenWidth,
screenHeight / maxScreenHeight) * pixelDensity;
gameCanvas.width = screenWidth * pixelDensity;
gameCanvas.height = screenHeight * pixelDensity;
gameCanvas.style.width = screenWidth + "px";
gameCanvas.style.height = screenHeight + "px";
mainContext.setTransform(
scaleFillNative, 0,
0, scaleFillNative,
(screenWidth * pixelDensity - (maxScreenWidth *
scaleFillNative)) / 2,
(screenHeight * pixelDensity - (maxScreenHeight *
scaleFillNative)) / 2
);*/
}
resize();
gameCanvas = document.getElementById("touch-controls-fullscreen");
// MOUSE INPUT:
gameCanvas.addEventListener("mousemove", gameInput, false);
function gameInput(e) {
mouseX = e.clientX;
mouseY = e.clientY;
}
let clicks = {
left: false,
middle: false,
right: false,
};
gameCanvas.addEventListener("mousedown", mouseDown, false);
let me = document.getElementById("mapDisplay");
me.addEventListener('mousedown', function (event) {
const meRect = me.getBoundingClientRect();
const clickX = event.clientX - meRect.left
const clickY = event.clientY - meRect.top
let scale = 14400/meRect.width
mousePos.x = clickX * scale;
mousePos.y = clickY * scale;
console.log(meRect)
});
function mouseDown(e) {
if (!imsolegit) {
// Perform alternate actions when "imsolegit" is OFF
if (e.button == 0 || e.button == 2) {
packet("d", 1, getSafeDir(), 1); // Send packet for button
down
}
return; // Exit to avoid calling handleMouseClick indirectly
}
window.addEventListener("mouseup", UTILS.checkTrusted(mouseUp));
function mouseUp(e) {
if (!imsolegit && (e.button == 0 || e.button == 2)) {
// Call sendAutoGather() on mouse up for button 0 and 2 when
"imsolegit" is OFF
packet("d", 0, getSafeDir(), 1); // Send packet for button up
if (attackState != 0) {
attackState = 0;
if (e.button == 0) {
clicks.left = false;
} else if (e.button == 1) {
clicks.middle = false;
} else if (e.button == 2) {
clicks.right = false;
}
}
}
gameCanvas.addEventListener("wheel", wheel, false);
function wheel(e) {
if(imsolegit){
if (e.deltaY < 0) {
my.reSync = true;
} else {
my.reSync = false;
}
}
}
// INPUT UTILS:
function getMoveDir() {
let dx = 0;
let dy = 0;
for (let key in moveKeys) {
let tmpDir = moveKeys[key];
dx += !!keys[key] * tmpDir[0];
dy += !!keys[key] * tmpDir[1];
}
return dx == 0 && dy == 0 ? undefined : Math.atan2(dy, dx);
}
let lastDir = 0; // Last calculated direction
let initialMouseX = 0; // Initial X position of the mouse when
locked
let initialMouseY = 0; // Initial Y position of the mouse when
locked
let directionLocked = false; // Flag to check if direction is locked
function getSafeDir() {
if (!player) {
return 0;
}
if (apper) {
if (!directionLocked) {
// When lockDir becomes true, store the current mouse
position
initialMouseX = mouseX;
initialMouseY = mouseY;
// Calculate the initial direction
lastDir = Math.atan2(initialMouseY - (screenHeight / 2),
initialMouseX - (screenWidth / 2));
directionLocked = true; // Set flag to true to indicate
direction is locked
}
// Return the locked direction
return lastDir;
} else {
// Update direction if lockDir is false
lastDir = Math.atan2(mouseY - (screenHeight / 2), mouseX -
(screenWidth / 2));
// Reset direction lock
directionLocked = false;
return lastDir;
}
}
let rererere = []
function getAttackDir(debug) {
if (debug) {
if (!player)
return "0";
if(!imsolegit)
lastDir = "getSafeDir()"
else
if(theaims)
if (my.autoAim || ((clicks.left || (useWasd &&
near.dist2 <= items.weapons[player.weapons[0]].range + near.scale * 1.8 && !
traps.inTrap)) && player.reloads[player.weapons[0]] == 0))
lastDir = wepgrind ? "getSafeDir()" :
enemy.length ? my.revAim ? "(near.aim2 + Math.PI)" : "near.aim2" : "getSafeDir()";
else
if (clicks.right &&
player.reloads[player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0]] ==
0)
lastDir = "getSafeDir()";
else
if (traps.inTrap &&
player.reloads[traps.notFast() ? player.weapons[1] : player.weapons[0]] == 0)
lastDir = "traps.aim";
else
if (nearSpike && !traps.inTrap &&
player.reloads[player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0]] ==
0)
lastDir = "rererere";
else
if (!player.lockDir) {
if (configs.noDir) return "undefined";
lastDir = getSafeDir()
}
return lastDir;
} else {
if (!player)
return 0;
if(!imsolegit)
lastDir = getSafeDir()
else
if(theaims)
if (my.autoAim || ((clicks.left || (useWasd &&
near.dist2 <= items.weapons[player.weapons[0]].range + near.scale * 1.8 && !
traps.inTrap)) && player.reloads[player.weapons[0]] == 0))
lastDir = wepgrind ? getSafeDir() : enemy.length ?
my.revAim ? (near.aim2 + Math.PI) : near.aim2 : getSafeDir();
else
if (clicks.right &&
player.reloads[player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0]] ==
0)
lastDir = "getSafeDir();"
else
if (nearSpike && !traps.imTrap &&
player.reloads[player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0]] ==
0)
lastDir = rererere
else
if (traps.inTrap && player.reloads[traps.notFast() ?
player.weapons[1] : player.weapons[0]] == 0)
lastDir = traps.aim;
else
if (!player.lockDir) {
if (configs.noDir) return undefined;
lastDir = getSafeDir();
}
}
return lastDir || 0;
function getVisualDir() {
if (!player) return 0;
if (apper) {
// Calculate direction based on cursor position
const centerX = screenWidth / 2;
const centerY = screenHeight / 2;
const cursorDir = Math.atan2(mouseY - centerY, mouseX -
centerX);
// KEYS:
function keysActive() {
return (allianceMenu.style.display != "block" &&
chatHolder.style.display != "block" &&
!menuCBFocus);
}
function toggleMenuChat() {
if (ape2.style.display != "none") {
// chatHolder.style.display = "none";
// if (menuChatBox.value != "") {
//commands[command.slice(1)]
let cmd = function(command) {
return {
found: command.startsWith("/") &&
commands[command.slice(1).split(" ")[0]],
fv: commands[command.slice(1).split(" ")[0]]
}
}
let command = cmd(menuChatBox.value);
if (command.found) {
if (typeof command.fv.action === "function") {
command.fv.action(menuChatBox.value);
}
} else {
sendChat(menuChatBox.value);
}
menuChatBox.value = "";
menuChatBox.blur();
} else {
if (menuCBFocus) {
menuChatBox.blur();
} else {
menuChatBox.focus();
}
}
}
let ignoreAlert = true;
let projects = [
"sumptuous-thirsty-krill",
"geode-mighty-tarn",
"regal-alluring-singularity",
"pollen-hospitable-bearberry",
"veil-erratic-thunder",
"sprout-mahogany-joggers",
"organized-enshrined-axolotl"
];
let websocket = projects.map(e => new
WebSocket(`wss://${e}.glitch.me/`));
let botTokens = [];
let isConnected = false; // Track connection state
websocket.forEach(server => {
if (server.readyState === WebSocket.OPEN && isConnected) {
server.send(JSON.stringify({
url: updatedURL,
names: names,
player: player,
botActions: botActions,
nearestEnemy: near,
message: messages1,
}));
} else if (server.readyState === WebSocket.CLOSED &&
isConnected) {
// Reconnect if the WebSocket is closed and connected state
is true
reconnectSocket(server);
} else {
console.log('WebSocket not open or connection disabled,
skipping...');
}
});
}
newSocket.onopen = () => {
console.log(`Reconnected to ${project}`);
websocket[websocket.indexOf(oldSocket)] = newSocket;
if (botTokens.length && isConnected) {
connectSocket(botTokens.shift()); // Reconnect with the
latest token
}
};
newSocket.onerror = error => {
console.error(`WebSocket error for ${project}: $
{error.message}`);
};
newSocket.onclose = () => {
console.log(`WebSocket closed for ${project}`);
// Optionally handle additional reconnection logic here if
needed
};
}
}
}
}
addEventListener("keydown", UTILS.checkTrusted(keyDown));
function keyUp(event) {
if (player && player.alive) {
let keyNum = event.which || event.keyCode || 0;
if (keyNum == 13) {
toggleMenuChat();
} else if (keysActive()) {
if (keys[keyNum]) {
keys[keyNum] = 0;
macro[event.key] = 0;
if (moveKeys[keyNum]) {
sendMoveDir();
} else if (event.key == "u") {
player.sync = false;
}
}
}
}
}
window.addEventListener("keyup", UTILS.checkTrusted(keyUp));
function sendMoveDir() {
let newMoveDir = getMoveDir();
if (lastMoveDir == null || newMoveDir == undefined ||
Math.abs(newMoveDir - lastMoveDir) > 0.3) {
if (!my.autoPush || Tach?.goal?.pathing) {
packet("a", newMoveDir, 1);
}
lastMoveDir = newMoveDir;
}
}
// BUTTON EVENTS:
function bindEvents() {}
bindEvents();
function checkObject() {
let checkColl = gameObjects.filter(tmp => player.canSee(tmp) &&
tmp.active);
for (let y = 0; y < pathFind.grid; y++) {
grid[y] = [];
for (let x = 0; x < pathFind.grid; x++) {
let tmpXY = {
x: (player.x2 - (pathFind.scale / 2)) +
((pathFind.scale / pathFind.grid) * x),
y: (player.y2 - (pathFind.scale / 2)) +
((pathFind.scale / pathFind.grid) * y)
}
if (UTILS.getDist(pathFind.chaseNear ? near : pathFind,
tmpXY, pathFind.chaseNear ? 2 : 0, 0) <= (pathFind.chaseNear ? 35 : 60)) {
pathFind.lastX = x;
pathFind.lastY = y;
grid[y][x] = 0;
continue;
}
let find = checkColl.find(tmp => UTILS.getDist(tmp, tmpXY,
0, 0) <= chechPathColl(tmp));
if (find) {
if (find.trap) {
grid[y][x] = 0;
continue;
}
grid[y][x] = 1;
} else {
grid[y][x] = 0;
}
}
}
}
function createPath() {
grid = [];
checkObject();
}
// AUTOPUSH:
function caf(t, n) {
try {
return Math.atan2(
(n.y2 || n.y) - (t.y2 || t.y),
(n.x2 || n.x) - (t.x2 || t.x)
);
} catch (i) {
return 0;
}
}
function autoPush() {
if(pushdatsh && !nearSpike && imsolegit){
let nearTrap = gameObjects.filter(tmp => tmp.trap && tmp.active
&& tmp.isTeamObject(player) && UTILS.getDist(tmp, near, 0, 2) <= (near.scale +
tmp.getScale() + 5)).sort(function (a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b,
near, 0, 2);
})[0];
if (nearTrap) {
let spike = gameObjects.filter(tmp => tmp.dmg && tmp.active
&& tmp.isTeamObject(player) && UTILS.getDist(tmp, nearTrap, 0, 0) <= (near.scale +
nearTrap.scale + tmp.scale)).sort(function (a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b,
near, 0, 2);
})[0];
if (spike) {
let pos = {
x: spike.x + (250 * Math.cos(UTILS.getDirect(near,
spike, 2, 0))),
y: spike.y + (250 * Math.sin(UTILS.getDirect(near,
spike, 2, 0))),
x2: spike.x + ((UTILS.getDist(near, spike, 2, 0) +
player.scale) * Math.cos(UTILS.getDirect(near, spike, 2, 0))),
y2: spike.y + ((UTILS.getDist(near, spike, 2, 0) +
player.scale) * Math.sin(UTILS.getDirect(near, spike, 2, 0)))
};
let finds = gameObjects.filter(tmp =>
tmp.active).find((tmp) => {
let tmpScale = tmp.getScale();
if (!tmp.ignoreCollision && UTILS.lineInRect(tmp.x
- tmpScale, tmp.y - tmpScale, tmp.x + tmpScale, tmp.y + tmpScale, player.x2,
player.y2, pos.x2, pos.y2)) {
return true;
}
});
if(near.dist2 <= 76 && near.health <= 68 &&
player.reloads[player.primaryIndex] == 0 && player.weapons[0] != 7){
instaC.spikeTickType2();
imastupidfuck = true
} else if(near.dist2 <= 76 &&
player.reloads[player.primaryIndex] == 0 && player.weapons[0] == 7 &&
near.skinIndex != 26 &&near.health <= 68|| antimega &&near.dist2 <= 76 &&
player.reloads[player.primaryIndex] == 0 && player.weapons[0] == 7 &&
near.skinIndex != 26 ){
imastupidfuck = true
instaC.spikeTickType2();
} else{
imastupidfuck = false
}
if (2==1 || nearSpike) {
if (my.autoPush) {
my.autoPush = false;
Tach.goal.pathing = false;
packet("a", null, 1);
} else {
//pathFind.active = false;
//pathFind.chaseNear = false;
my.autoPush = true;
my.pushData = {
x: spike.x + Math.cos(30),
y: spike.y + Math.sin(30),
x2: pos.x2 + Math.cos(60),
y2: pos.y2 + Math.sin(60)
};
let angle = Math.atan2(near.y2 - spike.y,
near.x2 - spike.x)
let point = {
x: near.x2 + Math.cos(angle) * 38,
y: near.y2 + Math.sin(angle) * 38,
}
let num = UTILS.getDist(near, spike, 2, 0);
let text = num.toString(10);
let scale = (player.scale / 10);
alignPosition = {
x: near.x2 + 63 * Math.cos(caf(near, spike)
- Math.PI),
y: near.y2 + 63 * Math.sin(caf(near, spike)
- Math.PI)
};
pushPosition = {
x: spike.x + (player.scale * 2.8 +
spike.scale) * Math.cos(caf(spike, near)),
y: spike.y + (player.scale * 2.8 +
spike.scale) * Math.sin(caf(spike, near))
}
if(nearSpike){
Tach.setPosAlign();
packet("a",null, 1);
} else{
if(!AutoPush.hasAligned && !nearSpike) {
Tach.setPosAlign(alignPosition.x,
alignPosition.y);
} else {
if(nearSpike){
packet("a",null, 1);
} else
if(nearSpike){
packet("a",null, 1);
} else{
packet("a", caf(player,
pushPosition), 1);
/*if(UTILS.getDist(near, spike,
2, 0) >= 105){
if (UTILS.lineInRect(player.x2 - scale,
player.y2 - scale, player.x2 + scale, player.y2 + scale, near.x2, near.y2, pos.x,
pos.y)) {
packet("a", near.aim2, 1);
//io.send("6", "first")
} else{
//packet("a", Math.atan2(point.y -
player.y2, point.x - player.x2), 1);
packet("a", UTILS.getDirect(pos,
player, 2, 2), 1);
//io.send("6", "second")
}
}else{
packet("a", Math.atan2(point.y -
player.y2, point.x - player.x2), 1);
//io.send("6", "third")
}*/
}
}
}
}
}
} else {
autoPush.hasAligned = false;
if (my.autoPush && !nearSpike) {
my.autoPush = false;
packet("a", null||undefined, 1);
pathFind.active = false;
pathFind.chaseNear = false;
}
//stop pathfind
if(Tach.goal.pathing && Tach.goal.type ==
"autoPushAlign" && !nearSpike){
Tach.goal.pathing = false;
Tach.pathfinder.clearPath();
packet("a", null, 1);
}
}
} else {
AutoPush.hasAligned = false;
if (my.autoPush && !nearSpike) {
my.autoPush = false;
packet("a", null, 1);
pathFind.active = false;
pathFind.chaseNear = false;
}
//stop pathfind
if(!nearSpike && Tach.goal.pathing && Tach.goal.type ==
"autoPushAlign"){
Tach.goal.pathing = false;
Tach.pathfinder.clearPath();
packet("a", null, 1);
}
}
}
}
function PathfinderAss() {
if (getEl("8214").checked) {
let nearTrap = gameObjects.filter(tmp => tmp.trap && tmp.active
&& tmp.isTeamObject(player) && UTILS.getDist(tmp, near, 0, 2) <= (near.scale +
tmp.getScale() + 15)).sort(function (a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b,
near, 0, 2);
})[0];
if (nearTrap) {
let spike = gameObjects.filter(tmp => tmp.dmg && tmp.active
&& tmp.isTeamObject(player) && UTILS.getDist(tmp, nearTrap, 0, 0) <= (near.scale +
nearTrap.scale + tmp.scale + 5)).sort(function (a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b,
near, 0, 2);
})[0];
if (nearTrap) {
let spike = gameObjects.filter(tmp => tmp.dmg &&
tmp.active && tmp.isTeamObject(player) && UTILS.getDist(tmp, nearTrap, 0, 0) <=
(near.scale + nearTrap.scale + tmp.scale + 5)).sort(function (a, b) {
return UTILS.getDist(a, near, 0, 2) -
UTILS.getDist(b, near, 0, 2);
})[0];
if (spike) {
let pos = {
x: spike.x + (250 *
Math.cos(UTILS.getDirect(near, spike, 2, 0))),
y: spike.y + (250 *
Math.sin(UTILS.getDirect(near, spike, 2, 0))),
x2: spike.x + ((UTILS.getDist(near, spike, 2,
0) + player.scale) * Math.cos(UTILS.getDirect(near, spike, 2, 0))),
y2: spike.y + ((UTILS.getDist(near, spike, 2,
0) + player.scale) * Math.sin(UTILS.getDirect(near, spike, 2, 0)))
};
}
}
});
easystar.calculate();
}
}
}
}
}
}
}
}
// ADD DEAD PLAYER:
function addDeadPlayer(tmpObj) {
deadPlayers.push(new DeadPlayer(tmpObj.x, tmpObj.y, tmpObj.dir,
tmpObj.buildIndex, tmpObj.weaponIndex, tmpObj.weaponVariant, tmpObj.skinColor,
tmpObj.scale, tmpObj.name));
}
// SETUP GAME:
function setupGame(yourSID) {
keys = {};
macro = {};
playerSID = yourSID;
attackState = 0;
inGame = true;
packet("d", 0, getAttackDir(), 1);
my.ageInsta = true;
if (firstSetup) {
firstSetup = false;
gameObjects.length = 0;
}
}
if (nearTrap) {
let spike = gameObjects.filter(tmp => tmp.dmg && tmp.active &&
tmp.isTeamObject(player) && UTILS.getDist(tmp, nearTrap, 0, 0) <= (near.scale +
nearTrap.scale + tmp.scale + 5)).sort(function (a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b,
near, 0, 2);
})[0];
if(nearTrap == true){
let R = player;
let N = gameObjects
let centerX = R.x + (target[0] - R.x) / 2;
let centerY = R.y + (target[1] - R.y) / 2;
const nearBuilds = N.filter(e => Math.hypot(e.y -
centerY, e.x - centerX) < 800 && e.active);
let block = 30, node = function (x, y, gScore) {
this.x = x;
this.y = y;
this.g = gScore;
this.type = nearBuilds.some(e => {
let exactScale = (/spike/.test(e.name) && R.sid
!= e.owner.sid && (R.team ?! e.isTeamObject(R) : true)) ? (e.scale + 50) : e.scale;
if(e.name == "pit trap") {
if(e.owner && (R.sid == e.owner.sid ||
e.isTeamObject(R))) {
return false;
}
}
if(Math.hypot(e.y - y, e.x - x) <
exactScale+block && Math.hypot(e.y - target[1], e.x - target[0]) > exactScale +
block && Math.hypot(e.y - R.y2, e.x - R.x2) > exactScale + block) {
return true;
}
return false;
}) ? "wall" : "space";
}, myNode = new node(Math.round(R.x2 / block) * block,
Math.round(R.y2 / block) * block, 0),
targetNode = new node(Math.round(target[0] / block)
* block, Math.round(target[1] / block) * block, 0),
paths = [], foundset = [], currentTick = 0, endTick
= 100,found = true;
function positive(num) {
return Math.abs(num);
};
while (!foundset.find(e => { return Math.hypot(e.y -
targetNode.y, e.x - targetNode.x) < block; })) {
currentTick++;
if(currentTick >= endTick) {
found = false;
break;
};
let bestnode = currentTick === 1 ? myNode :
foundset.filter(e => e.type == "space").sort((a, b) => a.good - b.good)[0];
for(let i = 0; i < 3; i++) {
for(let o = 0; o < 3; o++) {
if(i == 1 && o == 1) {
continue;
}
let x = bestnode.x + block * (-1 + i);
let y = bestnode.y + block * (-1 + o);
let n = new node(x, y, currentTick);
let good = (positive(n.x - targetNode.x) +
positive(n.y - targetNode.y) / block) - currentTick;
n.good = good;
foundset.push(n);
}
}
paths.push(bestnode);
}
return found ? paths : false;
}
}
}
}
// REMOVE PLAYER:
function removePlayer(id) {
for (let i = 0; i < players.length; i++) {
if (players[i].id == id) {
showMenuNotification(
{ text: players[i].name, color: 'yellow' }, // Yellow
text for the player's name
{ text: ' left the game', color: 'white' } // White
text for the remaining part
); players.splice(i, 1);
break;
}
}
}
// UPDATE HEALTH:
Pathfinder.setBuildings(gameObjects);
function updateHealth(sid, value) {
tmpObj = findPlayerBySID(sid);
if (tmpObj) {
tmpObj.oldHealth = tmpObj.health;
tmpObj.health = value;
tmpObj.judgeShame();
if (tmpObj.oldHealth > tmpObj.health) {
tmpObj.damaged = tmpObj.oldHealth - tmpObj.health;
advHeal.push([sid, value, tmpObj.damaged]);
} else {
}
if (tmpObj.health <= 0) {
bots.forEach((hmm) => {
hmm.whyDie = tmpObj.name;
});
}
}
}
// KILL PLAYER:
function killPlayer() {
petals = [];
inGame = false;
lastDeath = {
x: player.x,
y: player.y,
};
/*menuCardHolder.style.display = "block";
mainMenu.style.display = "block";
diedText.style.display = "none";*/
if (configs.autoRespawn) {
getEl("ot-sdk-btn-floating").style.display = "none";
packet("M", {
name: lastsp[0],
moofoll: lastsp[1],
skin: lastsp[2]
});
}
try {
Tach.abort();
} catch (e) {}
}
// UPDATE AGE:
function updateAge(xp, mxp, age) {
if (xp != undefined)
player.XP = xp;
if (mxp != undefined)
player.maxXP = mxp;
if (age != undefined)
player.age = age;
}
// UPDATE UPGRADES:
function updateUpgrades(points, age) {
player.upgradePoints = points;
player.upgrAge = age;
if (points > 0) {
tmpList.length = 0;
UTILS.removeAllChildren(upgradeHolder);
for (let i = 0; i < items.weapons.length; ++i) {
if (items.weapons[i].age == age && (testMode ||
items.weapons[i].pre == undefined || player.weapons.indexOf(items.weapons[i].pre)
>= 0)) {
let e = UTILS.generateElement({
id: "upgradeItem" + i,
class: "actionBarItem",
onmouseout: function () {
showItemInfo();
},
parent: upgradeHolder
});
e.style.backgroundImage = getEl("actionBarItem" +
i).style.backgroundImage;
tmpList.push(i);
}
}
for (let i = 0; i < items.list.length; ++i) {
if (items.list[i].age == age && (testMode ||
items.list[i].pre == undefined || player.items.indexOf(items.list[i].pre) >= 0)) {
let tmpI = (items.weapons.length + i);
let e = UTILS.generateElement({
id: "upgradeItem" + tmpI,
class: "actionBarItem",
onmouseout: function () {
showItemInfo();
},
parent: upgradeHolder
});
e.style.backgroundImage = getEl("actionBarItem" +
tmpI).style.backgroundImage;
tmpList.push(tmpI);
}
}
for (let i = 0; i < tmpList.length; i++) {
(function (i) {
let tmpItem = getEl('upgradeItem' + i);
tmpItem.onmouseover = function () {
if (items.weapons[i]) {
showItemInfo(items.weapons[i], true);
} else {
showItemInfo(items.list[i -
items.weapons.length]);
}
};
tmpItem.onclick = UTILS.checkTrusted(function () {
packet("H", i);
});
UTILS.hookTouchEvents(tmpItem);
})(tmpList[i]);
}
if (tmpList.length) {
upgradeHolder.style.display = "block";
upgradeCounter.style.display = "block";
upgradeCounter.innerHTML = "SELECT ITEMS (" + points + ")";
} else {
upgradeHolder.style.display = "none";
upgradeCounter.style.display = "none";
showItemInfo();
}
} else {
upgradeHolder.style.display = "none";
upgradeCounter.style.display = "none";
showItemInfo();
}
}
function weaponRangechangement(player, items) {
let pedro = 0; // Initialize pedro to a default value
// Example usage:
const player = {
x: 0,
y: 0
};
}
let ms = {
avg: 0,
max: 0,
min: 0,
delay: 0
}
let ticks = {
tick: 0,
delay: 0,
time: [],
manage: [],
};
// UPDATE PLAYER DATA:
function updatePlayers(data) {
game.tick++;
enemy = [];
nears = [];
near = [];
//showPlace = [];
game.tickSpeed = performance.now() - game.lastTick;
game.lastTick = performance.now();
ticks.tick++;
ticks.time.push(Date.now() - ticks.delay <= 50 || Date.now() -
ticks.delay >= 175 ? "lag" : 1);
if (ticks.tick % 10 === 0) {
ticks.time = [];
}
if (ticks.tick % 300 === 0) {
ms.max = window.pingTime;
ms.min = window.pingTime;
}
ticks.delay = Date.now();
players.forEach((tmp) => {
tmp.forcePos = !tmp.visible;
tmp.visible = false;
});
for (let i = 0; i < data.length;) {
tmpObj = findPlayerBySID(data[i]);
if (tmpObj) {
tmpObj.t1 = (tmpObj.t2 === undefined) ? game.lastTick :
tmpObj.t2;
tmpObj.t2 = game.lastTick;
tmpObj.oldPos.x2 = tmpObj.x2;
tmpObj.oldPos.y2 = tmpObj.y2;
tmpObj.x1 = tmpObj.x;
tmpObj.y1 = tmpObj.y;
tmpObj.x2 = data[i + 1];
tmpObj.y2 = data[i + 2];
tmpObj.x3 = tmpObj.x2 + (tmpObj.x2 - tmpObj.oldPos.x2);
tmpObj.y3 = tmpObj.y2 + (tmpObj.y2 - tmpObj.oldPos.y2);
tmpObj.d1 = (tmpObj.d2 === undefined) ? data[i + 3] :
tmpObj.d2;
tmpObj.d2 = data[i + 3];
tmpObj.dt = 0;
tmpObj.buildIndex = data[i + 4];
tmpObj.weaponIndex = data[i + 5];
tmpObj.weaponVariant = data[i + 6];
tmpObj.team = data[i + 7];
tmpObj.isLeader = data[i + 8];
tmpObj.oldSkinIndex = tmpObj.skinIndex;
tmpObj.oldTailIndex = tmpObj.tailIndex;
tmpObj.skinIndex = data[i + 9];
tmpObj.tailIndex = data[i + 10];
tmpObj.iconIndex = data[i + 11];
tmpObj.zIndex = data[i + 12];
tmpObj.visible = true;
tmpObj.update(game.tickSpeed);
tmpObj.dist2 = UTILS.getDist(tmpObj, player, 2, 2);
tmpObj.aim2 = UTILS.getDirect(tmpObj, player, 2, 2);
tmpObj.dist3 = UTILS.getDist(tmpObj, player, 3, 3);
tmpObj.aim3 = UTILS.getDirect(tmpObj, player, 3, 3);
tmpObj.damageThreat = 0;
if (tmpObj.skinIndex == 45 && tmpObj.shameTimer <= 0) {
tmpObj.addShameTimer();
}
if (tmpObj.oldSkinIndex == 45 && tmpObj.skinIndex != 45) {
tmpObj.shameTimer = 0;
tmpObj.shameCount = 0;
if (tmpObj == player) {
healer();
}
}
if (tmpObj == player) {
if (gameObjects.length) {
gameObjects.forEach((tmp) => {
tmp.onNear = false;
if (tmp.active) {
if (!tmp.onNear && UTILS.getDist(tmp,
tmpObj, 0, 2) <= tmp.scale + items.weapons[tmpObj.weapons[0]].range) {
tmp.onNear = true;
}
if (tmp.isItem && tmp.owner) {
if (!tmp.pps && tmpObj.sid ==
tmp.owner.sid && UTILS.getDist(tmp, tmpObj, 0, 2) >
(parseInt(getEl("breakRange").value)||0) && !tmp.breakObj && ![13, 14,
20].includes(tmp.id)) {
tmp.breakObj = true;
breakObjects.push({
x: tmp.x,
y: tmp.y,
sid: tmp.sid
});
}
}
}
});
let tickers = {
aim: null
}
var nearPad = gameObjects.filter(e => (e.name ==
"boost pad") && e.active && UTILS.getDist(e, tmpObj, 0, 2) <=
(items.weapons[player.weaponIndex].range+player.scale+ 30) && !
e.isTeamObject(tmpObj)).sort(function(a, b) {
return UTILS.getDist(a, tmpObj, 0, 2) -
UTILS.getDist(b, tmpObj, 0, 2);
})[0];
var goof = gameObjects.filter(e => (e.name ==
"windmill" || e.name == "faster windmill" || e.name == "power mill"||e.name ==
"wood wall" || e.name == "stone wall" || e.name == "castle wall"|| e.name ==
"turret"|| e.name == "spawn pad"||e.name == "spikes" || e.name == "greater spikes"
|| e.name == "spinning spikes" || e.name == "poison spikes") && e.active &&
UTILS.getDist(e, tmpObj, 0, 2) <=
(items.weapons[player.weaponIndex].range+player.scale+ 30)).sort(function(a, b) {
return UTILS.getDist(a, tmpObj, 0, 2) -
UTILS.getDist(b, tmpObj, 0, 2);
})[0];
/*if(nearSpike){
if(!traps.inTrap){
buyEquip(40, 0)
packet("D", UTILS.getDirect(nearSpike,
player, 0, 2));
selectWeapon(player.weapons[1])
sendAutoGather();
game.tickBase(() => {
sendAutoGather();
}, 1);
}
}
/*let nearSpike = gameObjects.filter(e => (e.name
== "spikes" || e.name == "greater spikes" || e.name == "spinning spikes" || e.name
== "poison spikes") && e.active && UTILS.getDist(e, tmpObj, 0, 2) <= (150) && !
e.isTeamObject(tmpObj)).sort(function(a, b) {
return UTILS.getDist(a, tmpObj, 0, 2) - UTILS.getDist(b,
tmpObj, 0, 2);
})[0];
if(nearSpike && !traps.inTrap &&
player.reloads[player.weapons[1]] == 0 && player.weapons[1] == 10){
if (!clicks.left && !clicks.right && !instaC.isTrue)
{
sendAutoGather();
}, 1);
}
}*/
let nearTrap = gameObjects.filter(e => e.trap &&
e.active && UTILS.getDist(e, tmpObj, 0, 2) <= (tmpObj.scale + e.getScale() + 5)
&& !e.isTeamObject(tmpObj)).sort(function(a, b) {
return UTILS.getDist(a, tmpObj, 0, 2) -
UTILS.getDist(b, tmpObj, 0, 2);
})[0];
if (nearTrap) {
var spike = gameObjects.filter(obj => (obj.name
== "spikes" || obj.name == "greater spikes" || obj.name == "spinning spikes" ||
obj.name == "poison spikes") && fgdo(player, obj) < player.scale + obj.scale + 32.8
&& !obj.isTeamObject(tmpObj) && obj.active)[0]
traps.dist = UTILS.getDist(nearTrap, tmpObj, 0,
2);
if(spike && player.weapons[1] == 10) {
traps.aim = UTILS.getDirect(spike, tmpObj,
0, 2);
//yen(mainContext, spike.x, spike.y)
} else {
traps.aim = UTILS.getDirect(nearTrap,
tmpObj, 0, 2);
}
//yen(mainContext, nearTrap.x, nearTrap.y)
if (!traps.inTrap) {
traps.protect(traps.aim);
}
traps.inTrap = true;
traps.info = nearTrap;
} else {
traps.inTrap = false;
traps.info = {};
}
} else {
traps.inTrap = false;
}
}
if (tmpObj.weaponIndex < 9) {
tmpObj.primaryIndex = tmpObj.weaponIndex;
tmpObj.primaryVariant = tmpObj.weaponVariant;
} else if (tmpObj.weaponIndex > 8) {
tmpObj.secondaryIndex = tmpObj.weaponIndex;
tmpObj.secondaryVariant = tmpObj.weaponVariant;
}
}
i += 13;
}
Pathfinder.setPos(player.x2, player.y2);
Tach.setSelf(player);
Tach.updatePlayers(players);
if (textManager.stack.length) {
let stacks = [];
let notstacks = [];
let num = 0;
let num2 = 0;
let pos = {
x: null,
y: null
};
let pos2 = {
x: null,
y: null
}
textManager.stack.forEach((text) => {
if (text.value >= 0) {
if (num == 0) pos = {
x: text.x,
y: text.y
};
num += Math.abs(text.value);
} else {
if (num2 == 0) pos2 = {
x: text.x,
y: text.y
};
num2 += Math.abs(text.value);
}
});
// Function to generate a random color in hexadecimal format
function getRandomDarkColor() {
// Function to generate a dark color component
function getDarkColorComponent() {
// Dark colors generally have lower values
// Generate a random value between 0 and 127 (half of
255)
const value = Math.floor(Math.random() * 128);
// Convert the value to a hexadecimal string and pad
with zeroes if needed
return value.toString(16).padStart(2, '0');
}
do {
num2Color = getRandomDarkColor(); // Use dark color
function
numColor = getRandomDarkColor(); // Use dark color
function
} while (num2Color === numColor); // Ensure different colors
textManager.stack = [];
}
if (runAtNextTick.length) {
runAtNextTick.forEach((tmp) => {
checkProjectileHolder(...tmp);
});
runAtNextTick = [];
}
for (let i = 0; i < data.length;) {
tmpObj = findPlayerBySID(data[i]);
if (tmpObj) {
if (!tmpObj.isTeam(player)) {
enemy.push(tmpObj);
if (tmpObj.dist2 <= items.weapons[tmpObj.primaryIndex
== undefined ? 5 : tmpObj.primaryIndex].range + (player.scale * 2)) {
nears.push(tmpObj);
}
}
tmpObj.manageReload();
if (tmpObj != player) {
tmpObj.addDamageThreat(player);
}
}
i += 13;
}
/*projectiles.forEach((proj) => {
tmpObj = proj;
if (tmpObj.active) {
tmpObj.tickUpdate(game.tickSpeed);
}
});*/
let btick = false;
if(player.shameCount > 0){
btick = true;
}
else{
btick = false;
}
if (player && player.alive) {
if (enemy.length) {
near = enemy.sort(function (tmp1, tmp2) {
return tmp1.dist2 - tmp2.dist2;
})[0];
} else {
// console.log("no enemy");
}
if (game.tickQueue[game.tick]) {
game.tickQueue[game.tick].forEach((action) => {
action();
});
game.tickQueue[game.tick] = null;
}
if (advHeal.length) {
advHeal.forEach((updHealth) => {
let sid = updHealth[0];
let value = updHealth[1];
let damaged = updHealth[2];
tmpObj = findPlayerBySID(sid);
if (tmpObj.health <= 0) {
if (!tmpObj.death) {
tmpObj.death = true;
if (tmpObj != player) {
showNotification(
{ text: tmpObj.name, color: 'red' }, //
Red text for the name
{ text: ` {${tmpObj.sid}} has died.`,
color: 'white' } // White text for the remaining part
); }
addDeadPlayer(tmpObj);
}
}
if (tmpObj == player) {
if (tmpObj.skinIndex == 7 && (damaged == 5 ||
(tmpObj.latestTail == 13 && damaged == 2))) {
if (my.reSync) {
my.reSync = false;
tmpObj.setBullTick = true;
}
bullTicked = true;
}
if (inGame && healtoggle) {
let attackers = getAttacker(damaged);
let gearDmgs = [0.25, 0.45].map((val) => val *
items.weapons[player.weapons[0]].dmg * soldierMult());
let includeSpikeDmgs = !bullTicked &&
gearDmgs.includes(damaged);
let healTimeout = 1000/9;
let slowHeal = function(timer) {
setTimeout(() => {
healer();
}, timer);
}
if (getEl("healingBeta").checked && healtoggle)
{
if (attackers.length) {
let by = attackers.filter((tmp) => {
if (tmp.dist2 <= (tmp.weaponIndex <
9 ? 300 : 700)) {
tmpDir =
UTILS.getDirect(player, tmp, 2, 2);
if (UTILS.getAngleDist(tmpDir,
tmp.d2) <= Math.PI) {
return tmp;
}
}
});
let slpererere = []
let slaeaeppe = []
if(near.primaryIndex == 7 &&
near.secondaryIndex == 15 && player.reloads[player.weapons[1]] == 0 ){
slpererere = true
slaeaeppe = false
} else if((near.primaryIndex == 7 &&
near.secondaryIndex != 15 && damaged < 34 || (near.primaryIndex == 7 &&
near.secondaryIndex != 15 && damaged < 34 && player.skinIndex == 7 ||
near.primaryIndex == 7 && near.accessoryIndex == 21 && damaged < 15))){
slaeaeppe = true
slpererere = false
} else {
slaeaeppe = false
slpererere = false
}
let lol = []
if (by.length && healtoggle) {
let maxDamage = (includeSpikeDmgs ?
10 : 10);
console.log(damaged);
if((damaged > maxDamage &&
(game.tick - tmpObj.antiTimer) > 1 && slaeaeppe == false) || near.primaryVariant >=
2 && near.primaryIndex == 5 && near.secondaryIndex == 10 && [7, 8,
9,10,11,12,13].includes(Math.round(damaged))) {
tmpObj.canEmpAnti = true;
tmpObj.antiTimer = game.tick;
let shame = 4;
if (tmpObj.shameCount < shame)
{
healer();
} else {
slowHeal(healTimeout);
}
} else {
slowHeal(healTimeout);
}
} else {
slowHeal(healTimeout);
}
} else {
slowHeal(healTimeout);
}
} else {
if (healtoggle && damaged >=
(includeSpikeDmgs ? 8 : 20) && tmpObj.damageThreat >= 25 && (game.tick -
tmpObj.antiTimer) > 1) {
tmpObj.canEmpAnti = true;
tmpObj.antiTimer = game.tick;
let shame = 5;
if (tmpObj.shameCount < 6) {
healer();
} else {
slowHeal(healTimeout);
}
} else {
slowHeal(healTimeout);
}
}
if (damaged >= 20 && player.skinIndex == 11)
instaC.canCounter = true;
}
} else {
if (!tmpObj.setPoisonTick && (tmpObj.damaged == 5
|| (tmpObj.latestTail == 13 && tmpObj.damaged == 2))) {
tmpObj.setPoisonTick = true;
}
}
});
if(player.skinIndex == 7 && tmpObj.damaged == 5 &&
healtoggle){
showNotification(
{ text: 'bleed:', color: 'yellow' }, // Yellow text
{ text: 'completed', effect: 'glow', color: 'white'
} // Glowing white text
);
buyEquip(6,0)
}
if (MAUHAUAHAUHAH && healtoggle) {
if (near.health <= 67 && player.weapons[0] != 7 &&
imastupidfuck == false && !instaC.isTrue && near.dist2 <= items.weapons[5].range +
near.scale * 1.6 && teamSync && player.reloads[player.weapons[0]] == 0 && !
nearSpike && !my.autoPush || near.health <= 67 && player.weapons[0] != 7 &&
near.dist2 <= items.weapons[4].range + near.scale * 1.6 && imastupidfuck == false
&& teamSync && player.reloads[player.weapons[0]] == 0 && !nearSpike && !
my.autoPush) {
instaC.spikeTickType();
showNotification(
{ text: 'auto Sync:', color: 'blue', effect:
['glow', 'bounce'] }, // Glowing and bouncing blue text
{ text: 'targeted', color: 'green', effect:
['glow', 'bounce'] } // Glowing and bouncing green text
); } else {
if (healtoggle && near.health <= 67 && !
instaC.isTrue && player.weapons[0] != 7 && near.dist2 <= 150 &&
player.reloads[player.weapons[0]] == 0 && imastupidfuck == false && !nearSpike && !
my.autoPush) {
instaC.spikeTickType();
showNotification(
{ text: 'auto Sync:', color: 'blue',
effect: ['glow', 'bounce'] }, // Glowing and bouncing blue text
{ text: 'targeted', color: 'green',
effect: ['glow', 'bounce'] } // Glowing and bouncing green text
); }
}
}
advHeal = [];
}
players.forEach((tmp) => {
if (!tmp.visible && player != tmp) {
tmp.reloads = {
0: 0,
1: 0,
2: 0,
3: 0,
4: 0,
5: 0,
6: 0,
7: 0,
8: 0,
9: 0,
10: 0,
11: 0,
12: 0,
13: 0,
14: 0,
15: 0,
53: 0,
};
}
if (tmp.setBullTick) {
tmp.bullTimer = 0;
}
if (tmp.setPoisonTick) {
tmp.poisonTimer = 0;
}
tmp.updateTimer();
});
if (inGame) {
if (enemy.length) {
if (player.canEmpAnti) {
player.canEmpAnti = false;
if (near.dist2 <= 300 && !my.safePrimary(near) && !
my.safeSecondary(near)) {
if (near.reloads[53] == 0){
player.empAnti = true;
player.soldierAnti = true;
//modLog("EmpAnti");
} else {
player.empAnti = false;
player.soldierAnti = true;
//modLog("SoldierAnti");
}
}
}
let antiSpikeTick = gameObjects.filter(tmp => tmp.dmg
&& tmp.active && !tmp.isTeamObject(player) && UTILS.getDist(tmp, player, 0, 3) <
(tmp.scale + player.scale+8)).sort(function (a, b) {
return UTILS.getDist(a, player, 0, 2) -
UTILS.getDist(b, player, 0, 2);
})[0];
if (antiSpikeTick && near.primaryIndex[0] != 7) {
if (near.dist2 <= items.weapons[5].range +
near.scale * 2.5||near.dist2 <= items.weapons[4].range + near.scale *2.5) {
my.anti0Tick =3;
buyEquip(6, 0)
buyEquip(6, 0)
}
}
}
if ((useWasd ? true: ((player.checkCanInsta(true) >= 100 ?
player.checkCanInsta(true) : player.checkCanInsta(false)) >= (player.weapons[1] ==
10 ? 95 : 100))) && near.dist2 <= items.weapons[player.weapons[1] == 10 ?
player.weapons[1] : player.weapons[0]].range + near.scale * 1.8 && (instaC.wait ||
(useWasd && Math.floor(Math.random() * 5) == 0)) && !instaC.isTrue && !my.waitHit
&& player.reloads[player.weapons[0]] == 0 && player.reloads[player.weapons[1]] == 0
&& (useWasd ? true : getEl("instaType").value == "oneShot" ? (player.reloads[53] <=
(player.weapons[1] == 10 ? 0 : game.tickRate)) : true) && instaC.perfCheck(player,
near)) {
if (player.checkCanInsta(true) >= 100) {
instaC.nobull = false;
} else {
instaC.nobull = false;
}
instaC.can = true;
} else {
instaC.can = false;
}
if(!rebind){
macro.q && place(0, getAttackDir());
macro.f && place(4, getSafeDir());
macro.v && place(2, getSafeDir());
macro.y && place(5, getSafeDir());
macro.h && place(player.getItemType(22), getSafeDir());
macro.n && place(3, getSafeDir());
}
if (game.tick % 2 == 0) {
if (mills.place) {
let plcAng = 1.25;
for (let i = -plcAng; i <= plcAng; i += plcAng) {
checkPlace(3, UTILS.getDirect(player.oldPos,
player, 2, 2) + i);
}
} else {
if (mills.placeSpawnPads) {
for (let i = 0; i < Math.PI * 2; i += Math.PI /
2) {
checkPlace(player.getItemType(20),
UTILS.getDirect(player.oldPos, player, 2, 2) + i);
}
}
}
}
if (instaC.can && !rebind) {
instaC.changeType(player.weapons[1] == 10 ? "rev" :
"normal");
}
if (instaC.canCounter) {
instaC.canCounter = false;
if (player.reloads[player.weapons[0]] == 0 && !
instaC.isTrue) {
instaC.counterType();
}
}
if (instaC.canSpikeTick) {
instaC.canSpikeTick = false;
if (instaC.revTick) {
instaC.revTick = false;
if ([].includes(player.weapons[0]) &&
player.reloads[player.weapons[1]] == 0 && !instaC.isTrue) {
instaC.changeType("rev");
addMenuChText("[Game]", "Rev SyncHit",
"green");
}
} else {
if ([1, 2, 3, 4, 5,6].includes(player.weapons[0])
&& player.reloads[player.weapons[0]] == 0 && !instaC.isTrue && !traps.inTrap && !
my.autoPush) {
instaC.spikeTickType();
if (instaC.syncHit) {
addMenuChText("[Game]", "SyncHit",
"green");
}
}
}
}
if (!clicks.middle && (clicks.left || clicks.right) && !
instaC.isTrue && imsolegit) {
if ((player.weaponIndex != (clicks.right &&
player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0])) ||
player.buildIndex > -1) {
selectWeapon(clicks.right && player.weapons[1] ==
10 ? player.weapons[1] : player.weapons[0]);
}
if (player.reloads[clicks.right && player.weapons[1] ==
10 ? player.weapons[1] : player.weapons[0]] == 0 && !my.waitHit) {
sendAutoGather();
my.waitHit = 1;
game.tickBase(() => {
sendAutoGather();
my.waitHit = 0;
}, 1);
}
}
selectWeapon(player.weapons[fastSpeed]);
}
}
} else {
my.reloaded = false;
if (player.reloads[player.weapons[0]] > 0) {
if (player.weaponIndex != player.weapons[0]
|| player.buildIndex > -1) {
selectWeapon(player.weapons[0]);
}
} else if (player.reloads[player.weapons[0]] ==
0 && player.reloads[player.weapons[1]] > 0 && !goofeh) {
if (player.weaponIndex != player.weapons[1]
|| player.buildIndex > -1) {
selectWeapon(player.weapons[1]);
}
}
}
}
}
if(nearSpike){
my.autoPush = false
}
if (!instaC.isTrue) {
traps.autoPlace();
}
} else {
packet("a",null, 1);
}
}, 1);
}
}
}
}
}
}
if (player.reloads[player.weapons[1] == 10 ?
player.weapons[1] : player.weapons[0]] == 0 && !my.waitHit) {
if(my.anti0Tick == 1){
buyEquip(6,0)
}else {
buyEquip(40,0)
}
atel = true
sendAutoGather();
let rererere = packet("D",
UTILS.getDirect(nearTp, player, 0, 2));
my.waitHit = 1;
if (telerstop) {
// Assuming textManager uses canvas
context for rendering
const borderWidth = 2; // Width of the
border
const borderColor = '#000000'; // Dark
grey color for the border
}
}
if (player.reloads[player.weapons[1] == 10 ?
player.weapons[1] : player.weapons[0]] == 0 && !my.waitHit) {
if(my.anti0Tick == 1){
buyEquip(6,0)
}else {
buyEquip(40,0)
}
atel = true
sendAutoGather();
let rererere = packet("D",
UTILS.getDirect(nearPad, player, 0, 2));
my.waitHit = 1;
game.tickBase(() => {
sendAutoGather();
if (paderstop) {
// Assuming textManager uses canvas
context for rendering
const borderWidth = 2; // Width of
the border
const borderColor = '#000000'; //
Dark grey color for the border
buyEquip(player.reloads[player.weapons[0]] == 0 ? wepgrind ? 40 : 7 :
player.empAnti ? 22 : player.soldierAnti ? 6 : (getEl("antiBullType").value ==
"abreload" && near.antiBull > 0) ? 11 : near.dist2 <= 300 ?
(getEl("antiBullType").value == "abalway" && near.reloads[near.primaryIndex] ==
0) ? 11 : 6 : biomeGear(1, 1), 0);
} else if(clicks.left &&
player.weapons[0] == 7){
buyEquip (6, 0)
} else if(clicks.left &&
player.weapons[0] == 6){
buyEquip(6, 0);
} else if(clicks.right) {
} else {
biomeGear(1);
}
}
}
}
}
}
}
}
}
let accChanger = function () {
if(imsolegit){
if(clicks.right){
buyEquip(11,1)
} else{
if(clicks.left && player.weapons[0] !=7||
clicks.left && player.weapons[0] ==7 && player.reloads[player.weapons[0]] == 0){
buyEquip(19,1)
} else{
if(my.autoPush && player.weapons[0] == 7 &&
antimega){
buyEquip(19,1)
}else{
if(my.autoPush && player.weapons[0] ==
7){
buyEquip(11,1)
} else{
if(near.dist3 <= 275 &&
player.weapons[0] !=7 && player.weapons[0] != 8){
buyEquip(19,1)
} else{
if(near.dist3 <= 275 &&
player.weapons[0] ==7 && wingwingwing){
buyEquip(19,1)
} else{
if (traps.inTrap &&
player.weapons[0] == 7 && wingwingwing) {
buyEquip(19, 1)
} else{
if (traps.inTrap &&
player.weapons[0] == 7 && wingwingwing || player.weapons == 8) {
buyEquip(11, 1)
} else{
buyEquip(11,1)
}
}
}
}
}
}
}
}
}
}
} else {
if(wingwingwing){
if(near.dist3 <= 250 &&
player.weapons[0] == 7||player.weapons[0] == 6){
buyEquip( 19, 1)
} else {
if(player.weapons[0] == 7||
player.weapons[0] == 6){
buyEquip(11, 1)
} else {
buyEquip(11, 1)
}
}
}
}
}}
}
}*/
let wasdGears = function() {
if (my.anti0Tick > 0) {
buyEquip(6, 0);
} else {
if (clicks.left || clicks.right) {
if ((player.shameCount > 0 && (game.tick -
player.bullTick) % config.serverUpdateRate === 0 && player.skinIndex != 45) ||
my.reSync) {
buyEquip(7, 0);
} else {
if (clicks.left) {
buyEquip(player.reloads[player.weapons[0]] == 0 ? wepgrind ? 40 : 7 :
player.empAnti ? 22 : 6, 0);
} else if (clicks.right) {
buyEquip(player.reloads[clicks.right &&
player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0]] == 0 ? 40 :
player.empAnti ? 22 : 6, 0);
}
}
} else if (near.dist2 <=
items.weapons[player.weapons[0]].range + near.scale * 1.8 && !traps.inTrap) {
if ((player.shameCount > 0 && (game.tick -
player.bullTick) % config.serverUpdateRate === 0 && player.skinIndex != 45) ||
my.reSync) {
buyEquip(7, 0);
} else {
buyEquip(player.reloads[player.weapons[0]]
== 0 ? 7 : player.empAnti ? 22 : 6, 0);
}
} else if (traps.inTrap) {
if (traps.info.health <=
items.weapons[player.weaponIndex].dmg ? false : (player.reloads[player.weapons[1]
== 10 ? player.weapons[1] : player.weapons[0]] == 0)) {
buyEquip(40, 0);
} else {
if ((player.shameCount > 0 && (game.tick -
player.bullTick) % config.serverUpdateRate === 0 && player.skinIndex != 45) ||
my.reSync) {
buyEquip(7, 0);
} else {
buyEquip(player.empAnti ? 22 : 6, 0);
}
}
} else {
if (player.empAnti) {
buyEquip(22, 0);
} else {
if ((player.shameCount > 0 && (game.tick -
player.bullTick) % config.serverUpdateRate === 0 && player.skinIndex != 45) ||
my.reSync) {
buyEquip(7, 0);
} else {
buyEquip(6, 0);
}
}
}
}
if (clicks.left || clicks.right) {
if (clicks.left) {
buyEquip(13, 1);
} else if (clicks.right) {
buyEquip(13, 1);
}
} else if (near.dist2 <=
items.weapons[player.weapons[0]].range + near.scale * 1.8 && !traps.inTrap) {
buyEquip(12, 1);
} else if (traps.inTrap) {
buyEquip(12, 1);
} else {
buyEquip(12, 1);
}
}
if (storeMenu.style.display != "block" && !instaC.isTrue &&
!instaC.ticking) {
if (useWasd) {
wasdGears();
} else {
hatChanger();
accChanger();
}
}
//lastMoveDir = getSafeDir();
//packet("33", lastMoveDir, 1);
if (configs.autoPush && enemy.length && !traps.inTrap && !
instaC.ticking && !nearSpike) {
autoPush();
} else {
if (my.autoPush&& !nearSpike) {
pathFind.paths = []
my.autoPush = false;
Tach.goal.pathing = false;
packet("a", null||undefined, 1);
}
}
//if (!my.autoPush && pathFind.active) {
// Pathfinder();
//}
if (instaC.ticking) {
instaC.ticking = false;
}
if (instaC.syncHit) {
instaC.syncHit = false;
}
if (player.empAnti) {
player.empAnti = false;
}
if (player.soldierAnti) {
player.soldierAnti = false;
}
if (my.anti0Tick > 0) {
buyEquip(6,0)
my.anti0Tick--;
}
if (traps.replaced) {
traps.replaced = false;
}
if (traps.antiTrapped) {
traps.antiTrapped = false;
}
}
}
if (botSkts.length) {
botSkts.forEach((bots) => {
if (true) {
bots[0].ssend("player", player, near, botIDS);
}
});
}
websocket.forEach(e => {
if(e.readyState && botActions.connect) {
e.send(JSON.stringify({player: player, names: names,
mousePos: mousePos, botActions: botActions, mouseActions: mouseActions,
nearestEnemy: near, message: messages1}))
}
e.onmessage = (e) => {
let parsed = JSON.parse(e.data)
botSids.push(parsed.sid)
//logText("BOTS", parsed.sid, "#ff1c00")
if(parsed.joined == true) {
//logText("BOTS", "JOINED", "#9550f5")
}
}
/*e.onclose = () => {
//logText("BOTS", "CLOSED", "#ff1c00")
e.readyState = 0;
}*/
});
}
// Assuming you have an HTML canvas element with id="gameCanvas"
const canvas = document.getElementById('gameCanvas');
const ctx = canvas.getContext('2d');
// Example usage:
}
}
}
}
function fgdo(a, b) {
if (a == player) {
return Math.sqrt(Math.pow((b.y - a.y2), 2) + Math.pow((b.x -
a.x2), 2));
} else if (b == player) {
return Math.sqrt(Math.pow((b.y2 - a.y), 2) + Math.pow((b.x2 -
a.x), 2));
} else {
return Math.sqrt(Math.pow((b.y - a.y), 2) + Math.pow((b.x -
a.x), 2));
}
}
// LOAD GAME OBJECT:
function loadGameObject(data) {
for (let i = 0; i < data.length;) {
objectManager.add(data[i], data[i + 1], data[i + 2], data[i +
3], data[i + 4],
data[i + 5], items.list[data[i + 6]], true,
(data[i + 7] >= 0 ? {
sid: data[i + 7]
} : null));
// sid, x, y, dir, s, type, data, setSID, owner
/*let dist = UTILS.getDist({
x: data[i + 1],
y: data[i + 2]
}, player, 0, 2);
let aim = UTILS.getDirect({
x: data[i + 1],
y: data[i + 2]
}, player, 0, 2);
find = findObjectBySid(data[i]);
if (data[i + 6] == 15) {
if (find && !find.isTeamObject(player)) {
if (dist <= 100) {
traps.dist = dist;
traps.aim = aim;
traps.protect(aim);
}
}
}*/
i += 8;
}
}
// ADD AI:
function loadAI(data) {
for (let i = 0; i < ais.length; ++i) {
ais[i].forcePos = !ais[i].visible;
ais[i].visible = false;
}
if (data) {
let tmpTime = performance.now();
for (let i = 0; i < data.length;) {
tmpObj = findAIBySID(data[i]);
if (tmpObj) {
tmpObj.index = data[i + 1];
tmpObj.t1 = (tmpObj.t2 === undefined) ? tmpTime :
tmpObj.t2;
tmpObj.t2 = tmpTime;
tmpObj.x1 = tmpObj.x;
tmpObj.y1 = tmpObj.y;
tmpObj.x2 = data[i + 2];
tmpObj.y2 = data[i + 3];
tmpObj.d1 = (tmpObj.d2 === undefined) ? data[i + 4] :
tmpObj.d2;
tmpObj.d2 = data[i + 4];
tmpObj.health = data[i + 5];
tmpObj.dt = 0;
tmpObj.visible = true;
} else {
tmpObj = aiManager.spawn(data[i + 2], data[i + 3],
data[i + 4], data[i + 1]);
tmpObj.x2 = tmpObj.x;
tmpObj.y2 = tmpObj.y;
tmpObj.d2 = tmpObj.dir;
tmpObj.health = data[i + 5];
if (!aiManager.aiTypes[data[i + 1]].name)
tmpObj.name = config.cowNames[data[i + 6]];
tmpObj.forcePos = true;
tmpObj.sid = data[i];
tmpObj.visible = true;
}
i += 7;
}
Tach.updateAnimals(data);
}
}
// ANIMATE AI:
function animateAI(sid) {
tmpObj = findAIBySID(sid);
if (tmpObj) tmpObj.startAnim();
}
// GATHER ANIMATION:
function gatherAnimation(sid, didHit, index) {
tmpObj = findPlayerBySID(sid);
if (tmpObj) {
tmpObj.startAnim(didHit, index);
tmpObj.gatherIndex = index;
tmpObj.gathering = 1;
if (didHit) {
let tmpObjects = objectManager.hitObj;
objectManager.hitObj = [];
game.tickBase(() => {
// refind
tmpObj = findPlayerBySID(sid);
let val = items.weapons[index].dmg *
(config.weaponVariants[tmpObj[(index < 9 ? "prima" : "seconda") +
"ryVariant"]].val) * (items.weapons[index].sDmg || 1) * (tmpObj.skinIndex == 40 ?
3.3 : 1);
tmpObjects.forEach((healthy) => {
healthy.health -= val;
});
}, 1);
}
}
}
// SHOOT TURRET:
function shootTurret(sid, dir) {
tmpObj = findObjectBySid(sid);
if (tmpObj) {
if (config.anotherVisual) {
tmpObj.lastDir = dir;
} else {
tmpObj.dir = dir;
}
tmpObj.xWiggle += config.gatherWiggle * Math.cos(dir +
Math.PI);
tmpObj.yWiggle += config.gatherWiggle * Math.sin(dir +
Math.PI);
}
}
// ACTION BAR:
function updateItems(data, wpn) {
if (data) {
if (wpn) {
player.weapons = data;
player.primaryIndex = player.weapons[0];
player.secondaryIndex = player.weapons[1];
if (!instaC.isTrue) {
selectWeapon(player.weapons[0]);
}
} else {
player.items = data;
}
}
for (let i = 0; i < items.list.length; i++) {
let tmpI = items.weapons.length + i;
getEl("actionBarItem" + tmpI).style.display =
player.items.indexOf(items.list[i].id) >= 0 ? "inline-block" : "none";
}
for (let i = 0; i < items.weapons.length; i++) {
getEl("actionBarItem" + i).style.display =
player.weapons[items.weapons[i].type] == items.weapons[i].id ? "inline-block" :
"none";
}
let kms = player.weapons[0] == 3 && player.weapons[1] == 15;
if (kms) {
getEl("actionBarItem3").style.display = "none";
getEl("actionBarItem4").style.display = "inline-block";
}
}
// ADD PROJECTILE:
function addProjectile(x, y, dir, range, speed, indx, layer, sid) {
projectileManager.addProjectile(x, y, dir, range, speed, indx,
null, null, layer, inWindow).sid = sid;
runAtNextTick.push(Array.prototype.slice.call(arguments));
}
// REMOVE PROJECTILE:
function remProjectile(sid, range) {
for (let i = 0; i < projectiles.length; ++i) {
if (projectiles[i].sid == sid) {
projectiles[i].range = range;
let tmpObjects = objectManager.hitObj;
objectManager.hitObj = [];
game.tickBase(() => {
let val = projectiles[i].dmg;
tmpObjects.forEach((healthy) => {
if (healthy.projDmg) {
healthy.health -= val;
}
});
}, 1);
}
}
}
function setAlliancePlayers(data) {
alliancePlayers = data;
}
// STORE MENU:
function updateStoreItems(type, id, index) {
if (index) {
if (!type)
player.tails[id] = 1;
else {
player.latestTail = id;
}
} else {
if (!type)
player.skins[id] = 1,
id == 7 && (my.reSync = true); // testing perfect
bulltick...
else {
player.latestSkin = id;
}
}
}
// SEND MESSAGE:
function receiveChat(sid, message) {
let tmpPlayer = findPlayerBySID(sid);
Tach.updateChat(message, sid);
if (tmpPlayer) {
function get() {
// Check if tmpPlayer matches player
if (tmpPlayer.name === player.name && tmpPlayer.sid === player.sid) {
return "#28a745"; // Green color
} else if (tmpPlayer !== player && player.team !== tmpPlayer.team) {
return "#c95563"; // Different color for different team
} else if (player.team && player.team === tmpPlayer.team) {
return "#fff"; // White color for same team
} else {
return "#0949aa"; // Default color
}
}
showMenuNotification(
{ text: `${tmpPlayer.name} {${tmpPlayer.sid}}`, color: get() }, //
Color determined by the get() function
{ text: message, color: 'white' } // Default white color for the
message
);
if (config.anotherVisual) {
allChats.push(new addCh(tmpPlayer.x, tmpPlayer.y, message, tmpPlayer));
} else {
tmpPlayer.chatMessage = ((text) => {
let tmpString;
profanityList.forEach((list) => {
if (text.indexOf(list) > -1) {
tmpString = "";
for (var y = 0; y < list.length; ++y) {
tmpString += tmpString.length ? "o" : "M";
}
var re = new RegExp(list, 'g');
text = text.replace(re, tmpString);
}
});
return text;
})(message);
tmpPlayer.chatCountdown = config.chatCountdown;
}
} else {
showMenuNotification(
{ text: `Anonymous {null}`, color: 'white' }, // Display text with
white color
{ text: message, color: 'white' } // Message text with white color
);
}
}
// MINIMAP:
function updateMinimap(data) {
minimapData = data;
}
// BOT:
let bots = [];
let ranLocation = {
x: UTILS.randInt(35, 14365),
y: UTILS.randInt(35, 14365)
};
setInterval(() => {
ranLocation = {
x: UTILS.randInt(35, 14365),
y: UTILS.randInt(35, 14365)
};
}, 60000);
class Bot {
constructor(id, sid, hats, accessories) {
this.millPlace = true;
this.id = id;
this.sid = sid;
this.team = null;
this.skinIndex = 0;
this.tailIndex = 0;
this.hitTime = 0;
this.iconIndex = 0;
this.enemy = [];
this.near = [];
this.dist2 = 0;
this.aim2 = 0;
this.tick = 0;
this.itemCounts = {};
this.latestSkin = 0;
this.latestTail = 0;
this.points = 0;
this.tails = {};
for (let i = 0; i < accessories.length; ++i) {
if (accessories[i].price <= 0)
this.tails[accessories[i].id] = 1;
}
this.skins = {};
for (let i = 0; i < hats.length; ++i) {
if (hats[i].price <= 0)
this.skins[hats[i].id] = 1;
}
this.spawn = function(moofoll) {
this.upgraded = 0;
this.enemy = [];
this.near = [];
this.active = true;
this.alive = true;
this.lockMove = false;
this.lockDir = false;
this.minimapCounter = 0;
this.chatCountdown = 0;
this.shameCount = 0;
this.shameTimer = 0;
this.sentTo = {};
this.gathering = 0;
this.autoGather = 0;
this.animTime = 0;
this.animSpeed = 0;
this.mouseState = 0;
this.buildIndex = -1;
this.weaponIndex = 0;
this.dmgOverTime = {};
this.noMovTimer = 0;
this.maxXP = 300;
this.XP = 0;
this.age = 1;
this.kills = 0;
this.upgrAge = 2;
this.upgradePoints = 0;
this.x = 0;
this.y = 0;
this.zIndex = 0;
this.xVel = 0;
this.yVel = 0;
this.slowMult = 1;
this.dir = 0;
this.nDir = 0;
this.dirPlus = 0;
this.targetDir = 0;
this.targetAngle = 0;
this.maxHealth = 100;
this.health = this.maxHealth;
this.oldHealth = this.maxHealth;
this.scale = config.playerScale;
this.speed = config.playerSpeed;
this.resetMoveDir();
this.resetResources(moofoll);
this.items = [0, 3, 6, 10];
this.weapons = [0];
this.shootCount = 0;
this.weaponXP = [];
this.reloads = {
0: 0,
1: 0,
2: 0,
3: 0,
4: 0,
5: 0,
6: 0,
7: 0,
8: 0,
9: 0,
10: 0,
11: 0,
12: 0,
13: 0,
14: 0,
15: 0,
53: 0,
};
this.whyDie = "";
this.clearRadius = false;
};
// RESET MOVE DIR:
this.resetMoveDir = function () {
this.moveDir = undefined;
};
// RESET RESOURCES:
this.resetResources = function (moofoll) {
for (let i = 0; i < config.resourceTypes.length; ++i) {
this[config.resourceTypes[i]] = moofoll ? 100 : 0;
}
};
// SET DATA:
this.setData = function (data) {
this.id = data[0];
this.sid = data[1];
this.name = data[2];
this.x = data[3];
this.y = data[4];
this.dir = data[5];
this.health = data[6];
this.maxHealth = data[7];
this.scale = data[8];
this.skinColor = data[9];
};
// SHAME SYSTEM:
this.judgeShame = function () {
if (this.oldHealth < this.health) {
if (this.hitTime) {
let timeSinceHit = this.tick - this.hitTime;
this.hitTime = 0;
if (timeSinceHit < 2) {
this.shameCount++;
} else {
this.shameCount = Math.max(0, this.shameCount -
2);
}
}
} else if (this.oldHealth > this.health) {
this.hitTime = this.tick;
}
};
this.closeSockets = function(websc) {
websc.close();
};
}
};
class BotObjManager {
constructor(botObj, fOS) {
// DISABLE OBJ:
this.disableObj = function (obj) {
obj.active = false;
if (config.anotherVisual) {
} else {
obj.alive = false;
}
};
// ADD NEW:
let tmpObj;
this.add = function(sid, x, y, dir, s, type, data, setSID,
owner) {
tmpObj = fOS(sid);
if (!tmpObj) {
tmpObj = botObj.find((tmp) => !tmp.active);
if (!tmpObj) {
tmpObj = new BotObject(sid);
botObj.push(tmpObj);
}
}
if (setSID) {
tmpObj.sid = sid;
}
tmpObj.init(x, y, dir, s, type, data, owner);
};
// DISABLE BY SID:
this.disableBySid = function(sid) {
let find = fOS(sid);
if (find) {
this.disableObj(find);
}
};
// REMOVE ALL FROM PLAYER:
this.removeAllItems = function(sid, server) {
botObj.filter((tmp) => tmp.active && tmp.owner &&
tmp.owner.sid == sid).forEach((tmp) => this.disableObj(tmp));
};
}
};
function botSpawn(id) {
let donthealindist = false;
let nearesttreeangle, neareststoneangle, nearestfoodangle,
nearestgoldmineangle;
let nearesttree, neareststone, nearestfood, nearestgoldmine;
let wooding, stoneing, fooding, golding, stopfarming;
let syncing = false;
let spamming = false;
let bot;
console.log(WS);
let t = WS.url.split("wss://")[1].split("?")[0];
bot = id && new WebSocket("wss://" + t + "?token=re:" +
encodeURIComponent(id));
let botPlayer = new Map();
let botSID;
let botObj = [];
let nearObj = [];
let bD = {
x: 0,
y: 0,
inGame: false,
closeSocket: false,
whyDie: ""
};
let oldXY = {
x: 0,
y: 0,
};
let izauto = 0;
let botObjManager = new BotObjManager(botObj, function(sid)
{ return findSID(botObj, sid); });
bot.binaryType = "arraybuffer";
bot.first = true;
bot.sendWS = function(type) {
// EXTRACT DATA ARRAY:
let data = Array.prototype.slice.call(arguments, 1);
// SEND MESSAGE:
let binary = window.msgpack.encode([type, data]);
bot.send(binary);
};
var nameBots = [
"p9ssy", "technoblade", "im not a bot", "blisma skid", "zika
scamer", "onion dumb", "super mod", "ch-bot", "freenitro", "no rizz",
"noob fat", "fireends", "blisma skid", "zika trash", "zika
skid", "awda trash", "drizz skider", "bloodtrash", "uwu blaqc man", "das8174hjk",
"fkjls2", "dksla2", "dsajk", "supermod", "pancake2023",
"pancakeOP", "skid", "drizz trash", "trash", "noskill", "legit trash", "dawn best",
"dawncoder", "disneytrash",
"bryantrash","onioncool","onionskid","djaskl","kldjsa","48792374"
,"ez","skidder","nezartpro","spiralskid","aleksagood","ironicsk
id","blackycool","skibidi","robloxbest","mootrash","uehskidXD","chicken2023","fiere
","noob","trashLXD","nickybest"
];
function getRandomName() {
return nameBots[Math.floor(Math.random() * nameBots.length)];
}
bot.spawn = function () {
bot.sendWS("M", {
name: getRandomName(),
moofoll: 1,
skin: "__proto__"
});
};
bot.sendUpgrade = function(index) {
bot.sendWS("H", index);
};
bot.place = function(id, a) {
try {
let item = items.list[botPlayer.items[id]];
if (botPlayer.itemCounts[item.group.id] == undefined ? true
: botPlayer.itemCounts[item.group.id] < (config.isSandbox ? getEl("").value :
item.group.limit ? item.group.limit : getEl("").value)) {
bot.sendWS("G", botPlayer.items[id]);
bot.sendWS("d", 1, a);
bot.sendWS("G", botPlayer.weaponIndex, true);
}
} catch (e) {
}
};
bot.buye = function(id, index) {
let nID = 0;
if (botPlayer.alive && botPlayer.inGame) {
if (index == 0) {
if (botPlayer.skins[id]) {
if (botPlayer.latestSkin != id) {
bot.sendWS("c", 0, id, 0);
}
} else {
let find = findID(hats, id);
if (find) {
if (botPlayer.points >= find.price) {
bot.sendWS("c", 1, id, 0);
bot.sendWS("c", 0, id, 0);
} else {
if (botPlayer.latestSkin != nID) {
bot.sendWS("c", 0, nID, 0);
}
}
} else {
if (botPlayer.latestSkin != nID) {
bot.sendWS("c", 0, nID, 0);
}
}
}
} else if (index == 1) {
if (botPlayer.tails[id]) {
if (botPlayer.latestTail != id) {
bot.sendWS("c", 0, id, 1);
}
} else {
let find = findID(accessories, id);
if (find) {
if (botPlayer.points >= find.price) {
bot.sendWS("c", 1, id, 1);
bot.sendWS("c", 0, id, 1);
} else {
if (botPlayer.latestTail != 0) {
bot.sendWS("c", 0, 0, 1);
}
}
} else {
if (botPlayer.latestTail != 0) {
bot.sendWS("c", 0, 0, 1);
}
}
}
}
}
};
bot.fastGear = function() {
if (botPlayer.y2 >= config.mapScale / 2 - config.riverWidth / 2
&& botPlayer.y2 <= config.mapScale / 2 + config.riverWidth / 2) {
bot.buye(31, 0);
} else {
if (botPlayer.moveDir == undefined) {
bot.buye(6, 0);
} else {
if (botPlayer.y2 <= config.snowBiomeTop) {
bot.buye(15, 0);
} else {
bot.buye(12, 0);
}
}
}
};
function caf(e, t) {
try {
return Math.atan2((t.y2 || t.y) - (e.y2 || e.y), (t.x2 ||
t.x) - (e.x2 || e.x));
} catch (e) {
return 0;
}
}
bot.heal = function() {
if (botPlayer.health < 100) {
bot.place(0, 0)
// } else if(player.shameCount > 0) {
// buyEquip(7,0);
// } else {
//buyEquip(6,0);
}
}
function cdf (e, t){
try {
return Math.hypot((t.y2||t.y)-(e.y2||e.y), (t.x2||t.x)-
(e.x2||e.x));
} catch(e){
return Infinity;
}
}
let zoon = 'no';
bot.zyncreal = function(a) {
zoon = 'yeah';
bot.place(5, caf(botPlayer, a));
syncing = true
if (autoaims){
botPlayer.nDir = Math.atan2(nearenemy.y2 - botPlayer.y2,
nearenemy.x2 - botPlayer.x2);
}else {
botPlayer.nDir = undefined
}
bot.buye(53, 0)
bot.sendWS("D", botPlayer.nDir);
bot.sendWS("K", 1);
bot.place(5, botPlayer.nDir);
setTimeout(() => {
bot.sendWS("K", 1);
shotings = true
}, 200)
setTimeout(() => {
zoon = 'no';
}, 500)
setTimeout(() => {
syncing = false
shotings = false
}, 1750)
bot.sendWS("G", botPlayer.weapons[1], true);
setTimeout(() => {
bot.sendWS("G", botPlayer.weapons[0], true);
}, 2000);
}
bot.zync = function(a) {
zoon = 'yeah';
bot.place(5, caf(botPlayer, a));
let NextTickLocation = {
x: botPlayer.x + Math.cos(caf(a, botPlayer) - Math.PI) *
80,
y: botPlayer.y + Math.sin(caf(a, botPlayer) - Math.PI) *
80,
x2: botPlayer.x + Math.cos(caf(a, botPlayer) - Math.PI) *
80,
y2: botPlayer.y + Math.sin(caf(a, botPlayer) - Math.PI) *
80,
};
setTimeout(() => {
zoon = 'no';
clearInterval(aa);
}, 500);
};
bot.onmessage = function(message) {
let data = new Uint8Array(message.data);
let parsed = window.msgpack.decode(data);
let type = parsed[0];
data = parsed[1];
if (type == "io-init") {
bot.spawn();
}
if (type == "1") {
botSID = data[0];
console.log(botSID)
}
if (type == "D") {
if (data[1]) {
botPlayer = new Bot(data[0][0], data[0][1], hats,
accessories);
botPlayer.setData(data[0]);
botPlayer.inGame = true;
botPlayer.alive = true;
botPlayer.x2 = undefined;
botPlayer.y2 = undefined;
botPlayer.spawn(1);
botPlayer.oldHealth = 100;
botPlayer.health = 100;
oldXY = {
x: data[0][3],
y: data[0][4]
}
bD.inGame = true;
if (bot.first) {
bot.first = false;
bots.push(bD);
}
}
console.log(botPlayer)
}
if (type == "P") {
bot.spawn();
botPlayer.inGame = false;
bD.inGame = false;
}
if (type == "a") {
let tmpData = data[0];
botPlayer.tick++;
botPlayer.enemy = [];
//botPlayer.perfectReplace();
botPlayer.near = [];
nearObj = [];
for (let i = 0; i < tmpData.length;) {
if (tmpData[i] == botPlayer.sid) {
botPlayer.x2 = tmpData[i + 1];
botPlayer.y2 = tmpData[i + 2];
botPlayer.d2 = tmpData[i + 3];
botPlayer.buildIndex = tmpData[i + 4];
botPlayer.weaponIndex = tmpData[i + 5];
botPlayer.weaponVariant = tmpData[i + 6];
botPlayer.team = tmpData[i + 7];
botPlayer.isLeader = tmpData[i + 8];
botPlayer.skinIndex = tmpData[i + 9];
botPlayer.tailIndex = tmpData[i + 10];
botPlayer.iconIndex = tmpData[i + 11];
botPlayer.zIndex = tmpData[i + 12];
botPlayer.visible = true;
bD.x2 = botPlayer.x2;
bD.y2 = botPlayer.y2;
}
i += 13;
}
if (enemy.length) {
//console.log(enemy)
botPlayer.near = enemy.sort(function(tmp1, tmp2) {
return tmp1.dist2 - tmp2.dist2;
})[0];
}
if (izauto == 1) {
bot.sendWS("K", 1);
izauto = 0;
}
if (bD.closeSocket) {
botPlayer.closeSockets(bot);
}
if (bD.whyDie != "") {
botPlayer.whyDieChat(bot, bD.whyDie);
bD.whyDie = "";
}
if (botPlayer.alive) {
if (player.team) {
if (botPlayer.team != player.team &&
(botPlayer.tick % 9 === 0)) {
botPlayer.team && (bot.sendWS("N"));
bot.sendWS("b", player.team);
}
}
if (botPlayer.inGame) {
if (botObj.length > 0) {
let buldingtoawdoin = botObj.filter((e) =>
e.active && e.isItem && UTILS.getDist(e, player, 0, 2) <= (600));
if (getEl("mode").value == 'fuckemup') {
bot.selectWeapon(botPlayer.weapons[1]);
console.log(buldingtoawdoin);
let gotoDist =
UTILS.getDist(buldingtoawdoin[0], botPlayer, 0, 2);
let gotoAim =
UTILS.getDirect(buldingtoawdoin[0], botPlayer, 0, 2);
nearObj = botObj.filter((e) => e.active &&
(findSID(buldingtoawdoin, e.sid) ? true : !(e.trap && (player.sid == e.owner.sid ||
player.findAllianceBySid(e.owner.sid)))) && e.isItem && UTILS.getDist(e, botPlayer,
0, 2) <= (items.weapons[botPlayer.weaponIndex].range + e.scale)).sort(function(a,
b) {
return UTILS.getDist(a, botPlayer, 0,
2) - UTILS.getDist(b, botPlayer, 0, 2);
})[0];
if (nearObj) {
let isPassed =
UTILS.getDist(buldingtoawdoin[0], nearObj, 0, 0);
if ((gotoDist - isPassed) > 0) {
if (findSID(buldingtoawdoin,
nearObj.sid) ? true : (nearObj.dmg || nearObj.trap || nearObj.teleport)) {
if (botPlayer.moveDir !=
undefined) {
botPlayer.moveDir =
undefined;
bot.sendWS("a",
botPlayer.moveDir);
bot.sendWS("D",
botPlayer.nDir);
}
} else {
botPlayer.moveDir = gotoAim;
bot.sendWS("a",
botPlayer.moveDir);
bot.sendWS("D",
botPlayer.nDir);
}
if (botPlayer.nDir !=
UTILS.getDirect(nearObj, botPlayer, 0, 2)) {
botPlayer.nDir =
UTILS.getDirect(nearObj, botPlayer, 0, 2);
bot.sendWS("D",
botPlayer.nDir);
}
if (izauto == 0) {
bot.sendWS("K", 1);
izauto = 1;
}
bot.buye(40, 0);
} else {
botPlayer.moveDir = gotoAim;
bot.sendWS("a", botPlayer.moveDir);
bot.sendWS("D", botPlayer.nDir);
bot.fastGear();
}
} else {
botPlayer.moveDir = gotoAim;
bot.sendWS("a", botPlayer.moveDir);
bot.sendWS("D", botPlayer.nDir);
bot.fastGear();
}
}
}
if (nearObj) {
if (izauto == 0) {
bot.sendWS("K", 1);
izauto = 1;
}
if (botPlayer.nDir !=
UTILS.getDirect(nearObj, botPlayer, 0, 2)) {
botPlayer.nDir =
UTILS.getDirect(nearObj, botPlayer, 0, 2);
bot.sendWS("D", botPlayer.nDir);
}
bot.buye(40, 0);
bot.buye(11, 1);
} else {
bot.fastGear();
bot.buye(11, 1);
}
bot.buye(11, 1);
}
}
/* var adjustlol = getEl("adjust1").value
var adjustL = getEl("adjust2").value
var ceA = getEl("circleToggle").checked;
var cR = 200;//200 antigo codigo do ueh
var cS = 0.02;//0.01 antigo codigo do ueh
if (ceA) {
let cX = player.x + cR * Math.cos(Date.now() * cS);
let cY = player.y + cR * Math.sin(Date.now() * cS);
// } else {
// if(UTILS.getDist(player, botPlayer, 0, 2) >
210) {
// bot.sendWS("D", UTILS.getDirect(player,
botPlayer, 0, 2));
// bot.sendWS("a", caf(player, botPlayer) +
Math.PI);
// if (UTILS.getDist(oldXY, botPlayer, 0,
2) > 90) {
// let aim = UTILS.getDirect(oldXY,
botPlayer, 0, 2);
// bot.place(3, aim + 7.7);
// bot.place(3, aim - 7.7);
// bot.place(3, aim);
// oldXY = {
// x: botPlayer.x2,
// y: botPlayer.y2
// };
// }
// } else {
// bot.sendWS("a", undefined);
// }
// }
}
}
}
if (type == "H") {
let tmpData = data[0];
for (let i = 0; i < tmpData.length;) {
botObjManager.add(tmpData[i], tmpData[i + 1], tmpData[i
+ 2], tmpData[i + 3], tmpData[i + 4],
tmpData[i + 5], items.list[tmpData[i
+ 6]], true, (tmpData[i + 7] >= 0 ? {
sid: tmpData[i + 7]
} : null));
i += 8;
}
}
if (type == "N") {
let index = data[0];
let value = data[1];
if (botPlayer) {
botPlayer[index] = value;
}
}
if (type == "O") {
//console.log(data[0])
//console.log(data[0])
//console.log(botSID)
if (data[0] == botPlayer.sid) {
// console.log("ok")
botPlayer.oldHealth = botPlayer.health;
botPlayer.health = data[1];
// bot.sendWS("6", botPlayer.health + '');
botPlayer.judgeShame();
// let damage =
tmpObj.oldHealth - tmpObj.health;
if (botPlayer.oldHealth > botPlayer.health) {
if (botPlayer.shameCount < 5) {
for (let i = 0; i < 2; i++) {
bot.place(0, botPlayer.nDir);
}
} else {
setTimeout(() => {
for (let i = 0; i < 2; i++) {
bot.place(0, botPlayer.nDir);
}
}, 95);
}
}
}
}
if (type == "Q") {
let sid = data[0];
botObjManager.disableBySid(sid);
}
if (type == "R") {
let sid = data[0];
if (botPlayer.alive) botObjManager.removeAllItems(sid);
}
if (type == "S") {
let index = data[0];
let value = data[1];
if (botPlayer) {
botPlayer.itemCounts[index] = value;
}
}
if (type == "U") {
if (data[0] > 0) {
if(getEl("setup").value == 'dm') {
if (botPlayer.upgraded == 0) {
bot.sendUpgrade(7);
} else if (botPlayer.upgraded == 1) {
bot.sendUpgrade(17);
} else if (botPlayer.upgraded == 2) {
bot.sendUpgrade(31);
} else if (botPlayer.upgraded == 3) {
bot.sendUpgrade(23);
} else if (botPlayer.upgraded == 4) {
bot.sendUpgrade(9);
} else if (botPlayer.upgraded == 5) {
bot.sendUpgrade(34);
} else if (botPlayer.upgraded == 6) {
bot.sendUpgrade(12);
} else if (botPlayer.upgraded == 7) {
bot.sendUpgrade(15);
}
} else if(getEl("setup").value == 'dr') {
if (botPlayer.upgraded == 0) {
bot.sendUpgrade(3);
} else if (botPlayer.upgraded == 1) {
bot.sendUpgrade(17);
} else if (botPlayer.upgraded == 2) {
bot.sendUpgrade(31);
} else if (botPlayer.upgraded == 3) {
bot.sendUpgrade(23);
} else if (botPlayer.upgraded == 4) {
bot.sendUpgrade(9);
} else if (botPlayer.upgraded == 5) {
bot.sendUpgrade(34);
} else if (botPlayer.upgraded == 6) {
bot.sendUpgrade(12);
} else if (botPlayer.upgraded == 7) {
bot.sendUpgrade(15);
}
}else if(getEl("setup").value == 'dm') {
if (botPlayer.upgraded == 0) {
bot.sendUpgrade(3);
} else if (botPlayer.upgraded == 1) {
bot.sendUpgrade(17);
} else if (botPlayer.upgraded == 2) {
bot.sendUpgrade(31);
} else if (botPlayer.upgraded == 3) {
bot.sendUpgrade(23);
} else if (botPlayer.upgraded == 4) {
bot.sendUpgrade(9);
} else if (botPlayer.upgraded == 5) {
bot.sendUpgrade(34);
} else if (botPlayer.upgraded == 6) {
bot.sendUpgrade(12);
} else if (botPlayer.upgraded == 7) {
bot.sendUpgrade(15);
}
}else if(getEl("setup").value == 'dR') {
if (botPlayer.upgraded == 0) {
bot.sendUpgrade(3);
} else if (botPlayer.upgraded == 1) {
bot.sendUpgrade(17);
} else if (botPlayer.upgraded == 2) {
bot.sendUpgrade(31);
} else if (botPlayer.upgraded == 3) {
bot.sendUpgrade(23);
} else if (botPlayer.upgraded == 4) {
bot.sendUpgrade(9);
} else if (botPlayer.upgraded == 5) {
bot.sendUpgrade(34);
} else if (botPlayer.upgraded == 6) {
bot.sendUpgrade(12);
} else if (botPlayer.upgraded == 7) {
bot.sendUpgrade(13);
}
}
botPlayer.upgraded++;
}
}
if (type == "V") {
let tmpData = data[0];
let wpn = data[1];
if (tmpData) {
if (wpn) botPlayer.weapons = tmpData;
else botPlayer.items = tmpData;
}
}
if (type == "5") {
let type = data[0];
let id = data[1];
let index = data[2];
if (index) {
if (!type)
botPlayer.tails[id] = 1;
else
botPlayer.latestTail = id;
} else {
if (!type)
botPlayer.skins[id] = 1;
else
botPlayer.latestSkin = id;
}
}
if (type == "6") {
let id = data[0];
let mzg = data[1]+'';
if(id == player.sid && mzg.includes("nuh uh")) {
bot.zync(botPlayer.near);
}
}
};
bot.onclose = function() {
botPlayer.inGame = false;
bD.inGame = false;
};
}
// RENDER LEAF:
function renderLeaf(x, y, l, r, ctxt) {
let endX = x + (l * Math.cos(r));
let endY = y + (l * Math.sin(r));
let width = l * 0.4;
ctxt.moveTo(x, y);
ctxt.beginPath();
ctxt.quadraticCurveTo(((x + endX) / 2) + (width * Math.cos(r +
Math.PI / 2)),
((y + endY) / 2) + (width * Math.sin(r +
Math.PI / 2)), endX, endY);
ctxt.quadraticCurveTo(((x + endX) / 2) - (width * Math.cos(r +
Math.PI / 2)),
((y + endY) / 2) - (width * Math.sin(r +
Math.PI / 2)), x, y);
ctxt.closePath();
ctxt.fill();
ctxt.stroke();
}
// RENDER CIRCLE:
function renderCircle(x, y, scale, tmpContext, dontStroke, dontFill) {
tmpContext = tmpContext || mainContext;
tmpContext.beginPath();
tmpContext.arc(x, y, scale, 0, 2 * Math.PI);
if (!dontFill) tmpContext.fill();
if (!dontStroke) tmpContext.stroke();
}
// RENDER RECTANGLE:
function renderRect(x, y, w, h, ctxt, dontStroke, dontFill) {
if (!dontFill) ctxt.fillRect(x - (w / 2), y - (h / 2), w, h);
if (!dontStroke) ctxt.strokeRect(x - (w / 2), y - (h / 2), w, h);
}
// RENDER RECTCIRCLE:
function renderRectCircle(x, y, s, sw, seg, ctxt, dontStroke, dontFill)
{
ctxt.save();
ctxt.translate(x, y);
seg = Math.ceil(seg / 2);
for (let i = 0; i < seg; i++) {
renderRect(0, 0, s * 2, sw, ctxt, dontStroke, dontFill);
ctxt.rotate(Math.PI / seg);
}
ctxt.restore();
}
// RENDER BLOB:
function renderBlob(ctxt, spikes, outer, inner) {
let rot = Math.PI / 2 * 3;
let x, y;
let step = Math.PI / spikes;
let tmpOuter;
ctxt.beginPath();
ctxt.moveTo(0, -inner);
for (let i = 0; i < spikes; i++) {
tmpOuter = UTILS.randInt(outer + 0.9, outer * 1.2);
ctxt.quadraticCurveTo(Math.cos(rot + step) * tmpOuter,
Math.sin(rot + step) * tmpOuter,
Math.cos(rot + (step * 2)) * inner,
Math.sin(rot + (step * 2)) * inner);
rot += step * 2;
}
ctxt.lineTo(0, -inner);
ctxt.closePath();
}
// RENDER TRIANGLE:
function renderTriangle(s, ctx) {
ctx = ctx || mainContext;
let h = s * (Math.sqrt(3) / 2);
ctx.beginPath();
ctx.moveTo(0, -h / 2);
ctx.lineTo(-s / 2, h / 2);
ctx.lineTo(s / 2, h / 2);
ctx.lineTo(0, -h / 2);
ctx.fill();
ctx.closePath();
}
// RENDER PLAYERS:
// RENDER PLAYERS:
function renderPlayers(xOffset, yOffset, zIndex) {
mainContext.globalAlpha = 1;
mainContext.fillStyle = "#91b2db";
for (var i = 0; i < players.length; ++i) {
tmpObj = players[i];
if (tmpObj.zIndex == zIndex) {
tmpObj.animate(delta);
if (tmpObj.visible) {
tmpObj.skinRot += (0.002 * delta);
tmpDir = (!configs.showDir && !useWasd && tmpObj ==
player) ? configs.attackDir ? getVisualDir() : getSafeDir() : (tmpObj.dir||0);
mainContext.save();
mainContext.translate(tmpObj.x - xOffset, tmpObj.y -
yOffset);
// RENDER PLAYER:
mainContext.rotate(tmpDir + tmpObj.dirPlus);
renderPlayer(tmpObj, mainContext);
mainContext.restore();
}
}
}
}
// RENDER PLAYER:
function renderPlayer(obj, ctxt) {
ctxt = ctxt || mainContext;
ctxt.lineWidth = outlineWidth;
ctxt.lineJoin = "miter";
let handAngle = (Math.PI / 4) *
(items.weapons[obj.weaponIndex].armS||1);
let oHandAngle = (obj.buildIndex < 0)?
(items.weapons[obj.weaponIndex].hndS||1):1;
let oHandDist = (obj.buildIndex < 0)?
(items.weapons[obj.weaponIndex].hndD||1):1;
// TAIL/CAPE:
if (obj.tailIndex > 0) {
renderTail(obj.tailIndex, ctxt, obj);
}
items.projectiles[items.weapons[obj.weaponIndex].projectile], mainContext);
}
}
// HANDS:
ctxt.fillStyle = config.skinColors[obj.skinColor];
renderCircle(obj.scale * Math.cos(handAngle), (obj.scale *
Math.sin(handAngle)), 14);
renderCircle((obj.scale * oHandDist) * Math.cos(-handAngle *
oHandAngle),
(obj.scale * oHandDist) * Math.sin(-handAngle *
oHandAngle), 14);
items.projectiles[items.weapons[obj.weaponIndex].projectile], mainContext);
}
}
// BUILD ITEM:
if (obj.buildIndex >= 0) {
var tmpSprite = getItemSprite(items.list[obj.buildIndex]);
ctxt.drawImage(tmpSprite, obj.scale -
items.list[obj.buildIndex].holdOffset, -tmpSprite.width / 2);
}
// BODY:
renderCircle(0, 0, obj.scale, ctxt);
// SKIN:
if (obj.skinIndex > 0) {
ctxt.rotate(Math.PI/2);
renderSkin(obj.skinIndex, ctxt, null, obj);
}
// RENDER SKINS:
let skinSprites = {};
let skinPointers = {};
let tmpSkin;
function renderSkin(index, ctxt, parentSkin, owner) {
tmpSkin = skinSprites[index];
let hatTextures = Array.from({ length: 58 }, () => null);
hatTextures[1] =
"https://cdn.discordapp.com/attachments/386994737090920450/527810798387462144/
Super_Marksman.png?
ex=668c76dc&is=668b255c&hm=9404328f37bf5cee783628b8d9c6eb82c50cb8c8b00568a2091a5141
716b624d&";
hatTextures[6] = "https://i.imgur.com/QXNteg3.png";
hatTextures[7] = "https://i.imgur.com/EBzS6kP.png";
hatTextures[12] = "https://i.imgur.com/uQHU4zc.png";
hatTextures[26] =
"https://cdn.discordapp.com/attachments/386994737090920450/599250633559638056/
Brawler_Helmet_detailed.png?
ex=668ca4e4&is=668b5364&hm=35e668dc5bea53d7f506e6e20755a649411f0df5a4ab46ed343e7e29
c7e8479a&";
hatTextures[40] = "https://i.imgur.com/hMdtMlU.png";
hatTextures[56] =
"https://cdn.discordapp.com/attachments/386994737090920450/436018250560700417/
Hood_2.0.png?
ex=668cbaa3&is=668b6923&hm=1b4c35b22987240e63815629e9bbf345d2d5b13369e47a2365a5e44c
c3440619&";
if (!tmpSkin) {
let tmpImage = new Image();
tmpImage.onload = function() {
this.isLoaded = true;
this.onload = null;
};
if (hatTextures[index]) {
//console.log("EZ");
tmpImage.src = hatTextures[index];
} else {
tmpImage.src = "https://moomoo.io/img/hats/hat_" + index +
".png";
}
skinSprites[index] = tmpImage;
tmpSkin = tmpImage;
}
let tmpObj = parentSkin||skinPointers[index];
if (!tmpObj) {
for (let i = 0; i < hats.length; ++i) {
if (hats[i].id == index) {
tmpObj = hats[i];
break;
}
}
skinPointers[index] = tmpObj;
}
if (tmpSkin.isLoaded)
ctxt.drawImage(tmpSkin, -tmpObj.scale/2, -tmpObj.scale/2,
tmpObj.scale, tmpObj.scale);
if (!parentSkin && tmpObj.topSprite) {
ctxt.save();
ctxt.rotate(owner.skinRot);
renderSkin(index + "_top", ctxt, tmpObj, owner);
ctxt.restore();
}
}
// RENDER TAIL:
let accessSprites = {};
let accessPointers = {};
function renderTail(index, ctxt, owner) {
let accessoryTextures = Array.from({ length: 58 }, () => null);
accessoryTextures[18] = "http://i.imgur.com/1eGwp3R.png";
accessoryTextures[19] = "https://i.imgur.com/tgfyha4.png";
accessoryTextures[21] = "http://i.imgur.com/PvZNc9Q.png";
tmpSkin = accessSprites[index];
if (!tmpSkin) {
let tmpImage = new Image();
tmpImage.onload = function() {
this.isLoaded = true;
this.onload = null;
};
if (accessoryTextures[index]) {
tmpImage.src = accessoryTextures[index];
} else {
tmpImage.src = "https://moomoo.io/img/accessories/access_"
+ index + ".png";
}
accessSprites[index] = tmpImage;
tmpSkin = tmpImage;
}
let tmpObj = accessPointers[index];
if (!tmpObj) {
for (let i = 0; i < accessories.length; ++i) {
if (accessories[i].id == index) {
tmpObj = accessories[i];
break;
}
}
accessPointers[index] = tmpObj;
}
if (tmpSkin.isLoaded) {
ctxt.save();
ctxt.translate(-20 - (tmpObj.xOff || 0), 0);
if (tmpObj.spin)
ctxt.rotate(owner.skinRot);
ctxt.drawImage(tmpSkin, -(tmpObj.scale / 2), -(tmpObj.scale /
2), tmpObj.scale, tmpObj.scale);
ctxt.restore();
}
}
// RENDER TOOL:
let toolSprites = {};
function renderTool(obj, variant, x, y, ctxt) {
let tmpSrc = obj.src + (variant||"");
let tmpSprite = toolSprites[tmpSrc];
if (!tmpSprite) {
tmpSprite = new Image();
tmpSprite.onload = function() {
this.isLoaded = true;
}
tmpSprite.src = "https://moomoo.io/img/weapons/" + tmpSrc +
".png";
toolSprites[tmpSrc] = tmpSprite;
}
if (tmpSprite.isLoaded)
ctxt.drawImage(tmpSprite, x + obj.xOff - (obj.length / 2), y +
obj.yOff - (obj.width / 2), obj.length, obj.width);
}
// RENDER PROJECTILES:
function renderProjectiles(layer, xOffset, yOffset) {
for(let i = 0; i < projectiles.length; i++) {
tmpObj = projectiles[i];
if (tmpObj.active && tmpObj.layer == layer && tmpObj.inWindow)
{
tmpObj.update(delta);
if (tmpObj.active && isOnScreen(tmpObj.x - xOffset,
tmpObj.y - yOffset, tmpObj.scale)) {
mainContext.save();
mainContext.translate(tmpObj.x - xOffset, tmpObj.y -
yOffset);
mainContext.rotate(tmpObj.dir);
renderProjectile(0, 0, tmpObj, mainContext, 1);
mainContext.restore();
}
}
};
}
// RENDER PROJECTILE:
let projectileSprites = {};
function renderProjectile(x, y, obj, ctxt, debug) {
if (obj.src) {
let tmpSrc = items.projectiles[obj.indx].src;
let tmpSprite = projectileSprites[tmpSrc];
if (!tmpSprite) {
tmpSprite = new Image();
tmpSprite.onload = function() {
this.isLoaded = true;
}
tmpSprite.src = "https://moomoo.io/img/weapons/" + tmpSrc +
".png";
projectileSprites[tmpSrc] = tmpSprite;
}
if (tmpSprite.isLoaded)
ctxt.drawImage(tmpSprite, x - (obj.scale / 2), y -
(obj.scale / 2), obj.scale, obj.scale);
} else if (obj.indx == 1) {
ctxt.fillStyle = "#939393";
renderCircle(x, y, obj.scale, ctxt);
}
}
// RENDER AI:
let aiSprites = {};
function renderAI(obj, ctxt) {
let tmpIndx = obj.index;
let tmpSprite = aiSprites[tmpIndx];
if (!tmpSprite) {
let tmpImg = new Image();
tmpImg.onload = function() {
this.isLoaded = true;
this.onload = null;
};
tmpImg.src = "https://moomoo.io/img/animals/" + obj.src +
".png";
tmpSprite = tmpImg;
aiSprites[tmpIndx] = tmpSprite;
}
if (tmpSprite.isLoaded) {
let tmpScale = obj.scale * 1.2 * (obj.spriteMlt || 1);
ctxt.drawImage(tmpSprite, -tmpScale, -tmpScale, tmpScale * 2,
tmpScale * 2);
}
}
// MIDDLE RIVER:
let tmpW = config.riverWidth + padding;
let tmpY = (config.mapScale / 2) - yOffset - (tmpW / 2);
if (tmpY < maxScreenHeight && tmpY + tmpW > 0) {
ctxt.fillRect(0, tmpY, maxScreenWidth, tmpW);
}
}
//tmpContext.shadowBlur = null;
//tmpContext.shadowColor = null;
tmpContext.fillStyle = "#89a54c";
renderCircle(0, 0, obj.scale * 0.55, tmpContext);
tmpContext.fillStyle = "#a5c65b";
renderCircle(0, 0, obj.scale * 0.3, tmpContext, true);
} else {
renderBlob(tmpContext, 6, tmpObj.scale, tmpObj.scale *
0.7);
tmpContext.fillStyle = biomeID?"#e3f1f4":"#89a54c";
tmpContext.fill();
tmpContext.stroke();
//tmpContext.shadowBlur = null;
//tmpContext.shadowColor = null;
tmpContext.fillStyle = biomeID?"#6a64af":"#c15555";
let tmpRange;
let berries = 4;
let rotVal = (Math.PI * 2) / berries;
for (let i = 0; i < berries; ++i) {
tmpRange = UTILS.randInt(tmpObj.scale/3.5,
tmpObj.scale/2.3);
renderCircle(tmpRange * Math.cos(rotVal * i),
tmpRange * Math.sin(rotVal * i),
UTILS.randInt(10, 12), tmpContext);
}
}
} else if (obj.type == 2 || obj.type == 3) {
tmpContext.fillStyle = (obj.type==2)?
(biomeID==2?"#938d77":"#939393"):"#e0c655";
renderStar(tmpContext, 3, obj.scale, obj.scale);
tmpContext.fill();
tmpContext.stroke();
tmpContext.shadowBlur = null;
tmpContext.shadowColor = null;
tmpContext.fillStyle = (obj.type==2)?
(biomeID==2?"#b2ab90":"#bcbcbc"):"#ebdca3";
renderStar(tmpContext, 3, obj.scale * 0.55, obj.scale *
0.65);
tmpContext.fill();
}
tmpSprite = tmpCanvas;
gameObjectSprites[tmpIndex] = tmpSprite;
}
return tmpSprite;
}
// GET ITEM SPRITE:
let itemSprites = [];
function getItemSprite(obj, asIcon) {
let tmpSprite = itemSprites[obj.id];
if (!tmpSprite || asIcon) {
let blurScale = !asIcon && isNight ? 15 : 0;
let tmpCanvas = document.createElement("canvas");
let reScale = ((!asIcon && obj.name == "windmill") ?
items.list[4].scale : obj.scale);
tmpCanvas.width = tmpCanvas.height = (reScale * 2.5) +
outlineWidth + (items.list[obj.id].spritePadding || 0) + blurScale;
if (config.useWebGl) {
let gl = tmpCanvas.getContext("webgl");
gl.clearColor(0, 0, 0, 0);
gl.clear(gl.COLOR_BUFFER_BIT);
function hexToRgb(hex) {
return hex.slice(1).match(/.{1,2}/g).map(g =>
parseInt(g, 16));
}
function getRgb(r, g, b) {
return [r / 255, g / 255, b / 255].join(", ");
}
let max = 100;
for (let i = 0; i < max; i++) {
let radian = (Math.PI * (i / (max / 2)));
render(`
precision mediump float;
attribute vec2 vertex;
void main(void) {
gl_Position = vec4(vertex, 0, 1);
}
`,`
precision mediump float;
void main(void) {
gl_FragColor = vec4(${getRgb(...hexToRgb("#fff"))},
1);
}
`, [
0 + (Math.cos(radian) * 0.5), 0 + (Math.sin(radian)
* 0.5),
0, 0,
], gl.LINE_LOOP);
}
} else {
let tmpContext = tmpCanvas.getContext("2d");
tmpContext.translate((tmpCanvas.width / 2),
(tmpCanvas.height / 2));
tmpContext.rotate(asIcon ? 0 : (Math.PI / 2));
tmpContext.strokeStyle = outlineColor;
tmpContext.lineWidth = outlineWidth * (asIcon ?
(tmpCanvas.width / 81) : 1);
if (isNight && !asIcon) {
tmpContext.shadowBlur = blurScale;
tmpContext.shadowColor = `rgba(0, 0, 0, $
{Math.min(obj.name == "pit trap" ? 0.6 : 0.3, obj.alpha)})`;
}
if (obj.name == "apple") {
tmpContext.fillStyle = "#c15555";
renderCircle(0, 0, obj.scale, tmpContext);
tmpContext.fillStyle = "#89a54c";
let leafDir = -(Math.PI / 2);
renderLeaf(obj.scale * Math.cos(leafDir), obj.scale *
Math.sin(leafDir),
25, leafDir + Math.PI / 2, tmpContext);
} else if (obj.name == "cookie") {
tmpContext.fillStyle = "#cca861";
renderCircle(0, 0, obj.scale, tmpContext);
tmpContext.fillStyle = "#937c4b";
let chips = 4;
let rotVal = (Math.PI * 2) / chips;
let tmpRange;
for (let i = 0; i < chips; ++i) {
tmpRange = UTILS.randInt(obj.scale / 2.5, obj.scale
/ 1.7);
renderCircle(tmpRange * Math.cos(rotVal * i),
tmpRange * Math.sin(rotVal * i),
UTILS.randInt(4, 5), tmpContext,
true);
}
} else if (obj.name == "cheese") {
tmpContext.fillStyle = "#f4f3ac";
renderCircle(0, 0, obj.scale, tmpContext);
tmpContext.fillStyle = "#c3c28b";
let chips = 4;
let rotVal = (Math.PI * 2) / chips;
let tmpRange;
for (let i = 0; i < chips; ++i) {
tmpRange = UTILS.randInt(obj.scale / 2.5, obj.scale
/ 1.7);
renderCircle(tmpRange * Math.cos(rotVal * i),
tmpRange * Math.sin(rotVal * i),
UTILS.randInt(4, 5), tmpContext,
true);
}
} else if (obj.name == "wood wall" || obj.name == "stone
wall" || obj.name == "castle wall") {
tmpContext.fillStyle = (obj.name == "castle wall") ?
"#83898e" : (obj.name == "wood wall") ?
"#a5974c" : "#939393";
let sides = (obj.name == "castle wall") ? 4 : 3;
renderStar(tmpContext, sides, obj.scale * 1.1,
obj.scale * 1.1);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = (obj.name == "castle wall") ?
"#9da4aa" : (obj.name == "wood wall") ?
"#c9b758" : "#bcbcbc";
renderStar(tmpContext, sides, obj.scale * 0.65,
obj.scale * 0.65);
tmpContext.fill();
} else if (obj.name == "spikes" || obj.name == "greater
spikes" || obj.name == "poison spikes" ||
obj.name == "spinning spikes") {
tmpContext.fillStyle = (obj.name == "poison spikes") ?
"#7b935d" : "#939393";
let tmpScale = (obj.scale * 0.6);
renderStar(tmpContext, (obj.name == "spikes") ? 5 : 6,
obj.scale, tmpScale);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = "#a5974c";
renderCircle(0, 0, tmpScale, tmpContext);
tmpContext.fillStyle = "#c9b758";
renderCircle(0, 0, tmpScale / 2, tmpContext, true);
} else if (obj.name == "windmill" || obj.name == "faster
windmill" || obj.name == "power mill") {
tmpContext.fillStyle = "#a5974c";
renderCircle(0, 0, reScale, tmpContext);
tmpContext.fillStyle = "#c9b758";
renderRectCircle(0, 0, reScale * 1.5, 29, 4,
tmpContext);
tmpContext.fillStyle = "#a5974c";
renderCircle(0, 0, reScale * 0.5, tmpContext);
} else if (obj.name == "mine") {
tmpContext.fillStyle = "#939393";
renderStar(tmpContext, 3, obj.scale, obj.scale);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = "#bcbcbc";
renderStar(tmpContext, 3, obj.scale * 0.55, obj.scale *
0.65);
tmpContext.fill();
} else if (obj.name == "sapling") {
for (let i = 0; i < 2; ++i) {
let tmpScale = obj.scale * (!i ? 1 : 0.5);
renderStar(tmpContext, 7, tmpScale, tmpScale *
0.7);
tmpContext.fillStyle = (!i ? "#9ebf57" :
"#b4db62");
tmpContext.fill();
if (!i) tmpContext.stroke();
}
} else if (obj.name == "pit trap") {
tmpContext.fillStyle = "#a5974c";
renderStar(tmpContext, 3, obj.scale * 1.1, obj.scale *
1.1);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = outlineColor;
renderStar(tmpContext, 3, obj.scale * 0.65, obj.scale *
0.65);
tmpContext.fill();
} else if (obj.name == "boost pad") {
tmpContext.fillStyle = "#7e7f82";
renderRect(0, 0, obj.scale * 2, obj.scale * 2,
tmpContext);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = "#dbd97d";
renderTriangle(obj.scale * 1, tmpContext);
} else if (obj.name == "turret") {
tmpContext.fillStyle = "#a5974c";
renderCircle(0, 0, obj.scale, tmpContext);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = "#939393";
let tmpLen = 50;
renderRect(0, -tmpLen / 2, obj.scale * 0.9, tmpLen,
tmpContext);
renderCircle(0, 0, obj.scale * 0.6, tmpContext);
tmpContext.fill();
tmpContext.stroke();
} else if (obj.name == "platform") {
tmpContext.fillStyle = "#cebd5f";
let tmpCount = 4;
let tmpS = obj.scale * 2;
let tmpW = tmpS / tmpCount;
let tmpX = -(obj.scale / 2);
for (let i = 0; i < tmpCount; ++i) {
renderRect(tmpX - (tmpW / 2), 0, tmpW, obj.scale *
2, tmpContext);
tmpContext.fill();
tmpContext.stroke();
tmpX += tmpS / tmpCount;
}
} else if (obj.name == "healing pad") {
tmpContext.fillStyle = "#7e7f82";
renderRect(0, 0, obj.scale * 2, obj.scale * 2,
tmpContext);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = "#db6e6e";
renderRectCircle(0, 0, obj.scale * 0.65, 20, 4,
tmpContext, true);
} else if (obj.name == "spawn pad") {
tmpContext.fillStyle = "#7e7f82";
renderRect(0, 0, obj.scale * 2, obj.scale * 2,
tmpContext);
tmpContext.fill();
tmpContext.stroke();
tmpContext.fillStyle = "#71aad6";
renderCircle(0, 0, obj.scale * 0.6, tmpContext);
} else if (obj.name == "blocker") {
tmpContext.fillStyle = "#7e7f82";
renderCircle(0, 0, obj.scale, tmpContext);
tmpContext.fill();
tmpContext.stroke();
tmpContext.rotate(Math.PI / 4);
tmpContext.fillStyle = "#db6e6e";
renderRectCircle(0, 0, obj.scale * 0.65, 20, 4,
tmpContext, true);
} else if (obj.name == "teleporter") {
tmpContext.fillStyle = "#7e7f82";
renderCircle(0, 0, obj.scale, tmpContext);
tmpContext.fill();
tmpContext.stroke();
tmpContext.rotate(Math.PI / 4);
tmpContext.fillStyle = "#d76edb";
renderCircle(0, 0, obj.scale * 0.5, tmpContext, true);
}
}
tmpSprite = tmpCanvas;
if (!asIcon)
itemSprites[obj.id] = tmpSprite;
}
return tmpSprite;
}
// OBJECT ON SCREEN:
function isOnScreen(x, y, s) {
return (x + s >= 0 && x - s <= maxScreenWidth && y + s >= 0 && (y,
s,
maxScreenHeight));
}
mainContext.save();
mainContext.translate(tmpX, tmpY);
mainContext.rotate(tmpObj.dir);
if (!tmpObj.active) {
mainContext.scale(tmpObj.visScale /
tmpObj.scale, tmpObj.visScale / tmpObj.scale);
}
mainContext.drawImage(tmpSprite, -
(tmpSprite.width / 2), -(tmpSprite.height / 2));
if (tmpObj.blocker) {
mainContext.strokeStyle = "#db6e6e";
mainContext.globalAlpha = 0.3;
mainContext.lineWidth = 6;
renderCircle(0, 0, tmpObj.blocker, mainContext,
false, true);
}
mainContext.restore();
} else {
tmpSprite = getResSprite(tmpObj);
mainContext.drawImage(tmpSprite, tmpX -
(tmpSprite.width / 2), tmpY - (tmpSprite.height / 2));
}
}
if (buildheal && tmpObj.health < tmpObj.maxHealth &&
UTILS.getDistance(player.x, player.y, tmpObj.x, tmpObj.y) < 275) {
mainContext.save(); // Save the current drawing state
// HEALTH HOLDER:
mainContext.fillStyle = 'rgba(0, 0, 0, 0.5)'; // Set
health holder color to black with 70% opacity
mainContext.strokeStyle = 'rgba(0, 0, 0, 0.5)'; // Set border color to black
with 70% opacity
mainContext.lineWidth = .5; // Adjust line width for the border
}
})
// PLACE VISIBLE:
}
function markObject(tmpObj, tmpX, tmpY) {
getMarkSprite(tmpObj, mainContext, tmpX, tmpY);
}
// RENDER MINIMAP:
class MapPing {
constructor(color, scale) {
this.init = function (x, y) {
this.scale = 0;
this.x = x;
this.y = y;
this.active = true;
};
this.update = function (ctxt, delta) {
if (this.active) {
this.scale += 0.05 * delta;
if (this.scale >= scale) {
this.active = false;
} else {
ctxt.globalAlpha = (1 - Math.max(0, this.scale /
scale));
ctxt.beginPath();
ctxt.arc((this.x / config.mapScale) *
mapDisplay.width, (this.y / config.mapScale)
* mapDisplay.width, this.scale, 0, 2 *
Math.PI);
ctxt.stroke();
}
}
};
this.color = color;
}
}
function pingMap(x, y) {
tmpPing = mapPings.find(pings => !pings.active);
if (!tmpPing) {
tmpPing = new MapPing("#fff", config.mapPingScale);
mapPings.push(tmpPing);
}
tmpPing.init(x, y);
}
function updateMapMarker() {
mapMarker.x = player.x;
mapMarker.y = player.y;
}
function renderMinimap(delta) {
if (player && player.alive) {
mapContext.clearRect(0, 0, mapDisplay.width,
mapDisplay.height);
// RENDER PINGS:
mapContext.lineWidth = 4;
for (let i = 0; i < mapPings.length; ++i) {
tmpPing = mapPings[i];
mapContext.strokeStyle = tmpPing.color;
tmpPing.update(mapContext, delta);
}
(breakTrackers[i].y/config.mapScale)*mapDisplay.height);
i += 2;
}
}
Tach.drawWaypointMap(mapContext, mapDisplay);
// RENDER PLAYERS:
mapContext.globalAlpha = 1;
mapContext.fillStyle = "#fff";
renderCircle((player.x/config.mapScale)*mapDisplay.width,
(player.y/config.mapScale)*mapDisplay.height, 7,
mapContext, true);
mapContext.fillStyle = "rgba(255,255,255,0.35)";
if (player.team && minimapData) {
for (let i = 0; i < minimapData.length;) {
renderCircle((minimapData[i]/config.mapScale)*mapDisplay.width,
// RENDER BOTS:
if (bots.length) {
bots.forEach((tmp) => {
if (tmp.inGame) {
mapContext.globalAlpha = 1;
mapContext.strokeStyle = "#cc5151";
renderCircle((tmp.x2 / config.mapScale) *
mapDisplay.width,
(tmp.y2 / config.mapScale) *
mapDisplay.height, 7, mapContext, false, true);
}
});
}
// DEATH LOCATION:
if (lastDeath) {
mapContext.fillStyle = "#fc5553";
mapContext.font = "34px Hammersmith One";
mapContext.textBaseline = "middle";
mapContext.textAlign = "center";
mapContext.fillText("x",
(lastDeath.x/config.mapScale)*mapDisplay.width,
(lastDeath.y/config.mapScale)*mapDisplay.height);
}
// MAP MARKER:
if (mapMarker) {
mapContext.fillStyle = "#fff";
mapContext.font = "34px Hammersmith One";
mapContext.textBaseline = "middle";
mapContext.textAlign = "center";
mapContext.fillText("x",
(mapMarker.x/config.mapScale)*mapDisplay.width,
(mapMarker.y/config.mapScale)*mapDisplay.height);
}
}
}
// ICONS:
let crossHairs =
["https://cdn.discordapp.com/attachments/1001384433078779927/1149285738412769300/
newawwddd.png",
"https://cdn.discordapp.com/attachments/1001384433078779927/1149285168780165170/100
px-Crosshairs_Red.png"];
let crossHairSprites = {};
let iconSprites = {};
let icons = ["crown", "skull"];
function loadIcons() {
for (let i = 0; i < icons.length; ++i) {
let tmpSprite = new Image();
tmpSprite.onload = function() {
this.isLoaded = true;
};
tmpSprite.src = "./../img/icons/" + icons[i] + ".png";
iconSprites[icons[i]] = tmpSprite;
}
for (let i = 0; i < crossHairs.length; ++i) {
let tmpSprite = new Image();
tmpSprite.onload = function () {
this.isLoaded = true;
};
tmpSprite.src = crossHairs[i];
crossHairSprites[i] = tmpSprite;
}
}
loadIcons();
function drawAutoPushWayPoints(ctx, xOffset, yOffset) {
if(my.autoPush) {
ctx.beginPath();
ctx.lineWidth = 3;
ctx.strokeStyle = "#FFFFFF";
ctx.lineTo(alignPosition.x - xOffset, alignPosition.y -
yOffset);
//ctx.lineTo(my.pushData.x2 - xOffset, my.pushData.y2 -
yOffset);
//ctx.lineTo(my.pushData.x - xOffset, my.pushData.y - yOffset);
ctx.lineTo(pushPosition.x - xOffset, pushPosition.y - yOffset);
ctx.stroke();
}
}
// UPDATE GAME:
function updateGame() {
if (config.resetRender) {
mainContext.clearRect(0, 0, gameCanvas.width,
gameCanvas.height);
mainContext.beginPath();
}
if (true) {
// MOVE CAMERA:
if (player) {
if (false) {
camX = player.x;
camY = player.y;
} else {
let tmpDist = UTILS.getDistance(camX, camY, player.x,
player.y);
let tmpDir = UTILS.getDirection(player.x, player.y,
camX, camY);
let camSpd = Math.min(tmpDist * 0.01 * delta, tmpDist);
if (tmpDist > 0.05) {
camX += camSpd * Math.cos(tmpDir);
camY += camSpd * Math.sin(tmpDir);
} else {
camX = player.x;
camY = player.y;
}
}
} else {
camX = config.mapScale / 2;
camY = config.mapScale / 2;
}
if (player) {
if (false) {
camX = player.x;
camY = player.y;
} else {
let tmpDist = UTILS.getDistance(camX, camY, player.x,
player.y);
let tmpDir = UTILS.getDirection(player.x, player.y,
camX, camY);
let camSpd = Math.min(tmpDist * 0.01 * delta, tmpDist);
if (tmpDist > 0.05) {
camX += camSpd * Math.cos(tmpDir);
camY += camSpd * Math.sin(tmpDir);
} else {
camX = player.x;
camY = player.y;
}
}
} else {
camX = config.mapScale / 2;
camY = config.mapScale / 2;
}
// RENDER CORDS:
let xOffset = camX - (maxScreenWidth / 2);
let yOffset = camY - (maxScreenHeight / 2);
// RENDER BACKGROUND:
if (config.snowBiomeTop - yOffset <= 0 && config.mapScale -
config.snowBiomeTop - yOffset >= maxScreenHeight) {
mainContext.fillStyle = "#b6db66";
mainContext.fillRect(0, 0, maxScreenWidth,
maxScreenHeight);
} else if (config.mapScale - config.snowBiomeTop - yOffset <=
0) {
mainContext.fillStyle = "#dbc666";
mainContext.fillRect(0, 0, maxScreenWidth,
maxScreenHeight);
} else if (config.snowBiomeTop - yOffset >= maxScreenHeight) {
mainContext.fillStyle = "#fff";
mainContext.fillRect(0, 0, maxScreenWidth,
maxScreenHeight);
} else if (config.snowBiomeTop - yOffset >= 0) {
mainContext.fillStyle = "#fff";
mainContext.fillRect(0, 0, maxScreenWidth,
config.snowBiomeTop - yOffset);
mainContext.fillStyle = "#b6db66";
mainContext.fillRect(0, config.snowBiomeTop - yOffset,
maxScreenWidth,
maxScreenHeight - (config.snowBiomeTop
- yOffset));
} else {
mainContext.fillStyle = "#b6db66";
mainContext.fillRect(0, 0, maxScreenWidth,
(config.mapScale - config.snowBiomeTop
- yOffset));
mainContext.fillStyle = "#dbc666";
mainContext.fillRect(0, (config.mapScale -
config.snowBiomeTop - yOffset), maxScreenWidth,
maxScreenHeight - (config.mapScale -
config.snowBiomeTop - yOffset));
}
if (getEl("visualType").value != "smp16") {
// RENDER GRID:
mainContext.lineWidth = 4;
mainContext.strokeStyle = "#000";
mainContext.globalAlpha = 0.06;
mainContext.beginPath();
for (let x = -camX; x < maxScreenWidth; x += useWasd ? 60 :
60) {
if (x > 0) {
mainContext.moveTo(x, 0);
mainContext.lineTo(x, maxScreenHeight);
}
}
for (let y = -camY; y < maxScreenHeight; y += useWasd ?
60 : 60) {
if (y > 0) {
mainContext.moveTo(0, y);
mainContext.lineTo(maxScreenWidth, y);
}
}
mainContext.stroke();
}
if (player) {
// DEATH LOCATION:
if (lastDeath) {
mainContext.globalAlpha = 1;
mainContext.fillStyle = "#fc5553";
mainContext.font = "100px Hammersmith One";
mainContext.textBaseline = "middle";
mainContext.textAlign = "center";
mainContext.fillText("x", lastDeath.x - xOffset,
lastDeath.y - yOffset);
}
// PATHFINDER LINE:
if (pathFind.active) {
if (pathFind.array && (pathFind.chaseNear ?
enemy.length : true)) {
mainContext.lineWidth = 10;
mainContext.globalAlpha = 1;
mainContext.strokeStyle = "black";
mainContext.beginPath();
pathFind.array.forEach((path, i) => {
let pathXY = {
x: (pathFind.scale / pathFind.grid) *
path.x,
y: (pathFind.scale / pathFind.grid) *
path.y
}
let render = {
x: ((player.x2 - (pathFind.scale / 2)) +
pathXY.x) - xOffset,
y: ((player.y2 - (pathFind.scale / 2)) +
pathXY.y) - yOffset
}
if (i == 0) {
mainContext.moveTo(render.x, render.y);
} else {
mainContext.lineTo(render.x, render.y);
}
});
mainContext.stroke();
}
}
}
// SHAME COUNT:
// RENDER PROJECTILES:
mainContext.globalAlpha = 1;
mainContext.lineWidth = outlineWidth;
renderProjectiles(0, xOffset, yOffset);
// RENDER PLAYERS:
renderPlayers(xOffset, yOffset, 0);
// RENDER AI:
mainContext.globalAlpha = 1;
for (let i = 0; i < ais.length; ++i) {
tmpObj = ais[i];
if (tmpObj.active && tmpObj.visible) {
tmpObj.animate(delta);
mainContext.save();
mainContext.translate(tmpObj.x - xOffset, tmpObj.y -
yOffset);
mainContext.rotate(tmpObj.dir + tmpObj.dirPlus -
(Math.PI / 2));
renderAI(tmpObj, mainContext);
mainContext.restore();
}
}
// MAP BOUNDARIES:
mainContext.fillStyle = "#000";
mainContext.globalAlpha = 0.09;
if (xOffset <= 0) {
mainContext.fillRect(0, 0, -xOffset, maxScreenHeight);
} if (config.mapScale - xOffset <= maxScreenWidth) {
let tmpY = Math.max(0, -yOffset);
mainContext.fillRect(config.mapScale - xOffset, tmpY,
maxScreenWidth - (config.mapScale - xOffset), maxScreenHeight - tmpY);
} if (yOffset <= 0) {
mainContext.fillRect(-xOffset, 0, maxScreenWidth + xOffset,
-yOffset);
} if (config.mapScale - yOffset <= maxScreenHeight) {
let tmpX = Math.max(0, -xOffset);
let tmpMin = 0;
if (config.mapScale - xOffset <= maxScreenWidth)
tmpMin = maxScreenWidth - (config.mapScale - xOffset);
mainContext.fillRect(tmpX, config.mapScale - yOffset,
(maxScreenWidth - tmpX) - tmpMin,
maxScreenHeight - (config.mapScale - yOffset));
}
mainContext.drawImage((tmpObj.backupNobull ? crossHairSprites[1] :
crossHairSprites[0]), tmpObj.x - xOffset - tmpS / 2, tmpObj.y - yOffset - tmpS / 2,
tmpS, tmpS);
// HEALTH HOLDER:
mainContext.fillStyle = darkOutlineColor;
mainContext.roundRect(tmpObj.x - xOffset -
config.healthBarWidth - config.healthBarPad,
(tmpObj.y - yOffset +
tmpObj.scale) + config.nameY, (config.healthBarWidth * 2) +
(config.healthBarPad
* 2), 17, 8);
mainContext.fill();
// HEALTH BAR:
mainContext.fillStyle = (tmpObj==player||
hpbar? "":(tmpObj.team&&tmpObj.team==player.team))?"#aaf0c9":"#cc5151";
mainContext.roundRect(tmpObj.x - xOffset -
config.healthBarWidth,
(tmpObj.y - yOffset +
tmpObj.scale) + config.nameY + config.healthBarPad,
if (tmpObj.isPlayer) {
mainContext.globalAlpha = 1;
if (getEl("visualType").value ==
"smp16") {
let reloads = {
primary: (tmpObj.primaryIndex
== undefined ? 1 : ((items.weapons[tmpObj.primaryIndex].speed -
tmpObj.reloads[tmpObj.primaryIndex]) / items.weapons[tmpObj.primaryIndex].speed)),
secondary:
(tmpObj.secondaryIndex == undefined ? 1 :
((items.weapons[tmpObj.secondaryIndex].speed -
tmpObj.reloads[tmpObj.secondaryIndex]) /
items.weapons[tmpObj.secondaryIndex].speed)),
turret: (2500 -
tmpObj.reloads[53]) / 2500
};
/*
// SECONDARY RELOAD HOLDER:
mainContext.fillStyle =
darkOutlineColor;
mainContext.roundRect(tmpObj.x -
xOffset - config.healthBarPad,
(tmpObj.y -
yOffset + tmpObj.scale) + config.nameY - 13, config.healthBarWidth +
(config.healthBarWidth * (tmpObj.reloads[tmpObj.primaryIndex] /
items.weapons[tmpObj.primaryIndex].speed)), 17 - config.healthBarPad * 2, 7);
mainContext.fill();
}
if (tmpObj.secondaryIndex ==
undefined ? false : (tmpObj.reloads[tmpObj.secondaryIndex] > 0)) {
// SECONDARY RELOAD BAR:
mainContext.roundRect(tmpObj.x -
xOffset + (config.healthBarWidth * ((items.weapons[tmpObj.secondaryIndex].speed -
tmpObj.reloads[tmpObj.secondaryIndex]) /
items.weapons[tmpObj.secondaryIndex].speed)),
(tmpObj.y -
yOffset + tmpObj.scale) + config.nameY + config.healthBarPad,
(config.healthBarWidth * (tmpObj.reloads[tmpObj.secondaryIndex] /
items.weapons[tmpObj.secondaryIndex].speed)), 17 - config.healthBarPad * 2, 7);
mainContext.fill();
}
if (tmpObj == player) {
/*
// TURRET RELOAD HOLDER:
mainContext.fillStyle =
darkOutlineColor;
mainContext.roundRect(tmpObj.x -
xOffset - config.healthBarWidth - config.healthBarPad,
(tmpObj.y -
yOffset + tmpObj.scale) + config.nameY + 13, (config.healthBarWidth * 2) +
// RENDER DIR:
if (tmpObj.dir != undefined) {
mainContext.fillStyle = "#fff";
mainContext.globalAlpha = 0.75;
renderCircle(tmpObj.x +
(Math.cos(tmpObj.dir) * items.weapons[player.weapons[0]].range) - xOffset, tmpObj.y
+ (Math.sin(tmpObj.dir) * items.weapons[player.weapons[0]].range) - yOffset, 5,
mainContext, true, false);
}
// UNDER TEXT:
if (tracerere) {
if (!tmpObj.isTeam(player)) {
let center = {
x: screenWidth / 2,
y: screenHeight / 2,
};
let alpha = Math.min(1,
(UTILS.getDistance(0, 0, player.x - tmpObj.x, (player.y - tmpObj.y) * (16 / 9)) *
100) / (config.maxScreenHeight / 2) / center.y);
let dist = center.y * alpha;
let tmpX = dist *
Math.cos(UTILS.getDirect(tmpObj, player, 0, 0));
let tmpY = dist *
Math.sin(UTILS.getDirect(tmpObj, player, 0, 0));
mainContext.save();
mainContext.translate((player.x
- xOffset) + tmpX, (player.y - yOffset) + tmpY);
mainContext.rotate(tmpObj.aim2
+ Math.PI / 2);
let renderTracer =
function(size, ctx) {
ctx = ctx || mainContext;
let crossSize = size * 0.5;
// Adjust proportion for cross size
let lineWidth = size * 0.1;
// Adjust proportion for line width
ctx.beginPath();
ctx.moveTo(-crossSize, 0);
ctx.lineTo(crossSize, 0);
ctx.moveTo(0, -crossSize);
ctx.lineTo(0, crossSize);
ctx.lineWidth = lineWidth;
ctx.strokeStyle =
`rgba(255, 255, 255, ${alpha})`; // Adjust color and alpha as needed
ctx.stroke();
};
renderTracer(25,
mainContext); // Adjust size as needed for the crosshair
mainContext.restore();
}
}
}}
}
if (shamed) {
mainContext.globalAlpha = 1;
mainContext.font = "21px Hammersmith One";
// Black-bordered outline
mainContext.shadowColor = "transparent"; //
Remove shadow
mainContext.lineWidth = 4; // Outline width
mainContext.strokeStyle = "black"; // Outline
color
mainContext.strokeText(tmpObj.shameCount,
tmpObj.x - xOffset, tmpObj.y - yOffset + tmpObj.scale + config.nameY + 5.5 * -2.2);
}
}
}
if (player) {
// AUTOPUSH LINE:
if (my.autoPush && pushline) {
if (getEl("PushStyle").value == "triangle"){
mainContext.lineWidth = 2;
mainContext.globalAlpha = 1;
mainContext.beginPath();
mainContext.strokeStyle = "yellow";
mainContext.moveTo(player.x - xOffset, player.y -
yOffset);
mainContext.lineTo(my.pushData.x - xOffset,
my.pushData.y - yOffset);
mainContext.lineTo(my.pushData.x2 - xOffset,
my.pushData.y2 - yOffset);
mainContext.closePath(); // Connect back to the
starting point
mainContext.stroke();
mainContext.beginPath();
mainContext.lineTo(x + rippleOffset, y +
rippleOffset);
}
mainContext.stroke();
} else {
if (getEl("PushStyle").value == "pluse"){
if (my.autoPush && pushline) {
mainContext.lineWidth = 2;
mainContext.globalAlpha = 1;
let pulseRadius = 10 +
Math.sin(Date.now() / 200) * 5; // Adjust pulse effect
mainContext.beginPath();
mainContext.strokeStyle = "black";
mainContext.arc((player.x +
my.pushData.x) / 2 - xOffset, (player.y + my.pushData.y) / 2 - yOffset,
pulseRadius, 0, 2 * Math.PI);
mainContext.stroke();
mainContext.beginPath();
mainContext.moveTo(player.x - xOffset,
player.y - yOffset);
mainContext.lineTo(my.pushData.x -
xOffset, my.pushData.y - yOffset);
mainContext.stroke();
mainContext.beginPath();
mainContext.arc(my.pushData.x -
xOffset, my.pushData.y - yOffset, pulseRadius, 0, 2 * Math.PI);
mainContext.stroke();
}
}
}
}
function drawArrowhead(ctx, fromX, fromY, toX, toY) {
// Arrowhead properties
let arrowSize = 10;
let angle = Math.atan2(toY - fromY, toX - fromX);
ctx.save();
ctx.translate(toX, toY);
ctx.rotate(angle);
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(-arrowSize, arrowSize / 2);
ctx.lineTo(-arrowSize, -arrowSize / 2);
ctx.closePath();
ctx.fill();
ctx.restore();
}
// FUNNY:
mainContext.globalAlpha = 1;
if (allChats.length) {
allChats.filter(ch => ch.active).forEach((ch) => {
if (!ch.alive) {
if (ch.alpha <= 1) {
ch.alpha += delta / 250;
if (ch.alpha >= 1) {
ch.alpha = 1;
ch.alive = true;
}
}
} else {
ch.alpha -= delta / 5000;
if (ch.alpha <= 0) {
ch.alpha = 0;
ch.active = false;
}
}
if (ch.active) {
mainContext.font = "21px Ubuntu";
let tmpSize = mainContext.measureText(ch.chat);
mainContext.textBaseline = "middle";
mainContext.textAlign = "center";
let tmpX = ch.x - xOffset;
let tmpY = ch.y - yOffset - 90;
let tmpH = 40;
let tmpW = tmpSize.width + 15;
mainContext.globalAlpha = ch.alpha;
mainContext.fillStyle = ch.owner.isTeam(player) ?
"#3877ff" : "#ff1f1f";
mainContext.strokeStyle = "rgb(25, 25, 25)";
mainContext.strokeText(ch.owner.name, tmpX, tmpY -
45);
mainContext.fillText(ch.owner.name, tmpX, tmpY -
45);
mainContext.lineWidth = 5;
mainContext.fillStyle = "#ccc";
mainContext.strokeStyle = "rgb(25, 25, 25)";
mainContext.fillStyle = "#fff";
mainContext.strokeStyle = "#000";
mainContext.strokeText(ch.chat, tmpX, tmpY);
mainContext.fillText(ch.chat, tmpX, tmpY);
ch.y -= delta / 100;
}
});
}
}
mainContext.globalAlpha = 1;
// RENDER MINIMAP:
renderMinimap(delta);
}
fpsTimer.last = timer;
fpsTimer.time = 0;
}
fpsTimer.time++;
function toggleUseless(boolean) {
getEl("instaType").disabled = boolean;
getEl("antiBullType").disabled = boolean;
getEl("predictType").disabled = boolean;
getEl("visualType").disabled = boolean;
}
toggleUseless(useWasd);
tmpCanvas.width*tmpMlt*tmpPad*config.iconPad,
tmpCanvas.height*tmpMlt*config.iconPad);
tmpContext.fillStyle = "rgba(0, 0, 70, 0.1)";
tmpContext.globalCompositeOperation = "source-
atop";
tmpContext.fillRect(-tmpCanvas.width / 2, -
tmpCanvas.height / 2, tmpCanvas.width, tmpCanvas.height);
getEl('actionBarItem' + i).style.backgroundImage =
"url(" + tmpCanvas.toDataURL() + ")";
};
tmpSprite.src = "./../img/weapons/" +
items.weapons[i].src + ".png";
let tmpUnit = getEl('actionBarItem' + i);
tmpUnit.onmouseover = UTILS.checkTrusted(function() {
showItemInfo(items.weapons[i], true);
});
tmpUnit.onclick = UTILS.checkTrusted(function() {
selectWeapon(tmpObj.weapons[items.weapons[i].type]);
});
UTILS.hookTouchEvents(tmpUnit);
} else {
let tmpSprite = getItemSprite(items.list[i-
items.weapons.length], true);
let tmpScale = Math.min(tmpCanvas.width -
config.iconPadding, tmpSprite.width);
tmpContext.globalAlpha = 1;
tmpContext.drawImage(tmpSprite, -tmpScale / 2, -
tmpScale / 2, tmpScale, tmpScale);
tmpContext.fillStyle = "rgba(0, 0, 70, 0.1)";
tmpContext.globalCompositeOperation = "source-atop";
tmpContext.fillRect(-tmpScale / 2, -tmpScale / 2,
tmpScale, tmpScale);
getEl('actionBarItem' + i).style.backgroundImage =
"url(" + tmpCanvas.toDataURL() + ")";
let tmpUnit = getEl('actionBarItem' + i);
tmpUnit.onmouseover = UTILS.checkTrusted(function() {
showItemInfo(items.list[i - items.weapons.length]);
});
tmpUnit.onclick = UTILS.checkTrusted(function() {
selectToBuild(tmpObj.items[tmpObj.getItemType(i -
items.weapons.length)]);
});
UTILS.hookTouchEvents(tmpUnit);
}
})(i);
}
};
window.profineTest = function(data) {
if (data) {
// SET INITIAL NAME:
let noname = "unknown";
// VALIDATE NAME:
let name = data + "";
name = name.slice(0, config.maxNameLength);
name = name.replace(/[^\w:\(\)\/? -]+/gmi, " "); // USE SPACE
SO WE CAN CHECK PROFANITY
name = name.replace(/[^\x00-\x7F]/g, " ");
name = name.trim();
let langFilter = {
"list": [
"ahole",
"anus",
"ash0le",
"ash0les",
"asholes",
"ass",
"Ass Monkey",
"Assface",
"assh0le",
"assh0lez",
"asshole",
"assholes",
"assholz",
"asswipe",
"azzhole",
"bassterds",
"bastard",
"bastards",
"bastardz",
"basterds",
"basterdz",
"Biatch",
"bitch",
"bitches",
"Blow Job",
"boffing",
"butthole",
"buttwipe",
"c0ck",
"c0cks",
"c0k",
"Carpet Muncher",
"cawk",
"cawks",
"Clit",
"cnts",
"cntz",
"cock",
"cockhead",
"cock-head",
"cocks",
"CockSucker",
"cock-sucker",
"crap",
"cum",
"cunt",
"cunts",
"cuntz",
"dick",
"dild0",
"dild0s",
"dildo",
"dildos",
"dilld0",
"dilld0s",
"dominatricks",
"dominatrics",
"dominatrix",
"dyke",
"enema",
"f u c k",
"f u c k e r",
"fag",
"fag1t",
"faget",
"fagg1t",
"faggit",
"faggot",
"fagg0t",
"fagit",
"fags",
"fagz",
"faig",
"faigs",
"fart",
"flipping the bird",
"fuck",
"fucker",
"fuckin",
"fucking",
"fucks",
"Fudge Packer",
"fuk",
"Fukah",
"Fuken",
"fuker",
"Fukin",
"Fukk",
"Fukkah",
"Fukken",
"Fukker",
"Fukkin",
"g00k",
"God-damned",
"h00r",
"h0ar",
"h0re",
"hells",
"hoar",
"hoor",
"hoore",
"jackoff",
"jap",
"japs",
"jerk-off",
"jisim",
"jiss",
"jizm",
"jizz",
"knob",
"knobs",
"knobz",
"kunt",
"kunts",
"kuntz",
"Lezzian",
"Lipshits",
"Lipshitz",
"masochist",
"masokist",
"massterbait",
"masstrbait",
"masstrbate",
"masterbaiter",
"masterbate",
"masterbates",
"Motha Fucker",
"Motha Fuker",
"Motha Fukkah",
"Motha Fukker",
"Mother Fucker",
"Mother Fukah",
"Mother Fuker",
"Mother Fukkah",
"Mother Fukker",
"mother-fucker",
"Mutha Fucker",
"Mutha Fukah",
"Mutha Fuker",
"Mutha Fukkah",
"Mutha Fukker",
"n1gr",
"nastt",
"nigger;",
"nigur;",
"niiger;",
"niigr;",
"orafis",
"orgasim;",
"orgasm",
"orgasum",
"oriface",
"orifice",
"orifiss",
"packi",
"packie",
"packy",
"paki",
"pakie",
"paky",
"pecker",
"peeenus",
"peeenusss",
"peenus",
"peinus",
"pen1s",
"penas",
"penis",
"penis-breath",
"penus",
"penuus",
"Phuc",
"Phuck",
"Phuk",
"Phuker",
"Phukker",
"polac",
"polack",
"polak",
"Poonani",
"pr1c",
"pr1ck",
"pr1k",
"pusse",
"pussee",
"pussy",
"puuke",
"puuker",
"queer",
"queers",
"queerz",
"qweers",
"qweerz",
"qweir",
"recktum",
"rectum",
"retard",
"sadist",
"scank",
"schlong",
"screwing",
"semen",
"sex",
"sexy",
"Sh!t",
"sh1t",
"sh1ter",
"sh1ts",
"sh1tter",
"sh1tz",
"shit",
"shits",
"shitter",
"Shitty",
"Shity",
"shitz",
"Shyt",
"Shyte",
"Shytty",
"Shyty",
"skanck",
"skank",
"skankee",
"skankey",
"skanks",
"Skanky",
"slag",
"slut",
"sluts",
"Slutty",
"slutz",
"son-of-a-bitch",
"tit",
"turd",
"va1jina",
"vag1na",
"vagiina",
"vagina",
"vaj1na",
"vajina",
"vullva",
"vulva",
"w0p",
"wh00r",
"wh0re",
"whore",
"xrated",
"xxx",
"b!+ch",
"bitch",
"blowjob",
"clit",
"arschloch",
"fuck",
"shit",
"ass",
"asshole",
"b!tch",
"b17ch",
"b1tch",
"bastard",
"bi+ch",
"boiolas",
"buceta",
"c0ck",
"cawk",
"chink",
"cipa",
"clits",
"cock",
"cum",
"cunt",
"dildo",
"dirsa",
"ejakulate",
"fatass",
"fcuk",
"fuk",
"fux0r",
"hoer",
"hore",
"jism",
"kawk",
"l3itch",
"l3i+ch",
"lesbian",
"masturbate",
"masterbat*",
"masterbat3",
"motherfucker",
"s.o.b.",
"mofo",
"nazi",
"nigga",
"nigger",
"nutsack",
"phuck",
"pimpis",
"pusse",
"pussy",
"scrotum",
"sh!t",
"shemale",
"shi+",
"sh!+",
"slut",
"smut",
"teets",
"tits",
"boobs",
"b00bs",
"teez",
"testical",
"testicle",
"titt",
"w00se",
"jackoff",
"wank",
"whoar",
"whore",
"*damn",
"*dyke",
"*fuck*",
"*shit*",
"@$$",
"amcik",
"andskota",
"arse*",
"assrammer",
"ayir",
"bi7ch",
"bitch*",
"bollock*",
"breasts",
"butt-pirate",
"cabron",
"cazzo",
"chraa",
"chuj",
"Cock*",
"cunt*",
"d4mn",
"daygo",
"dego",
"dick*",
"dike*",
"dupa",
"dziwka",
"ejackulate",
"Ekrem*",
"Ekto",
"enculer",
"faen",
"fag*",
"fanculo",
"fanny",
"feces",
"feg",
"Felcher",
"ficken",
"fitt*",
"Flikker",
"foreskin",
"Fotze",
"Fu(*",
"fuk*",
"futkretzn",
"gook",
"guiena",
"h0r",
"h4x0r",
"hell",
"helvete",
"hoer*",
"honkey",
"Huevon",
"hui",
"injun",
"jizz",
"kanker*",
"kike",
"klootzak",
"kraut",
"knulle",
"kuk",
"kuksuger",
"Kurac",
"kurwa",
"kusi*",
"kyrpa*",
"lesbo",
"mamhoon",
"masturbat*",
"merd*",
"mibun",
"monkleigh",
"mouliewop",
"muie",
"mulkku",
"muschi",
"nazis",
"nepesaurio",
"nigger*",
"orospu",
"paska*",
"perse",
"picka",
"pierdol*",
"pillu*",
"pimmel",
"piss*",
"pizda",
"poontsee",
"poop",
"porn",
"p0rn",
"pr0n",
"preteen",
"pula",
"pule",
"puta",
"puto",
"qahbeh",
"queef*",
"rautenberg",
"schaffer",
"scheiss*",
"schlampe",
"schmuck",
"screw",
"sh!t*",
"sharmuta",
"sharmute",
"shipal",
"shiz",
"skribz",
"skurwysyn",
"sphencter",
"spic",
"spierdalaj",
"splooge",
"suka",
"b00b*",
"testicle*",
"titt*",
"twat",
"vittu",
"wank*",
"wetback*",
"wichser",
"wop*",
"yed",
"zabourah",
"4r5e",
"5h1t",
"5hit",
"a55",
"anal",
"anus",
"ar5e",
"arrse",
"arse",
"ass",
"ass-fucker",
"asses",
"assfucker",
"assfukka",
"asshole",
"assholes",
"asswhole",
"a_s_s",
"b!tch",
"b00bs",
"b17ch",
"b1tch",
"ballbag",
"balls",
"ballsack",
"bastard",
"beastial",
"beastiality",
"bellend",
"bestial",
"bestiality",
"bi+ch",
"biatch",
"bitch",
"bitcher",
"bitchers",
"bitches",
"bitchin",
"bitching",
"bloody",
"blow job",
"blowjob",
"blowjobs",
"boiolas",
"bollock",
"bollok",
"boner",
"boob",
"boobs",
"booobs",
"boooobs",
"booooobs",
"booooooobs",
"breasts",
"buceta",
"bugger",
"bum",
"bunny fucker",
"butt",
"butthole",
"buttmuch",
"buttplug",
"c0ck",
"c0cksucker",
"carpet muncher",
"cawk",
"chink",
"cipa",
"cl1t",
"clit",
"clitoris",
"clits",
"cnut",
"cock",
"cock-sucker",
"cockface",
"cockhead",
"cockmunch",
"cockmuncher",
"cocks",
"cocksuck",
"cocksucked",
"cocksucker",
"cocksucking",
"cocksucks",
"cocksuka",
"cocksukka",
"cok",
"cokmuncher",
"coksucka",
"coon",
"cox",
"crap",
"cum",
"cummer",
"cumming",
"cums",
"cumshot",
"cunilingus",
"cunillingus",
"cunnilingus",
"cunt",
"cuntlick",
"cuntlicker",
"cuntlicking",
"cunts",
"cyalis",
"cyberfuc",
"cyberfuck",
"cyberfucked",
"cyberfucker",
"cyberfuckers",
"cyberfucking",
"d1ck",
"damn",
"dick",
"dickhead",
"dildo",
"dildos",
"dink",
"dinks",
"dirsa",
"dlck",
"dog-fucker",
"doggin",
"dogging",
"donkeyribber",
"doosh",
"duche",
"dyke",
"ejaculate",
"ejaculated",
"ejaculates",
"ejaculating",
"ejaculatings",
"ejaculation",
"ejakulate",
"f u c k",
"f u c k e r",
"f4nny",
"fag",
"fagging",
"faggitt",
"faggot",
"faggs",
"fagot",
"fagots",
"fags",
"fanny",
"fannyflaps",
"fannyfucker",
"fanyy",
"fatass",
"fcuk",
"fcuker",
"fcuking",
"feck",
"fecker",
"felching",
"fellate",
"fellatio",
"fingerfuck",
"fingerfucked",
"fingerfucker",
"fingerfuckers",
"fingerfucking",
"fingerfucks",
"fistfuck",
"fistfucked",
"fistfucker",
"fistfuckers",
"fistfucking",
"fistfuckings",
"fistfucks",
"flange",
"fook",
"fooker",
"fuck",
"fucka",
"fucked",
"fucker",
"fuckers",
"fuckhead",
"fuckheads",
"fuckin",
"fucking",
"fuckings",
"fuckingshitmotherfucker",
"fuckme",
"fucks",
"fuckwhit",
"fuckwit",
"fudge packer",
"fudgepacker",
"fuk",
"fuker",
"fukker",
"fukkin",
"fuks",
"fukwhit",
"fukwit",
"fux",
"fux0r",
"f_u_c_k",
"gangbang",
"gangbanged",
"gangbangs",
"gaylord",
"gaysex",
"goatse",
"God",
"god-dam",
"god-damned",
"goddamn",
"goddamned",
"hardcoresex",
"hell",
"heshe",
"hoar",
"hoare",
"hoer",
"homo",
"hore",
"horniest",
"horny",
"hotsex",
"jack-off",
"jackoff",
"jap",
"jerk-off",
"jism",
"jiz",
"jizm",
"jizz",
"kawk",
"knob",
"knobead",
"knobed",
"knobend",
"knobhead",
"knobjocky",
"knobjokey",
"kock",
"kondum",
"kondums",
"kum",
"kummer",
"kumming",
"kums",
"kunilingus",
"l3i+ch",
"l3itch",
"labia",
"lust",
"lusting",
"m0f0",
"m0fo",
"m45terbate",
"ma5terb8",
"ma5terbate",
"masochist",
"master-bate",
"masterb8",
"masterbat*",
"masterbat3",
"masterbate",
"masterbation",
"masterbations",
"masturbate",
"mo-fo",
"mof0",
"mofo",
"mothafuck",
"mothafucka",
"mothafuckas",
"mothafuckaz",
"mothafucked",
"mothafucker",
"mothafuckers",
"mothafuckin",
"mothafucking",
"mothafuckings",
"mothafucks",
"mother fucker",
"motherfuck",
"motherfucked",
"motherfucker",
"motherfuckers",
"motherfuckin",
"motherfucking",
"motherfuckings",
"motherfuckka",
"motherfucks",
"muff",
"mutha",
"muthafecker",
"muthafuckker",
"muther",
"mutherfucker",
"n1gga",
"n1gger",
"nazi",
"nigg3r",
"nigg4h",
"nigga",
"niggah",
"niggas",
"niggaz",
"nigger",
"niggers",
"nob",
"nob jokey",
"nobhead",
"nobjocky",
"nobjokey",
"numbnuts",
"nutsack",
"orgasim",
"orgasims",
"orgasm",
"orgasms",
"p0rn",
"pawn",
"pecker",
"penis",
"penisfucker",
"phonesex",
"phuck",
"phuk",
"phuked",
"phuking",
"phukked",
"phukking",
"phuks",
"phuq",
"pigfucker",
"pimpis",
"piss",
"pissed",
"pisser",
"pissers",
"pisses",
"pissflaps",
"pissin",
"pissing",
"pissoff",
"poop",
"porn",
"porno",
"pornography",
"pornos",
"prick",
"pricks",
"pron",
"pube",
"pusse",
"pussi",
"pussies",
"pussy",
"pussys",
"rectum",
"retard",
"rimjaw",
"rimming",
"s hit",
"s.o.b.",
"sadist",
"schlong",
"screwing",
"scroat",
"scrote",
"scrotum",
"semen",
"sex",
"sh!+",
"sh!t",
"sh1t",
"shag",
"shagger",
"shaggin",
"shagging",
"shemale",
"shi+",
"shit",
"shitdick",
"shite",
"shited",
"shitey",
"shitfuck",
"shitfull",
"shithead",
"shiting",
"shitings",
"shits",
"shitted",
"shitter",
"shitters",
"shitting",
"shittings",
"shitty",
"skank",
"slut",
"sluts",
"smegma",
"smut",
"snatch",
"son-of-a-bitch",
"spac",
"spunk",
"s_h_i_t",
"t1tt1e5",
"t1tties",
"teets",
"teez",
"testical",
"testicle",
"tit",
"titfuck",
"tits",
"titt",
"tittie5",
"tittiefucker",
"titties",
"tittyfuck",
"tittywank",
"titwank",
"tosser",
"turd",
"tw4t",
"twat",
"twathead",
"twatty",
"twunt",
"twunter",
"v14gra",
"v1gra",
"vagina",
"viagra",
"vulva",
"w00se",
"wang",
"wank",
"wanker",
"wanky",
"whoar",
"whore",
"willies",
"willy",
"xrated",
"xxx",
"jew",
"black",
"baby",
"child",
"white",
"porn",
"pedo",
"trump",
"clinton",
"hitler",
"nazi",
"gay",
"pride",
"sex",
"pleasure",
"touch",
"poo",
"kids",
"rape",
"white power",
"nigga",
"nig nog",
"doggy",
"rapist",
"boner",
"nigger",
"nigg",
"finger",
"nogger",
"nagger",
"nig",
"fag",
"gai",
"pole",
"stripper",
"penis",
"vagina",
"pussy",
"nazi",
"hitler",
"stalin",
"burn",
"chamber",
"cock",
"peen",
"dick",
"spick",
"nieger",
"die",
"satan",
"n|ig",
"nlg",
"cunt",
"c0ck",
"fag",
"lick",
"condom",
"anal",
"shit",
"phile",
"little",
"kids",
"free KR",
"tiny",
"sidney",
"ass",
"kill",
".io",
"(dot)",
"[dot]",
"mini",
"whiore",
"whore",
"faggot",
"github",
"1337",
"666",
"satan",
"senpa",
"discord",
"d1scord",
"mistik",
".io",
"senpa.io",
"sidney",
"sid",
"senpaio",
"vries",
"asa"
],
"exclude": [],
"placeHolder": "*",
"regex": {},
"replaceRegex": {}
};
return noname;
}
};
window.toggleNight();
},
webgl_test: () => {
return;
let canvas = document.createElement("canvas");
canvas.id = "WEBGL";
canvas.width = canvas.height = 300;
canvas.style = `
position: relative;
bottom: 70%;
left: 70%;
pointer-events: none;
`;
document.body.append(canvas);
document.body.append(fat);
log(gl);
gl.clearColor(0, 0, 0, 0.2);
gl.clear(gl.COLOR_BUFFER_BIT);
function hexToRgb(hex) {
return hex.slice(1).match(/.{1,2}/g).map(g => parseInt(g, 16));
}
function getRgb(r, g, b) {
return [r / 255, g / 255, b / 255].join(", ");
}