// ==UserScript==
// @name Project X v8 Test
// @match *://*.moomoo.io/*
// @match https://moomoo.io
// @run-at document_idle
// @author Ha Thu :3
// @grant none
// @icon none
// @version 8
// @description enjoy all :3
// @namespace https://greasyfork.org/users/1258025
// @downloadURL https://update.greasyfork.icu/scripts/497072/Project%20X%20v8%20Test.user.js
// @updateURL https://update.greasyfork.icu/scripts/497072/Project%20X%20v8%20Test.meta.js
// ==/UserScript==
document.getElementById('gameName').innerHTML = 'Hii Chan';
setTimeout(() => {
document.getElementById('gameName').innerHTML = 'Welcome';
setTimeout(() => {
document.getElementById('gameName').innerHTML = 'Onichan~~';
setTimeout(() => {
document.getElementById('gameName').innerHTML = 'I Love You Chan';
setTimeout(() => {
document.getElementById('gameName').innerHTML = 'ʚ♡ɞ';
setTimeout(() => {
}, 9000);
}, 12000);
}, 1500);
}, 1200);
}, 1200);
if (typeof GM_addStyle != "undefined") {
GM_addStyle(styleItem);
} else {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(styleItem));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
heads[0].appendChild(node);
} else {
document.documentElement.appendChild(node);
}
}
(function() {
let shadowRadius = 50;
let shadowDirection = 1;
let canShadow = true;
setInterval(() => {
if (canShadow == true) {
shadowRadius = (shadowDirection == 1) ? shadowRadius - 5 : shadowRadius + 5;
if (shadowRadius >= 50 || shadowRadius <= 0) {
shadowDirection = (shadowRadius >= 50) ? 1 : (shadowRadius <= 0) ? 0 : null;
canShadow = false;
setTimeout(() => {
canShadow = true;
}, 100);
}
}
// Đặt màu đỏ cho shadow //red nhe :)
let red = Math.floor(Math.random() * 256);
let green = 0;
let blue = 0;
document.getElementById("gameName").style.textShadow = `0px 0px ${shadowRadius + 20}px rgba(${red},${green},${blue},1)`;
}, 100);
})();
//document.getElementById("mainMenu").style.backgroundImage = "url('https://media1.tenor.com/m/dpX8CAec-Y4AAAAC/cute-surprised.gif')";//https://i.gifer.com/GmUB.gif
document.getElementById("mainMenu").style.backgroundImage = "url('https://files.123freevectors.com/wp-content/original/109789-pink-heart.jpg')";//https://i.gifer.com/TVRV.gif
//https://www.hdwallpapers.in/download/anime_girl_4k_3-HD.jpg //https://wallpapercave.com/wp/wp5299847.jpg
//document.getElementById("mainMenu").style.backgroundSize = "cover"; // Ensure the background covers the entire element
//document.getElementById("mainMenu").style.backgroundPosition = "center"; // Position the background image at the center
document.getElementById("mainMenu").style.width = "100%";
document.getElementById("mainMenu").style.height = "100vh";
document.getElementById("gameName").style.color = "#FFC0CB";
document.getElementById("loadingText").innerText="";
document.getElementById('enterGame').innerHTML = 'play';
document.getElementById('nameInput').placeholder = '';
$('.menuCard').css({'background-color': 'transparent',
'border': '2px solid white',
'border-radius': '10px'});
/*$('#nameInput').css({'border-radius': '0px',
'-moz-border-radius': '0px',
'-webkit-border-radius': '0px',
'border': 'hidden'});*/
var getElement = document.querySelector('#enterGame');
getElement.style.backgroundColor = "transparent";
getElement.style.color = "#fff";
var getElement2 = document.querySelector('#nameInput');
getElement2.style.backgroundColor = "transparent";
getElement2.style.color = "#fff";
var uwu = document.getElementById("foodDisplay")
var da = document.getElementById("woodDisplay")
var das = document.getElementById("stoneDisplay")
var dsa = document.getElementById("killCounter")
var ds312a = document.getElementById("scoreDisplay")
var ds3122a = document.getElementById("leaderboard")
var elements = [uwu, da, das, dsa, ds312a, ds3122a];
elements.forEach(function(element) {
element.style.fontFamily = 'Times New Roman';
});
let founda = false;
let scriptTags = document.getElementsByTagName("script");
for (let i = 0; i < scriptTags.length; i++) {
if (scriptTags[i].src.includes("index-f3a4c1ad.js") && !founda) {
scriptTags[i].remove();
founda = true;
break;
}
}
document.addEventListener("keydown", function(event) {
if (event.keyCode === 45) {
const chatHolder = document.getElementById("gameUI");
if (chatHolder) {
const currentDisplay = chatHolder.style.display;
chatHolder.style.display = currentDisplay === "none" ? "block" : "none";
}
}
});
var styleItem = document.createElement("style");
styleItem.type = "text/css";
styleItem.appendChild(document.createTextNode(`
#suggestBox {
width: 355px;
border-radius: 3px;
background-color: rgba(0,0,0,0.5);
margin: auto;
text-align: left;
z-index: 49;
pointer-events: auto;
position: relative;
bottom: 3.5px;
overflow-y: auto;
}
#suggestBox div {
background-color: rgba(255,255,255,0);
color: rgba(255,255,255,1);
transition: background-color 0.3s, color 0.3s;
}
#suggestBox div:hover {
background-color: rgba(255,255,255,0.2);
color: rgba(0,0,0,1);
}
.suggestBoxHard {
color: rgba(255,255,255,1);
font-size: 18px;
}
.suggestBoxLight {
color: rgba(255,255,255,0.7);
font-size: 18px;
}
`));
document.head.appendChild(styleItem);
window.addEventListener('load', function() {
var allianceButton = document.getElementById('allianceButton');
var storeButton = document.getElementById('storeButton');
if (storeButton) {
storeButton.style.right = '26px';
storeButton.style.top = '420px';
}
if (allianceButton) {
allianceButton.style.right = '26px';
allianceButton.style.top = '479px';
}
});
function getEl(id) {
return document.getElementById(id);
}
let shotings = false
let autoaims = true
let nearenemy
// MUSIC TOP 1 VN
const song1 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223268002276048966/Phong_Max_-_Hoa_Co_Lau_Official_Music_Video_Chapter_1.mp3?ex=66193c1a&is=6606c71a&hm=e0fc9df2d9d0fa2e603b864031787472561a512a4b18b00d3d24caabbabcee45&");
const song2 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1222915365290381353/Qua_Khu_Anh_Khong_The_Quen_RIN_Music_Remix_-_Duong_Minh_Tuan_Anh_Cu_Nghi_Tat_Ca_Yeu_Dau_Remix.mp3?ex=6617f3af&is=66057eaf&hm=a2953a2efdc5e6ce05051a509c32e43584c9c98bb1de7a9a22f11b2a5a2ee780&");
const song3 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222887622830194689/Quan_Son_Tuu_Remix_Music_Tik_Tok.mp3?ex=6617d9d9&is=660564d9&hm=af854410aff430fff3a0c5df63dce372435bdd611afde9e178a634bcf5de1cb2&");
const song4 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222890808659804231/Phao_-_2_Phut_Hon_KAIZ_Remix.mp3?ex=6617dcd0&is=660567d0&hm=bf27c3951fde4d576fe75ea0f00c3784a47d404807986dcade362ec452a09090&");
const song5 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222891281504665600/B_Ray_ft_AMEE_-_Exs_Hate_Me__Masew_Remix_.mp3?ex=6617dd41&is=66056841&hm=46f6c67d612a86547c2165c51e4cf68956101df553851fa243f943164cc3c0c8&");
const song6 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222891617728598077/ANDREE_RIGHT_HAND_-_CHOI_NHU_TUI_MY_REMIX_ft._wokeupat4am_x_kewtiie.mp3?ex=6617dd91&is=66056891&hm=098b59850f8910ede38c2dc0f917b06270e06fb713599fd534efea804264453d&");
const song7 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222894494026829844/Lu_Khach_Qua_Thoi_Gian_-_Gia_HuyLyrics_VideoMeens.mp3?ex=6617e03f&is=66056b3f&hm=d05803bae20274302d1f0264d607ec792ee98e08b45d068ebfb8372bdf75c951&");
const song8 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223151982534066187/GIO_-_JANK_OFFICIAL_MUSIC_VIDEO_VALENTINE_2023_1.mp3?ex=6618d00d&is=66065b0d&hm=b30c5de6a75043f14170e0b5a9f3803e7968c006cf15bcb90652c0ce8a71e736&");
const song9 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222898108736737351/ao_Nuong_Ciray_Remix_-_Hoang_Vuong_Gap_lai_co_ta_con_au_au_ro_them_mau_len_trang_tho_nhau....mp3?ex=6617e39d&is=66056e9d&hm=ee685b931cb803e96fdc3eed66ae16c857bd6349ede8dc58da8cbe13ff06ba77&");
const song10 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222900302756184135/Quy_Tam_-_ang_Thap_Ma_Quan_-_PBQA_remix.mp3?ex=6617e5a8&is=660570a8&hm=bf271c96c3368654674005136005f4024df30469df03324ddd44076cbeb47214&");
const song11 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222901823325732905/Hen_Yeu_-_Quang_Nhat_Remix_Nhac_Hot_Tik_Tok_Remix_Moi_Nhat_2024.mp3?ex=6617e713&is=66057213&hm=df44357eec291486cebbcf77a2dee4112a55cbadaf1fb68e52c0bc3dd800312f&");
const song12 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222902331150958684/YEU_THUONG_CHANG_LA_MAI_MAI_-_TRACY_REMIX_NHAC_REMIX_HOT_TIK_TOK_2024.mp3?ex=6617e78c&is=6605728c&hm=efe6f5e34c3ebb2fbe11a76ac4988ffa39688e8491fa74845041ee65150e1f6f&");
const song13 = new Audio("https://cdn.discordapp.com/attachments/992344982235119667/1222903243915661342/HAI_TU_YEU_VA_THUONG_KHO_QUA_-_YEU_VA_THUONG_KHO_QUA_REMIX_-_TINH_TA_HAI_NGA_VER_2_REMIX_HOT_TIKTOK.mp3?ex=6617e865&is=66057365&hm=ea7aa9625cbff7c50735c52f84b984549c790ccbd76b4ca566ccc6159014f826&");
const song14 = new Audio("https://cdn.discordapp.com/attachments/1192824356691255327/1222904296849408062/Yeu_Ban_Than_Remix_Huyen_Mie_-_Nhac_Tre_Remix_Hot_Trend_Tiktok.mp3?ex=6617e960&is=66057460&hm=4c54e0735d4dbaca4fa54a9aba12152c8e3a4d810ab58f2b2405a3bddf4c2bcd&");
const song15 = new Audio("https://cdn.discordapp.com/attachments/1192824356691255327/1222905409434550303/Co_Le_Ben_Nhau_La_Sai_Remix_-_thaolinh_ft_ViAM_Co_Lau_ai_Nhung_Chac_Gi_a_Tim_uoc_Chan_Ai.mp3?ex=6617ea6a&is=6605756a&hm=d7af2aadd2734d8a6c49722a3ea80cdfaaa9f5d918632e902285c413d8582403&");
const song16 = new Audio("https://cdn.discordapp.com/attachments/1192824356691255327/1222908599861383260/Central_Cee_-_Doja_Directed_by_Cole_Bennett.mp3?ex=6617ed62&is=66057862&hm=086c30583a1ba8e3b8e5759e5adf95a38696cf6606d7f61d765ad4d4e106573f&");
const song17 = new Audio("https://cdn.discordapp.com/attachments/1192824356691255327/1222909418862022786/Legend_Never_Die_x_Warriors_-_Mit_Remix_Nhac_Hot_Tik_Tok_Remix_Moi_Nhat_2023.mp3?ex=6617ee26&is=66057926&hm=8b01fc3bc826b16b4b426ea5d75ec150f3894a84af6d6be0ac454abb53dbd522&");
const song18 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1222911018435477594/Anh_Tu_-_MV_Hoang_Hon_Nho_Hoa_Vuong_OST.mp3?ex=6617efa3&is=66057aa3&hm=eb0acf6663de6d81681b1431416aaaa18ca477a44d5e0565b63f35621ce274f7&");
const song19 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1222911832675586078/BVLKY_-_DINHBAO_REMIX_NHAC_LOFI_CHILL_REMIX_HOT_TIK_TOK.mp3?ex=6617f065&is=66057b65&hm=73d298a46862f02360953a4b1f27b056230b0732e61028e39a35c44e6c7a5629&");
const song20 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1222914637754794004/Gods_Ft_NewJeans_THEREON_REMIX_Nhac_Hot_Tik_Tok_Viet_Nam_2023_Nhac_Danh_Cho_Faker.mp3?ex=6617f302&is=66057e02&hm=8b897c76bda376a8facc27d9b438151113b085d5aa9795a10e488c272de8ef93&");
const song21 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1222916381394075749/Wxrdie_-_TETVOVEN_ft._AndreeRightHand87__MachiotOfficial_OFFICIAL_MUSIC_VIDEO.mp3?ex=6617f4a2&is=66057fa2&hm=c7b6679a5b4dbfa4b53d0e25d51f562c0b21c1e3165240cdde9e6a7c7a463569&");
const song22 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223156312691703828/HNECR_ft_Thang_Hau_-_Quang_Nhat_Remix_Vi_ngay_hom_nay_em_cuoi_roi_....mp3?ex=6618d416&is=66065f16&hm=25041bb2369c44bcccd6c9ca09dd0c9cd139f114da0927f9952b84f4893df7b3&");
const song23 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223156935163908138/IN_DA_CLUB_-_DOUBLE_S_REMIX_NHAC_NAY_LA_NHAC_TREND.mp3?ex=6618d4aa&is=66065faa&hm=31f747f7b76a8a81454ac6db0d16bcb2c9a153f4f0b72f13e32c194e23a82319&");
const song24 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223158672654471260/Anh_So_Yeu_Remix_-_TungTray_Ft_Natra_DK_OFFICIAL_Sieu_Pham_Nhac_Go_Ver2_Cuc_Haydkofficial.mp3?ex=6618d648&is=66066148&hm=5d99605496d3a9b8dc04105b66049e76480d324780e297484fc731f84dc6d9f1&");
const song25 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223159772845576223/MY_LOVE_FT_TATU_-_THAI_HOANG_REMIX__EXCLUSIVE_MUSIC__NHAC_HOT_TREND_XU_HUONG_TIK_TOK_2023.mp3?ex=6618d74f&is=6606624f&hm=8146673526eaea19785c65d33630b07d29eac296e267651adf2107d3483aaea2&");
const song26 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223161662622793789/Y2meta.app_-_CALL_OF_SILENCE_x_FAKE_LOVE_-_MinhAk_Remix___Nhac_remix_hot_tiktok_Attack_On_Titan_320_kbps.mp3?ex=6618d911&is=66066411&hm=8f99b98df7a441a46851e5847528b84fda9cdb422ecad729f413e7a8dc9868fa&");
const song27 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223279245833277450/LONELY_-_NANA_if_BT_REMIX_-_NHAC_TOAN_MUI_MIKENCO.mp3?ex=66194693&is=6606d193&hm=84f8e743ac5824558712919cbefffe30ac6aa807c7649a88bf2bd0b0d0a5c5db&");
const song28 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223548182764716052/X2Download.app_-_Tung_Quen_AnhVu_Remix_-_Wren_Evans___Nhac_Tre_Remix_Hot_Tik_Tok_Moi_Nhat_2024_128_kbps.mp3?ex=661a410b&is=6607cc0b&hm=1d323f2ee8f94a39aa362756c5d6a8d63a1c25ab3099d9939e8a4da2232d748a&");
const song29 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223548533030916246/X2Download.app_-_Mien_Man_Thereon_Remix_-_Minh_Huy___Co_Thay_Nho_Anh_Khong_Tu_Khi_Lan_au_Remix_Hot_TikTok_128_kbps.mp3?ex=661a415e&is=6607cc5e&hm=46c67fabb60391b9509ff1a577009856493c4f1b9443bf56062ccead1a0e0f8b&");
const song30 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223548720566767676/X2Download.app_-_Gia_Nhu_Anh_La_Nguoi_Vo_Tam_x_Nhin_Em_Lan_Cuoi_-_Thereon_Remix___Nhac_Hot_Tik_Tok_Moi_Nhat_2023_128_kbps.mp3?ex=661a418b&is=6607cc8b&hm=8487c3e1fce0cd9b6e14aab2982d40e1a093714d16a4f59953b60c1a1c8f4677&");
const song31 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223549829494341713/X2Download.app_-_AY_BIEN_x_PHONG_DA_HANH_VER_2_-_VUHUYNH_REMIX_-_NHAC_HOT_TREND_CAPCUT-TIKTOK_2023_128_kbps.mp3?ex=661a4293&is=6607cd93&hm=aa0f8a561df7386aef69ffa963b3e0340c0bf84dd7b700e9a15fc8006a1b0816&");
const song32 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223549867604049951/Ngay_Tho_-_Phong_Max_feat_Tang_Duy_Tan_Phong_Max_remix_Vietnamese_Music.mp3?ex=661a429c&is=6607cd9c&hm=e7716e9b4764a4478a3185c7fded513cb6bffe8ec8a60edc0cccbe1711c14e21&");
const song33 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223550352817913956/X2Download.app_-_Nghi_i_Ma_Xem_Luc_Em_Vua_Truot_Nga_REMIX_Anh_Thuong_Em_Em_Thuong_Ai_REMIX_-_Be_Linh_Ca_Nhac_128_kbps.mp3?ex=661a4310&is=6607ce10&hm=d5ea3b171440b77a2a7f6ae7f255bac342cad0ee10cc8cf76a728027bc362edd&");
const song34 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223551154701733970/X2Download.app_-_ai_ien_Hau_Sinh_Tu__-_Vuong_Ngoc_Manh__-_Kien_Louis_Remix_Nhac_Nen_TikTok_128_kbps.mp3?ex=661a43cf&is=6607cecf&hm=0f2d8ddf01df903c9b2468e7c993c856aeaa41eb5b5f14d4d72b1c407ce90166&");
const song35 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223551904500682822/X2Download.app_-_THIEU_NIEN_HOA_HONG_-_SILVER_SMOKE_REMIX_VIOLIN_REMIX_2023_128_kbps.mp3?ex=661a4482&is=6607cf82&hm=1ad43a6c9cdfc8906ecd264267242f0795afc435d74d9fb030ba91241e3f9fa5&");
const song36 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223554103649763368/X2Download.app_-_BAT_VAN_BIET_LY_x_BALENCIAGA_-_JAPANDEE_x_THEREON_REMIX_128_kbps.mp3?ex=661a468e&is=6607d18e&hm=675f583aa9adc7d5722d3ba5e80644f28343ddf9c0d6c19f9fef60a7feb7a528&");
const song37 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223554895907520592/X2Download.app_-_WAY_BACK_-_KHOA_BT_FT_TUAN_HOANG_REMIX___Nhac_Hot_Tik_Tok_Remix_Moi_Nhat_2024_128_kbps.mp3?ex=661a474b&is=6607d24b&hm=4cd3244c13b58c2e6ff3d180419df8e2ea488805e05888ed331084e58c73f3c4&");
const song38 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223555625103921162/X2Download.app_-_Neu_Ngay_Ay_Remix_-_Soobin_Hoang_Son_Thanh_Phong_Remix___Hot_TikTok_2023_-_Audio_Lyrics_Video_128_kbps.mp3?ex=661a47f9&is=6607d2f9&hm=33741935de35a3fdb28a6da5347a7112efcc50dedcb702a4c5df5daef03b0bad&");
const song39 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223560745963487273/X2Download.app_-_Play_Date_ft._Sao_Anh_Chua_Ve_-_Quoc_Trung_Remix_VSTIDA_MUSIC___Nhac_Nen_Hot_Tik_Tok_Moi_Nhat_2024_128_kbps.mp3?ex=661a4cbe&is=6607d7be&hm=f7717a03d7828618ddd642c7eac21f21d2c522336af769c8f684dfb8fe6152c1&");
const song40 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223839314656362608/Kieu_Hoa_AIR_Remix_-_Bin_Con_Gi_Ma_Tinh_Em_Oi_Thoi_Len_Kieu_Hoa_Voi_Anh_Remix_Hot_TikTok.mp3?ex=661b502e&is=6608db2e&hm=469f23f9f5cb0d923c8e6d9a703d006441002cbc928309b90fadd47503691f7f&");
const song41 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223839780765171762/Trich_Tien_-_VuQuan_Remix_-_TikTok_Remix_TikTok.mp3?ex=661b509d&is=6608db9d&hm=108ed02650a0a185834f231bc6803f367b98699628fd2f9bfd3a3c88593c183d&");
const song42 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223840268072128512/She_Neva_Know_-_JustaTee_-__Quyen_Hai_Phong_Remix__Nhac_Hot_Tik_Tok_2022.mp3?ex=661b5111&is=6608dc11&hm=c0cafdc5c303cc11e9528a04ad7215ba736bec53623fde3f52f750cdcbeb9fee&");
const song43 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223840884077101119/Khong_Tim_Thay_loi_i_Remix_-_Quang_Nhat_Remix_Vi_Anh_a_Lua_Doi_Em....mp3?ex=661b51a4&is=6608dca4&hm=236b0e40eb56cf3ab0021dd236c517aad58df0cc9f26e2c1c0e62bc35256e3cf&");
const song44 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223842046977114122/Xin_Ma_Ruoc_Dau_PiPo_Remix_x_Dieu_Kien_Anh_Oi_Nang_Mua_Dai_Dau_Ve_Nha_Xin_Ma_Hot_Tik_Tok_2022.mp3?ex=661b52b9&is=6608ddb9&hm=34247af4174b0ed4e9ed06525384151854354d113e3fe128878667ad3c72035e&");
const song45 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1223842769550839859/Doi_Lua_Qinn_Remix_Nguyen_inh_Vu_-_Anh_ua_Tay_Ra_e_Co_Vuot_Ve_Khuon_Mat_Em_That_Xinh_ep_Remix.mp3?ex=661b5366&is=6608de66&hm=bc560180a0a4460fb878fb293a990d9241cac4b8dd09733408f10dfd148175ea&");
const song46 = new Audio("https://cdn.discordapp.com/attachments/943150398351499268/1223998974034313346/X2Download.app_-_Goi_Gon_Hoi_Uc_Trao_Cho_Anh_Remix_-_QTrung_Remix_-____Nhac_Hot_TikTok_Remix_Moi_Nhat_2024_128_kbps.mp3?ex=661be4e0&is=66096fe0&hm=a66b094d935d08c83f80de30dd5614ef19680c4c0a41e1841bd99dec21188448&");
const song47 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1224000006697254982/X2Download.app_-_Sieu_Pham_Nhac_Troi_Freed_From_Desire_-_QTrung_Remix____Nhac_Hot_TikTok_Moi_Nhat_2024_128_kbps.mp3?ex=661be5d6&is=660970d6&hm=dd574a74fb5b743d2d5635f3e77e4edaec8a917f8dbeb9d4b3d6ea8689c3eb22&");
const song48 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1224000279729672203/X2Download.app_-_Chiu_Cach_Minh_Noi_Thua_-_DUCBUI_x_FOXY_Remix._NHAC_NEN_HOT_TIKTOK_128_kbps.mp3?ex=661be617&is=66097117&hm=58b0d2ac35828a52287643a2e25efe1356a6b8647b9c86e6906943af65bfd344&");
const song49 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1224000663130865714/X2Download.app_-_Anh_La_Ai_Remix_DUCBUI___Huynh_Cong_Hieu_x_DT_x_Umie___Nhac_Rap_Viet_Hot_Tiktok_2023_128_kbps.mp3?ex=661be672&is=66097172&hm=5c77048b975a1f9d8e511fe9137e31aada3c831ed3e562c059c60aa1c852c9d2&");
const song50 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1224001091943796757/X2Download.app_-_NOI_TINH_YEU_KET_THUC_-_QUANG_NHAT_REMIX___LAC_MAT_LOI_LAM_SAO_TIM_NHAU_GIUA_MOT_TROI_TRANG_XOA_128_kbps.mp3?ex=661be6d9&is=660971d9&hm=db48c91a03c2dd13c8d0553bc775fb6690f1cac653269532586fd987fbd32c36&");
const song51 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1224001719080325170/X2Download.app_-_Tin_Tuong_La_Loi_Hua......_Hen_Mot_Mai_-_Ha_Anh_Tuan_Cinzee_Remix_haonguyenpro_128_kbps.mp3?ex=661be76e&is=6609726e&hm=73f2ec5b2d572d976780c951a91f8bea9222f3b0c5ed917d2252c801793f086d&");
const song52 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1224002079476023438/X2Download.app_-_E_DRILL_MOT_MINH_e_anh_mot_minh_drill_x_jersey_mix_-_DK_ft._Zenkey_128_kbps_1.mp3?ex=661be7c4&is=660972c4&hm=c8ba9642dfad95c39c04fe8cf4b90a7fc92b4a8f4436bba5165117d6f7b77b61&");
const song53 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1224002352202387508/X2Download.app_-_Richie_D._ICY__AXTROBOY_-_Rolling_Official_Music_Video_128_kbps.mp3?ex=661be805&is=66097305&hm=13df8158d8e78315bdd9823e98394a9aea2045875edc0a06073601058b77cbfb&");
const song54 = new Audio("https://cdn.discordapp.com/attachments/1193523060184186931/1224003129318572114/X2Download.app_-_Tan_Phai_-_LiL_Van__Video_Lyrics__128_kbps.mp3?ex=661be8be&is=660973be&hm=0dc2aff384ae12d9e1f8bc415c35c65fb5952c57df957e98c3539fd19a429781&");
let newFont = document.createElement("link");
newFont.rel = "stylesheet";
newFont.href = "https://fonts.googleapis.com/css?family=Ubuntu:700";
newFont.type = "text/css";
document.body.append(newFont);
let min = document.createElement("script");
min.src = "https://rawgit.com/kawanet/msgpack-lite/master/dist/msgpack.min.js";
document.body.append(min);
window.oncontextmenu = function() {
return false;
};
let config = window.config;
// CLIENT:
config.clientSendRate = 9; // Aim Packet Send Rate
config.serverUpdateRate = 9;
// UI:
config.deathFadeout = 0;
config.playerCapacity = 9999;
// CHECK IN SANDBOX:
config.isSandbox = window.location.hostname == "sandbox.moomoo.io";
// CUSTOMIZATION:
config.skinColors = ["#bf8f54", "#cbb091", "#896c4b",
"#fadadc", "#ececec", "#c37373", "#4c4c4c", "#ecaff7", "#738cc3",
"#8bc373", "#91b2db"
];
config.weaponVariants = [{
id: 0,
src: "",
xp: 0,
val: 1,
}, {
id: 1,
src: "_g",
xp: 3000,
val: 1.1,
}, {
id: 2,
src: "_d",
xp: 7000,
val: 1.18,
}, {
id: 3,
src: "_r",
poison: true,
xp: 12000,
val: 1.18,
}, {
id: 4,
src: "_e",
poison: true,
heal: true,
xp: 24000,
val: 1.18,
}];
// VISUAL:
config.anotherVisual = true;
config.useWebGl = false;
config.resetRender = true;
function waitTime(timeout) {
return new Promise((done) => {
setTimeout(() => {
done();
}, timeout);
});
}
let botSkts = [];
// 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 setCommands() {
return {
"help": {
desc: "Show Commands",
action: function(message) {
for (let cmds in commands) {
addMenuChText("/" + cmds, commands[cmds].desc, "lime", 1);
}
}
},
"clear": {
desc: "Clear Chats",
action: function(message) {
resetMenuChText();
}
},
"debug": {
desc: "Debug Mod For Development",
action: function(message) {
addDeadPlayer(player);
addMenuChText("Debug", "Done", "#99ee99", 1);
}
},
"play": {
desc: "Play Music ( /play [link] )",
action: function(message) {
let link = message.split(" ");
if (link[1]) {
let audio = new Audio(link[1]);
audio.play();
} else {
addMenuChText("Warn", "Enter Link ( /play [link] )", "#99ee99", 1);
}
}
},
"bye": {
desc: "Leave Game",
action: function(message) {
window.leave();
}
},
};
}
function setConfigs() {
return {
killChat: false,
autoBuy: true,
autoBuyEquip: true,
autoPush: true,
revTick: true,
spikeTick: true,
predictTick: true,
autoPlace: true,
autoReplace: true,
antiTrap: true,
slowOT: false,
attackDir: false,
noDir: false,
showDir: false,
autoRespawn: false,
treealpha: true,
smartantiinsta: false
};
}
let commands = setCommands();
let configs = setConfigs();
window.removeConfigs = function() {
for (let cF in configs) {
deleteVal(cF, configs[cF]);
}
};
for (let cF in configs) {
configs[cF] = gC(cF, configs[cF]);
}
// MENU FUNCTIONS:
window.changeMenu = function() {};
window.debug = 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() {};
// nah hahahahahhh why good ping
window.ping = 0;
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 = "Imagine playing this badass game XDDDDD";
this.summon = function(tmpObj) {
this.x2 = tmpObj.x;
this.y2 = tmpObj.y;
this.chat = tmpObj.name + " ur so bad XDDDD";
};
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) {
return "!c!dc user " + tmpObj.name;
};
}
};
class HtmlAction {
constructor(element) {
this.element = element;
};
add(code) {
if (!this.element) return undefined;
this.element.innerHTML += code;
};
newLine(amount) {
let result = `
`;
if (amount > 0) {
result = ``;
for (let i = 0; i < amount; i++) {
result += `
`;
}
}
this.add(result);
};
checkBox(setting) {
let newCheck = ``;
this.add(newCheck);
};
text(setting) {
let newText = ``;
this.add(newText);
};
select(setting) {
let newSelect = ``;
this.add(newSelect);
};
button(setting) {
let newButton = ``;
this.add(newButton);
};
selectMenu(setting) {
let newSelect = ``;
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";
//getEl(setting.id).style.color = 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++;
}
last = "check_" + getEl(setting.id).value.split("_")[1];
window[setting.id + "Func"] = function() {
getEl(last).style.display = "none";
last = "check_" + getEl(setting.id).value.split("_")[1];
getEl(last).style.display = "inline-block";
//getEl(setting.id).style.color = setting.menu[last.split("_")[1]] ? "#8ecc51" : "#fff";
};
};
};
class Html {
constructor() {
this.element = null;
this.action = null;
this.divElement = null;
this.startDiv = function(setting, func) {
let newDiv = document.createElement("div");
setting.id && (newDiv.id = setting.id);
setting.style && (newDiv.style = setting.style);
setting.class && (newDiv.className = setting.class);
this.element.appendChild(newDiv);
this.divElement = newDiv;
let addRes = new HtmlAction(newDiv);
typeof func == "function" && func(addRes);
};
this.addDiv = function(setting, func) {
let newDiv = document.createElement("div");
setting.id && (newDiv.id = setting.id);
setting.style && (newDiv.style = setting.style);
setting.class && (newDiv.className = setting.class);
setting.appendID && getEl(setting.appendID).appendChild(newDiv);
this.divElement = newDiv;
let addRes = new HtmlAction(newDiv);
typeof func == "function" && func(addRes);
};
};
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(``);
};
};
let HTML = new Html();
let menuDiv = document.createElement("div");
menuDiv.id = "menuDiv";
menuDiv.draggable = true;
menuDiv.addEventListener("dragstart", function (e) {
e.dataTransfer.setData("text/plain", "");
});
document.addEventListener("dragover", function (e) {
menuDiv.style.left = e.clientX - menuDiv.offsetWidth / 2 + "px";
menuDiv.style.top = e.clientY - menuDiv.offsetHeight / 2 + "px";
});
document.body.appendChild(menuDiv);
HTML.set("menuDiv");
HTML.setStyle(`
position: absolute;
left: 20px;
top: 20px;
`);
HTML.resetHTML();
HTML.setCSS(`
.menuClass{
color: #fff;
font-size: 31px;
text-align: left;
padding: 10px;
padding-top: 7px;
padding-bottom: 5px;
width: 300px;
background-color: rgba(0, 0, 0, 0.25);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.menuC {
display: none;
font-family: "Hammersmith One";
font-size: 12px;
max-height: 180px;
overflow-y: scroll;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.menuB {
text-align: center;
background-color: rgb(25, 25, 25);
color: #fff;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: 2px solid #000;
cursor: pointer;
}
.menuB:hover {
border: 2px solid #fff;
}
.menuB:active {
color: rgb(25, 25, 25);
background-color: rgb(200, 200, 200);
}
.customText {
color: #000;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: 2px solid #000;
}
.customText:focus {
background-color: yellow;
}
.checkB {
position: relative;
top: 2px;
accent-color: #888;
cursor: pointer;
}
.Cselect {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: rgb(75, 75, 75);
color: #fff;
border: 1px solid #000;
}
#menuChanger {
position: absolute;
right: 10px;
top: 10px;
background-color: rgba(0, 0, 0, 0);
color: #fff;
border: none;
cursor: pointer;
}
#menuChanger:hover {
color: #000;
}
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
opacity: 0;
}
::-webkit-scrollbar-thumb {
background-color: rgb(25, 25, 25);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:active {
background-color: rgb(230, 230, 230);
}
`);
HTML.startDiv({
id: "menuHeadLine",
class: "menuClass"
}, (html) => {
html.add(`Px 8`);
html.button({
id: "menuChanger",
class: "material-icons",
innerHTML: `sync`,
onclick: "window.changeMenu()"
});
HTML.addDiv({
id: "menuButtons",
style: "display: block; overflow-y: visible;",
class: "menuC",
appendID: "menuHeadLine"
}, (html) => {
html.button({
class: "menuB",
innerHTML: "Debug",
onclick: "window.debug()"
});
});
HTML.addDiv({
id: "menuMain",
style: "display: block",
class: "menuC",
appendID: "menuHeadLine"
}, (html) => {
html.button({
class: "menuB",
innerHTML: "Toggle Wasd Mode",
onclick: "window.wasdMode()"
});
html.newLine();
html.add(`Weapon Grinder: `);
html.checkBox({
id: "weaponGrind",
class: "checkB",
onclick: "window.startGrind()"
});
html.newLine(2);
HTML.addDiv({
style: "font-size: 20px; color: #99ee99;",
appendID: "menuMain"
}, (html) => {
html.add(`Developing Settings:`);
});
html.newLine();
html.add(`New Healing Beta:`);
html.checkBox({
id: "healingBeta",
class: "checkB",
checked: true
});
html.newLine();
html.add(`Music Play :3 : `);
html.select({
id: "songs", class: "Cselect", option: {
"Hoa Cỏ Lau - Phong Max": {
id: "1",
selected: true
},
"Qúa Khứ Anh Không Thể Quên Remix": {
id: "2",
},
"Quan Tửu Sơn Remix": {
id: "3",
},
"2 Phut Hon Remix": {
id: "4",
},
"Ex Hate Me": {
id: "5",
},
"Chơi Như Tụi Mỹ": {
id: "6",
},
"Lữ Khách Qua Thời Gian": {
id: "7",
},
"Gió - Jank": {
id: "8",
},
"Đào Nương Remix - Hoàng Vương": {
id: "9",
},
"Quy Tầm - Đẳng Thập Ma Quân": {
id: "10",
},
"Hẹn Yêu - Quang Nhật Remix": {
id: "11",
},
"Yêu Thương Chẳng Là Mãi Mãi - Tracy Remix": {
id: "12",
},
"Tình Ta Hai Ngã Remix": {
id: "13",
},
"Yêu Bản Thân Remix Huyền Mie": {
id: "14",
},
"Có Lẽ Bên Nhau Là Sai Remix": {
id: "15",
},
"Central Cee - Doja": {
id: "16",
},
"Legend Never Die x Warriors - Mit Remix": {
id: "17",
},
"Anh Tú - MV Hoàng Hôn Nhớ": {
id: "18",
},
"BVLKY - DINHBAO Remix": {
id: "19",
},
"Gods Ft NewJeans | THEREON REMIX |": {
id: "20",
},
"Wxrdie - TETVOVEN": {
id: "21",
},
"HNECR ft Thằng Hầu - Quang Nhật Remix": {
id: "22",
},
"IN DA CLUB - DOUBLE S REMIX": {
id: "23",
},
"✈Anh Sợ Yêu Remix - TungTray Ft Natra": {
id: "24",
},
"MY LOVE FT TATU - THÁI HOÀNG REMIX": {
id: "25",
},
"CALL OF SILENCE x FAKE LOVE - MinhAk Remix": {
id: "26",
},
"LONELY - NANA if BT REMIX": {
id: "27",
},
"Từng Quen (AnhVu Remix) - Wren Evans": {
id: "28",
},
"Miên Man (Thereon Remix) - Minh Huy": {
id: "29",
},
"GiáNhưAnhLàNgườiVôTâm x Nhìn Em Lần Cuối": {
id: "30",
},
"ĐÁY BIỂN x PHONG DẠ HÀNH VER 2": {
id: "31",
},
"Ngây Thơ - Phong Max feat Tang Duy Tan": {
id: "32",
},
"Anh Thương Em Em Thương Ai": {
id: "33",
},
"Đại Điền Hậu Sinh Tử (大田後生仔)": {
id: "34",
},
"THIẾU NIÊN HOA HỒNG": {
id: "35",
},
"BẤT VẤN BIỆT LY x BALENCIAGA": {
id: "36",
},
"WAY BACK": {
id: "37",
},
"Nếu Ngày Ấy Remix - Soobin Hoàng Sơn": {
id: "38",
},
"Play Date ft. Sao Anh Chưa Về": {
id: "39",
},
"Kiệu Hoa (AIR Remix)": {
id: "40",
},
"Trích Tiên - VuQuan Remix - TikTok": {
id: "41",
},
"She Neva Know - JustaTee - Quyền HP Remix": {
id: "42",
},
"Không Tìm Thấy lối Đi Remix": {
id: "43",
},
"♫ Xin Má Rước Dâu (PiPo Remix) x Diệu Kiên": {
id: "44",
},
"Dối Lừa (Qinn Remix) Nguyễn Đình Vũ": {
id: "45",
},
"Gói Gọn Hồi Ức Trao Cho Anh Remix": {
id: "46",
},
"Freed From Desire": {
id: "47",
},
"Chịu Cách Mình Nói Thua": {
id: "48",
},
"Anh Là Ai | Huỳnh Công Hiếu x DT x Umie": {
id: "49",
},
"NƠI TÌNH YÊU KẾT THÚC": {
id: "50",
},
"Hẹn Một Mai - Hà Anh Tuấn": {
id: "51",
},
"Để Anh Một Mình": {
id: "52",
},
"Richie D. ICY & AXTROBOY": {
id: "53",
},
"Tan Phai - LiL Van": {
id: "54",
}
}
});
});
HTML.addDiv({
id: "menuConfig",
class: "menuC",
appendID: "menuHeadLine"
}, (html) => {
html.add(`AutoPlacer Placement Tick: `);
html.text({
id: "autoPlaceTick",
class: "customText",
value: "2",
size: "2em",
maxLength: "1"
});
html.newLine();
html.add(`Configs: `);
html.selectMenu({
id: "configsChanger",
class: "Cselect",
menu: configs
});
html.newLine();
html.add(`InstaKill Type: `);
html.select({
id: "instaType",
class: "Cselect",
option: {
OneShot: {
id: "oneShot",
selected: true
},
Spammer: {
id: "spammer"
}
}
});
html.newLine();
html.add(`AntiBull Type: `);
html.select({
id: "antiBullType",
class: "Cselect",
option: {
"Disable AntiBull": {
id: "noab",
selected: true
},
"When Reloaded": {
id: "abreload",
},
"Primary Reloaded": {
id: "abalway"
}
}
});
html.newLine();
html.add(`Backup Nobull Insta: `);
html.checkBox({
id: "backupNobull",
class: "checkB",
checked: true
});
html.newLine();
html.add(`Turret Gear Combat Assistance: `);
html.checkBox({
id: "turretCombat",
class: "checkB"
});
html.newLine();
html.add(`Safe AntiSpikeTick: `);
html.checkBox({
id: "safeAntiSpikeTick",
class: "checkB",
checked: true
});
html.newLine();
html.add(`AntiPush(Beta):`);
html.checkBox({
id: "antipush",
class: "checkB",
checked: true
});
html.newLine();
html.add(`Player Follower`);
html.text({ id: "playerSid", class: "customText", value: "0", size: "2em", maxLength: "2" });
html.checkBox({ id: "togglePlayerFollower", class: "checkB", onclick: "window.startFollow()", checked: false });
//html.newLine();
html.newLine();
html.newLine();
});
HTML.addDiv({
id: "menuOther",
class: "menuC",
appendID: "menuHeadLine"
}, (html) => {
html.button({
class: "menuB",
innerHTML: "Connect Bots",
onclick: "window.tryConnectBots()"
});
html.button({
class: "menuB",
innerHTML: "Disconnect Bots",
onclick: "window.destroyBots()"
});
html.newLine();
html.button({
class: "menuB",
innerHTML: "Connect FBots",
onclick: "window.connectFillBots()"
});
html.button({
class: "menuB",
innerHTML: "Disconnect FBots",
onclick: "window.destroyFillBots()"
});
html.newLine();
html.button({
class: "menuB",
innerHTML: "Reset Break Objects",
onclick: "window.resBuild()"
});
html.newLine();
html.add(`Break Objects Range: `);
html.text({
id: "breakRange",
class: "customText",
value: "700",
size: "3em",
maxLength: "4"
});
html.newLine();
html.add(`Predict Movement Type: `);
html.select({
id: "predictType",
class: "Cselect",
option: {
"Disable Render": {
id: "disableRender",
selected: true
},
"X/Y and 2": {
id: "pre2",
},
"X/Y and 3": {
id: "pre3"
}
}
});
html.newLine();
html.add(`Render Placers: `);
html.checkBox({
id: "placeVis",
class: "checkB",
});
html.newLine();
html.add(`Bot Mode: `);
html.select({
id: "mode",
class: "Cselect",
option: {
"Clear Building": {
id: "clear",
selected: true
},
"Sync": {
id: "zync",
},
"Search": {
id: "zearch"
},
"Clear Everything": {
id: "radiusclear"
},
"Flex": {
id: "flex"
}
}
});
html.newLine(2);
html.button({
class: "menuB",
innerHTML: "Toggle Fbots Circle",
onclick: "window.toggleBotsCircle()"
});
html.newLine();
html.add(`Circle Rad: `);
html.text({
id: "circleRad",
class: "customText",
value: "200",
size: "3em",
maxLength: "4"
});
html.newLine();
html.add(`Rad Speed: `);
html.text({
id: "radSpeed",
class: "customText",
value: "0.1",
size: "2em",
maxLength: "3"
});
html.newLine();
html.add(`Bot Zetup Type: `);
html.select({
id: "setup",
class: "Cselect",
option: {
"Dagger Musket": {
id: "dm",
selected: true
},
"Katana Hammer": {
id: "kh",
},
"Dagger Repeater-Crossbow": {
id: "dr"
},
"Zhort-Zword Muzket": {
id: "zd"
}
}
});
html.newLine(2);
html.add(`Cross World: `);
html.checkBox({
id: "funni",
class: "checkB"
});
html.newLine();
html.button({
class: "menuB",
innerHTML: "Toggle Another Visual",
onclick: "window.toggleVisual()"
});
html.newLine();
});
});
let menuChatDiv = document.createElement("div");
menuChatDiv.id = "menuChatDiv";
document.body.appendChild(menuChatDiv);
HTML.set("menuChatDiv");
HTML.setStyle(`
position: absolute;
display: none;
left: 0px;
top: 0px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.65);
`);
HTML.resetHTML();
HTML.setCSS(`
.chDiv{
color: #fff;
padding: 5px;
width: 340px;
height: 280px;
background-color: rgba(0, 0, 0, 0.35);
}
.chMainDiv{
font-family: "Ubuntu";
font-size: 12px;
max-height: 235px;
overflow-y: scroll;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.chMainBox{
position: absolute;
left: 5px;
bottom: 10px;
width: 335px;
height: 30px;
background-color: rgb(128, 128, 128, 0.35);
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
color: #fff;
font-family: "Ubuntu";
font-size: 12px;
border: none;
outline: none;
}
`);
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`
});
});
let menuChats = getEl("mChMain");
let menuChatBox = getEl("mChBox");
let menuCBFocus = false;
let menuChCounts = 0;
menuChatBox.value = "";
menuChatBox.addEventListener("focus", () => {
menuCBFocus = true;
});
menuChatBox.addEventListener("blur", () => {
menuCBFocus = false;
});
function addMenuChText(name, message, color, noTimer) {
HTML.set("menuChatDiv");
color = color || "white";
let time = new Date();
let min = time.getMinutes();
let hour = time.getHours();
let text = ``;
if (!noTimer) text += `${(hour < 10 ? '0' : '') + hour}:${(min < 10 ? '0' : '') + min}`;
if (name) text += `${(!noTimer ? " - " : "") + name}`;
if (message) text += `${(name ? ": " : !noTimer ? " - " : "") + message}\n`;
HTML.addDiv({ id: "menuChDisp", style: `color: ${color}`, appendID: "mChMain" }, (html) => {
html.add(text);
});
menuChats.scrollTop = menuChats.scrollHeight;
menuChCounts++;
}
function chch(name, message, color, noTimer) {
HTML.set("menuChatDiv");
color = color || "white";
let time = new Date();
let text = ``;
// if (name) text += `${(!noTimer ? " - " : "") + name}`;
if (message) text += `${(name ? ": " : !noTimer ? "" : "") + message}\n`;
HTML.addDiv({ id: "menuChDisp", style: `color: ${color}`, appendID: "mChMain" }, (html) => {
html.add(text);
});
menuChats.scrollTop = menuChats.scrollHeight;
menuChCounts++;
}
function resetMenuChText() {
menuChats.innerHTML = ``;
menuChCounts = 0;
addMenuChText(null, "Chat '/help' for a list of chat commands.", "white", 1)
}
resetMenuChText();
let menuIndex = 0;
let menus = ["menuMain", "menuConfig", "menuOther"];
window.changeMenu = function() {
getEl(menus[menuIndex % menus.length]).style.display = "none";
menuIndex++;
getEl(menus[menuIndex % menus.length]).style.display = "block";
};
let mStatus = document.createElement("div");
mStatus.id = "status";
getEl("gameUI").appendChild(mStatus);
HTML.set("status");
HTML.setStyle(`
display: block;
position: absolute;
color: #ddd;
font: 15px Hammersmith One;
bottom: 215px;
left: 20px;
`);
HTML.resetHTML();
HTML.setCSS(`
.sizing {
font-size: 15px;
}
.mod {
font-size: 15px;
display: inline-block;
}
`);
HTML.startDiv({
id: "uehmod",
class: "sizing"
}, (html) => {
html.add(`Ping: `);
HTML.addDiv({
id: "pingFps",
class: "mod",
appendID: "uehmod"
}, (html) => {
html.add("None");
});
html.newLine();
html.add(`Packet: `);
HTML.addDiv({
id: "packetStatus",
class: "mod",
appendID: "uehmod"
}, (html) => {
html.add("None");
});
});
/*function modLog() {
let logs = [];
for (let i = 0; i < arguments.length; i++) {
logs.push(arguments[i]);
}
getEl("modLog").innerHTML = logs;
}*/
let openMenu = false;
let WS = undefined;
let socketID = undefined;
let useWasd = false;
let secPacket = 0;
let secMax = 120;
let secTime = 1000;
let firstSend = {
sec: false
};
let game = {
tick: 0,
tickQueue: [],
tickBase: function(set, tick) {
if (this.tickQueue[this.tick + tick]) {
this.tickQueue[this.tick + tick].push(set);
} else {
this.tickQueue[this.tick + tick] = [set];
}
},
tickRate: (1000 / config.serverUpdateRate),
tickSpeed: 0,
lastTick: performance.now()
};
let modConsole = [];
let dontSend = false;
let fpsTimer = {
last: 0,
time: 0,
ltime: 0
}
let lastMoveDir = undefined;
let lastsp = ["cc", 1, "__proto__"];
WebSocket.prototype.nsend = WebSocket.prototype.send;
WebSocket.prototype.send = function(message) {
if (!WS) {
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;
// EXTRACT DATA ARRAY:
let data = new Uint8Array(message);
let parsed = window.msgpack.decode(data);
let type = parsed[0];
data = parsed[1];
// SEND MESSAGE:
if (type == "6") {
if (data[0]) {
// ANTI PROFANITY:
let profanity = ["cunt", "whore", "fuck", "shit", "faggot", "nigger", "nigga", "dick", "vagina", "minge", "cock", "rape", "cum", "sex", "tits", "penis", "clit", "pussy", "meatcurtain", "jizz", "prune", "douche", "wanker", "damn", "bitch", "dick", "fag", "bastard", ];
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, // id: setInitData,
//B: disconnect,
C: setupGame, // 1: setupGame,
D: addPlayer, // 2: addPlayer,
E: removePlayer, // 4: removePlayer,
a: updatePlayers, // 33: updatePlayers,
G: updateLeaderboard, // 5: updateLeaderboard,here
H: loadGameObject, // 6: loadGameObject,
I: loadAI, // a: loadAI,
J: animateAI, // aa: animateAI,
K: gatherAnimation, // 7: gatherAnimation,
L: wiggleGameObject, // 8: wiggleGameObject,
M: shootTurret, // sp: shootTurret,
N: updatePlayerValue, // 9: updatePlayerValue,
O: updateHealth, // h: updateHealth,//here
P: killPlayer, // 11: killPlayer,
Q: killObject, // 12: killObject,
R: killObjects, // 13: killObjects,
S: updateItemCounts, // 14: updateItemCounts,
T: updateAge, // 15: updateAge,
U: updateUpgrades, // 16: updateUpgrades,
V: updateItems, // 17: updateItems,
X: addProjectile, // 18: addProjectile,
// Y: remProjectile, // 19: remProjectile,
//Z: serverShutdownNotice,
//0: addAlliance,
//1: deleteAlliance,
2: allianceNotification, // an: allianceNotification,
3: setPlayerTeam, // st: setPlayerTeam,
4: setAlliancePlayers, // sa: setAlliancePlayers,
5: updateStoreItems, // us: updateStoreItems,
6: receiveChat, // ch: receiveChat,
7: updateMinimap, // mm: updateMinimap,
8: showText, // t: showText,
9: pingMap, // p: 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:
function resetMoveDir() {
keys = {};
io.send("e");
}
let allChats = [];
let ticks = {
tick: 0,
delay: 0,
time: [],
manage: [],
};
let ais = [];
let players = [];
let alliances = [];
let alliancePlayers = [];
let allianceNotifications = [];
let gameObjects = [];
let liztobj = [];
let projectiles = [];
let deadPlayers = [];
let breakObjects = [];
let player;
let playerSID;
let tmpObj;
let enemy = [];
let nears = [];
let near = [];
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: {}
}
// FIND OBJECTS BY ID/SID:
function findID(tmpObj, tmp) {
return tmpObj.find((THIS) => THIS.id == tmp);
}
function findSID(tmpObj, tmp) {
return tmpObj.find((THIS) => THIS.sid == tmp);
}
function findPlayerByID(id) {
return findID(players, id);
}
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);
}
let gameName = getEl("gameName");
let adCard = getEl("adCard");
adCard.remove();
let promoImageHolder = getEl("promoImgHolder");
promoImageHolder.remove();
let linksContainer2 = getEl("linksContainer2");
linksContainer2.remove();
let desktopInstructions = getEl("desktopInstructions");
desktopInstructions.innerText = "ESC = Menu";
let joinPartyButton = getEl("joinPartyButton");
joinPartyButton.remove();
let partyButton = getEl("partyButton");
partyButton.remove();
let wideAdCard = getEl("wideAdCard");
wideAdCard.remove();
let chatButton = getEl("chatButton");
chatButton.remove();
let gameCanvas = getEl("gameCanvas");
let mainContext = gameCanvas.getContext("2d");
let mapDisplay = getEl("mapDisplay");
let mapContext = mapDisplay.getContext("2d");
mapDisplay.width = 300;
mapDisplay.height = 300;
let storeMenu = getEl("storeMenu");
let storeHolder = getEl("storeHolder");
let upgradeHolder = getEl("upgradeHolder");
let upgradeCounter = getEl("upgradeCounter");
let chatBox = getEl("chatBox");
chatBox.autocomplete = "off";
chatBox.style.textAlign = "center";
chatBox.style.width = "18em";
let chatHolder = getEl("chatHolder");
let actionBar = getEl("actionBar");
let leaderboardData = getEl("leaderboardData");
let itemInfoHolder = getEl("itemInfoHolder");
let menuCardHolder = getEl("menuCardHolder");
let mainMenu = getEl("mainMenu");
let diedText = getEl("diedText");
let screenWidth;
let screenHeight;
let maxScreenWidth = config.maxScreenWidth;
let maxScreenHeight = config.maxScreenHeight;
let pixelDensity = 1;
let delta;
let now;
let lastUpdate = performance.now();
let camX;
let camY;
let tmpDir;
let mouseX = 0;
let mouseY = 0;
let allianceMenu = getEl("allianceMenu");
let waterMult = 1;
let waterPlus = 0;
let outlineColor = "#525252";
let darkOutlineColor = "#3d3f42";
let outlineWidth = 5.5;
let firstSetup = true;
let keys = {};
let moveKeys = {
87: [0, -1],
38: [0, -1],
83: [0, 1],
40: [0, 1],
65: [-1, 0],
37: [-1, 0],
68: [1, 0],
39: [1, 0],
};
let attackState = 0;
let inGame = false;
let macro = {};
let mills = {
place: 0,
placeSpawnPads: 0
};
let lastDir;
let lastLeaderboardData = [];
// ON LOAD:
let inWindow = true;
window.onblur = function() {
inWindow = false;
};
window.onfocus = function() {
inWindow = true;
if (player && player.alive) {
// resetMoveDir();
}
};
let ms = {
avg: 0,
max: 0,
min: 0,
delay: 0
}
function pingSocketResponse() {
let pingTime = window.pingTime;
const pingDisplay = document.getElementById("pingDisplay")
pingDisplay.innerText = "Ping: " + pingTime + " ms`";
if (pingTime > ms.max || isNaN(ms.max)) {
ms.max = pingTime;
}
if (pingTime < ms.min || isNaN(ms.min)) {
ms.min = pingTime;
}
// if (pingTime >= 90) {
// doAutoQ = true;
// } else {
// doAutoQ = false;
// }
}
let placeVisible = [];
let profanityList = ["cunt", "whore", "fuck", "shit", "faggot", "nigger",
"nigga", "dick", "vagina", "minge", "cock", "rape", "cum", "sex",
"tits", "penis", "clit", "pussy", "meatcurtain", "jizz", "prune",
"douche", "wanker", "damn", "bitch", "dick", "fag", "bastard"
];
/** CLASS CODES */
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;
let _this = this;
// 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.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;
let insideHorizontal = x > left && x < left + width;
let insideVertical = y > top && y < top + height;
return insideHorizontal && insideVertical;
};
this.mousifyTouchEvent = function(event) {
let touch = event.changedTouches[0];
event.screenX = touch.screenX;
event.screenY = touch.screenY;
event.clientX = touch.clientX;
event.clientY = touch.clientY;
event.pageX = touch.pageX;
event.pageY = touch.pageY;
};
this.hookTouchEvents = function(element, skipPrevent) {
let preventDefault = !skipPrevent;
let isHovering = false;
// let passive = window.Modernizr.passiveeventlisteners ? {passive: true} : false;
let passive = false;
element.addEventListener("touchstart", this.checkTrusted(touchStart), passive);
element.addEventListener("touchmove", this.checkTrusted(touchMove), passive);
element.addEventListener("touchend", this.checkTrusted(touchEnd), passive);
element.addEventListener("touchcancel", this.checkTrusted(touchEnd), passive);
element.addEventListener("touchleave", this.checkTrusted(touchEnd), passive);
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");
function bind(configValue, elementValue) {
if (config[configValue])
element[elementValue] = config[configValue];
}
bind("text", "textContent");
bind("html", "innerHTML");
bind("class", "className");
for (let key in config) {
switch (key) {
case "tag":
case "text":
case "html":
case "class":
case "style":
case "hookTouch":
case "parent":
case "children":
continue;
default:
break;
}
element[key] = config[key];
}
if (element.onclick)
element.onclick = this.checkTrusted(element.onclick);
if (element.onmouseover)
element.onmouseover = this.checkTrusted(element.onmouseover);
if (element.onmouseout)
element.onmouseout = this.checkTrusted(element.onmouseout);
if (config.style) {
element.style.cssText = config.style;
}
if (config.hookTouch) {
this.hookTouchEvents(element);
}
if (config.parent) {
config.parent.appendChild(element);
}
if (config.children) {
for (let i = 0; i < config.children.length; i++) {
element.appendChild(config.children[i]);
}
}
return element;
};
this.checkTrusted = function(callback) {
return function(ev) {
if (ev && ev instanceof Event && (ev && typeof ev.isTrusted == "boolean" ? ev.isTrusted : true)) {
callback(ev);
} else {
//console.error("Event is not trusted.", ev);
}
};
};
this.randomString = function(length) {
let text = "";
let possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let i = 0; i < length; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
};
this.countInArray = function(array, val) {
let count = 0;
for (let i = 0; i < array.length; i++) {
if (array[i] === val) count++;
}
return count;
};
this.hexToRgb = function(hex) {
return hex.slice(1).match(/.{1,2}/g).map(g => parseInt(g, 16));
};
this.getRgb = function(r, g, b) {
return [r / 255, g / 255, b / 255].join(", ");
};
}
};
/*class Animtext {
// ANIMATED TEXT:
constructor() {
// INIT:
this.init = function(x, y, scale, speed, life, text, color) {
(this.x = x),
(this.y = y),
(this.color = color),
(this.scale = scale*3.5),
(this.weight = 50);
(this.startScale = this.scale * 1.2),
(this.maxScale = 1.5 * scale),
(this.minScale = 0.5 * scale),
(this.scaleSpeed = 0.7),
(this.speed = speed),
(this.speedMax = speed),
(this.life = life),
(this.maxLife = life),
(this.text = text),
this.movSpeed = speed;
};
// UPDATE:
this.update = function(delta) {
if(this.life){
this.life -= delta;
if(this.scaleSpeed != -0.35){
this.y -= this.speed * delta;
// (this.x += this.speed * delta);
} else {
this.y -= this.speed * delta;
}
this.scale -= .8;
// this.scale > 0.35 && (this.scale = Math.max(this.scale, this.startScale));
// this.speed < this.speedMax && (this.speed -= this.speedMax * .0075);
if(this.scale >= this.maxScale){
this.scale = this.maxScale;
this.scaleSpeed *= -.5;
this.speed = this.speed * .75;
};
this.life <= 0 && (this.life = 0)
};
};
// RENDER:
this.render = function(ctxt, xOff, yOff) {
ctxt.lineWidth = 10;
ctxt.strokeStyle = darkOutlineColor; //"black";
ctxt.fillStyle = this.color;
ctxt.globalAlpha = 1;
ctxt.font = this.scale + "px Hammersmith One";
ctxt.strokeText(this.text, this.x - xOff, this.y - yOff);
ctxt.fillText(this.text, this.x - xOff, this.y - yOff);
ctxt.globalAlpha = 1;
};
}
};*/
class Animtext {
// ANIMATED TEXT:
constructor() {
// INIT:
this.init = function(x, y, scale, speed, life, text, color) {
(this.x = x),
(this.y = y),
(this.color = color),
(this.scale = scale),
(this.weight = 50);
(this.startScale = this.scale * 1.2),
(this.maxScale = 1.5 * scale),
(this.minScale = 0.5 * scale),
(this.scaleSpeed = 0.7),
(this.speed = speed),
(this.speedMax = speed),
(this.life = life),
(this.maxLife = life),
(this.text = text),
(this.movSpeed = Math.random() * 1 + 1);
};
// UPDATE:
/* this.update = function(delta) {
if(this.life){
this.life -= delta;
if(this.scaleSpeed != -0.35){
this.y += this.speed * delta;
// (this.x += this.speed * delta);
} else {
this.y -= this.speed * delta;
}
this.scale += this.scaleSpeed * (delta / 3.5);
this.scale = Math.max(this.scale, this.startScale);
this.speed < this.speedMax && (this.speed += this.speedMax * .0075);
if(this.scale >= this.maxScale){
this.scale = this.maxScale;
this.scaleSpeed *= -.5;
this.speed = this.speed * .75;
};
this.life <= 0 && (this.life = 0)
};
};*/
this.update = function(e) {
if(this.life){
this.life -= e;
if(this.scaleSpeed != -0.35){
this.y += this.speed * e;
this.movAngle ? (this.x -= this.speed * e * (this.movSpeed)) : (this.x += this.speed * e * (this.movSpeed));
} else {
this.movAngle ? (this.x -= this.speed * e * (this.movSpeed)) : (this.x += this.speed * e * (this.movSpeed));
this.y -= this.speed * e;
}
this.scale += this.scaleSpeed * (e / 4.5);
this.scale = Math.max(this.scale, this.startScale);
this.speed < this.speedMax && (this.speed += this.speedMax * .01);
if(this.scale >= this.maxScale){
this.scale = this.maxScale;
this.scaleSpeed *= -.5;
this.speed = this.speed * .5;
};
this.life <= 0 && (this.life = 0)
};
};
// RENDER:
this.render = function(ctxt, xOff, yOff) {
ctxt.lineWidth = 10;
ctxt.fillStyle = this.color;
ctxt.font = 30 + "px " + (config.anotherVisual ? "Hasmmersmith One" : "Hammersmitsh One");
if (config.anotherVisual) {
ctxt.globalAlpha = this.alpha;
// ctxt.fillStyle = (tmpObj == player || (tmpObj.team && tmpObj.team == player.team)) ? "#ffffff" : "#4e7bde";
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);
};
}
}
class GameObject {
constructor(sid) {
this.sid = sid;
// INIT:
this.init = function(x, y, dir, scale, type, data, owner) {
data = data || {};
this.sentTo = {};
this.gridLocations = [];
this.active = true;
this.render = true;
this.doUpdate = data.doUpdate;
this.x = x;
this.y = y;
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 ||
(this.owner.team && player.team == this.owner.team)));
};
// 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);
}
let d2 = UTILS.getAngleDist(this.lastDir, this.dir);
if (d2 > 0.01) {
this.dir += d2 / 5;
} else {
this.dir = this.lastDir;
}
} 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,
shadow: {
offsetX: 5, // Adjust the shadow's X offset as needed
offsetY: 5, // Adjust the shadow's Y offset as needed
blur: 20, // Adjust the shadow's blur as needed
color: "rgba(0, 0, 0, 0.5)" // Adjust the shadow's color and transparency as needed
}
}, {
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
}];
// CHECK ITEM ID:
this.checkItem = {
index: function(id, myItems) {
return [0, 1, 2].includes(id) ? 0 : [3, 4, 5].includes(id) ? 1 : [6, 7, 8, 9].includes(id) ? 2 : [10, 11, 12].includes(id) ? 3 : [13, 14].includes(id) ? 5 : [15, 16].includes(id) ? 4 : [17, 18, 19, 21, 22].includes(id) ? [13, 14].includes(myItems) ? 6 :
5 :
id == 20 ? [13, 14].includes(myItems) ? 7 :
6 :
undefined;
}
}
// 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, liztobj, 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;
};
// 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);
};
// DISABLE BY SID:
this.disableBySid = function(sid) {
let find = findObjectBySid(sid);
if (find) {
this.disableObj(find);
}
};
// REMOVE ALL FROM PLAYER:
this.removeAllItems = function(sid, server) {
gameObjects.filter((tmp) => tmp.active && tmp.owner && tmp.owner.sid == sid).forEach((tmp) => this.disableObj(tmp));
};
// CHECK IF PLACABLE:
this.checkItemLocation = function(x, y, s, sM, indx, ignoreWater, placer) {
let cantPlace = liztobj.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]
}];
// 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.showName = 'aaa';
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 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.showName = 'NOOO';
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 = true;
this.circle = false;
this.circleRad = 200;
this.circleRadSpd = 0.1;
this.cAngle = 0;
// SPAWN:
this.spawn = function(moofoll) {
this.attacked = false;
this.timeDamaged = 0;
this.timeHealed = 0;
this.pinge = 0;
this.millPlace = 'NOOO';
this.lastshamecount = 0;
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 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;
}
};
// 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];
};
// UPDATE POISON TICK:
this.updateTimer = function() {
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 = parseInt(getEl("circleRad").value) || 0;
this.circleRadSpd = parseFloat(getEl("radSpeed").value) || 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() {
this.lastshamecount = this.shameCount;
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));
};
// FOR THE PLAYER:
this.findAllianceBySid = function(sid) {
return this.team ? alliancePlayers.find((THIS) => THIS === sid) : null;
};
this.checkCanInsta = function(nobull) {
let totally = 0;
if (this.alive && inGame) {
let primary = {
weapon: this.weapons[0],
variant: this.primaryVariant,
dmg: this.weapons[0] == undefined ? 0 : items.weapons[this.weapons[0]].dmg,
};
let secondary = {
weapon: this.weapons[1],
variant: this.secondaryVariant,
dmg: this.weapons[1] == undefined ? 0 : items.weapons[this.weapons[1]].Pdmg,
};
let bull = this.skins[7] && !nobull ? 1.5 : 1;
let pV = primary.variant != undefined ? config.weaponVariants[primary.variant].val : 1;
if (primary.weapon != undefined && this.reloads[primary.weapon] == 0) {
totally += primary.dmg * pV * bull;
}
if (secondary.weapon != undefined && this.reloads[secondary.weapon] == 0) {
totally += secondary.dmg;
}
if (this.skins[53] && this.reloads[53] <= (player.weapons[1] == 10 ? 0 : game.tickRate) && near.skinIndex != 22) {
totally += 25;
}
totally *= near.skinIndex == 6 ? 0.75 : 1;
return totally;
}
return 0;
};
// UPDATE WEAPON RELOAD:
this.manageReload = function() {
if (this.shooting[53]) {
this.shooting[53] = 0;
this.reloads[53] = (2500 - game.tickRate);
} else {
if (this.reloads[53] > 0) {
this.reloads[53] = Math.max(0, this.reloads[53] - game.tickRate);
}
}
//preplacer
if (this.reloads[this.weaponIndex] <= 1000/9) {
// place(2, getAttackDir());
let index = this.weaponIndex;
let nearObja = liztobj.filter((e) => (e.active || e.alive) && e.health < e.maxHealth && e.group !== undefined && UTILS.getDist(e, player, 0, 2) <= (items.weapons[player.weaponIndex].range + e.scale));
for(let i = 0; i < nearObja.length; i++) {
let aaa = nearObja[i];
let val = items.weapons[index].dmg * (config.weaponVariants[tmpObj[(index < 9 ? "prima" : "seconda") + "ryVariant"]].val) * (items.weapons[index].sDmg || 1) * 3.3;
let valaa = items.weapons[index].dmg * (config.weaponVariants[tmpObj[(index < 9 ? "prima" : "seconda") + "ryVariant"]].val) * (items.weapons[index].sDmg || 1);
if(aaa.health - (valaa) <= 0 && near.length) {
place(near.dist2<((near.scale * 1.8) + 50)?4:2, caf(aaa, player) + Math.PI);
}
}
}
if (this.gathering || this.shooting[1]) {
if (this.gathering) {
this.gathering = 0;
this.reloads[this.gatherIndex] = (items.weapons[this.gatherIndex].speed * (this.skinIndex == 20 ? 0.78 : 1));
this.attacked = true;
}
if (this.shooting[1]) {
this.shooting[1] = 0;
this.reloads[this.shootIndex] = (items.weapons[this.shootIndex].speed * (this.skinIndex == 20 ? 0.78 : 1));
this.attacked = true;
}
} else {
this.attacked = false;
if (this.buildIndex < 0) {
if (this.reloads[this.weaponIndex] > 0) {
// Math.max(0, this.reloads[this.weaponIndex] - game.tickRate)
this.reloads[this.weaponIndex] = Math.max(0, this.reloads[this.weaponIndex] - 110);
if (this == player) {
if (getEl("weaponGrind").checked) {
for (let i = 0; i < Math.PI * 2; i += Math.PI / 2) {
checkPlace(player.getItemType(22), i);
}
}
}
if (this.reloads[this.primaryIndex] == 0 && this.reloads[this.weaponIndex] == 0) {
this.antiBull++;
game.tickBase(() => {
this.antiBull = 0;
}, 1);
}
}
}
}
};
// FOR ANTI INSTA:
this.addDamageThreat = function(tmpObj) {
let primary = {
weapon: this.primaryIndex,
variant: this.primaryVariant
};
primary.dmg = primary.weapon == undefined ? 45 : items.weapons[primary.weapon].dmg;
let secondary = {
weapon: this.secondaryIndex,
variant: this.secondaryVariant
};
secondary.dmg = secondary.weapon == undefined ? 75 : items.weapons[secondary.weapon].Pdmg;
let bull = 1.5;
let pV = primary.variant != undefined ? config.weaponVariants[primary.variant].val : 1.18;
let sV = secondary.variant != undefined ? [9, 12, 13, 15].includes(secondary.weapon) ? 1 : config.weaponVariants[secondary.variant].val : 1.18;
if (primary.weapon == undefined ? true : this.reloads[primary.weapon] == 0) {
this.damageThreat += primary.dmg * pV * bull;
}
if (secondary.weapon == undefined ? true : this.reloads[secondary.weapon] == 0) {
this.damageThreat += secondary.dmg * sV;
}
if (this.reloads[53] <= game.tickRate) {
this.damageThreat += 25;
}
this.damageThreat *= tmpObj.skinIndex == 6 ? 0.75 : 1;
if (!this.isTeam(tmpObj)) {
if (this.dist2 <= 300) {
tmpObj.damageThreat += this.damageThreat;
}
}
};
}
};
// SOME CODES:
function sendUpgrade(index) {
player.reloads[index] = 0;
packet("H", index);
}
function storeEquip(id, index) {
packet("c", 0, id, index);
}
function storeBuy(id, index) {
packet("c", 1, id, index);
}
function buyEquip(id, index) {
let nID = player.skins[6] ? 6 : 0;
if (player.alive && inGame) {
if (index == 0) {
if (player.skins[id]) {
if (player.latestSkin != id) {
packet("c", 0, id, 0);
}
} else {
if (configs.autoBuyEquip) {
let find = findID(hats, id);
if (find) {
if (player.points >= find.price) {
packet("c", 1, id, 0);
packet("c", 0, id, 0);
} else {
if (player.latestSkin != nID) {
packet("c", 0, nID, 0);
}
}
} else {
if (player.latestSkin != nID) {
packet("c", 0, nID, 0);
}
}
} else {
if (player.latestSkin != nID) {
packet("c", 0, nID, 0);
}
}
}
} else if (index == 1) {
if (useWasd && (id != 11 && id != 0)) {
if (player.latestTail != 0) {
packet("c", 0, 0, 1);
}
return;
}
if (player.tails[id]) {
if (player.latestTail != id) {
packet("c", 0, id, 1);
}
} else {
if (configs.autoBuyEquip) {
let find = findID(accessories, id);
if (find) {
if (player.points >= find.price) {
packet("c", 1, id, 1);
packet("c", 0, id, 1);
} else {
if (player.latestTail != 0) {
packet("c", 0, 0, 1);
}
}
} else {
if (player.latestTail != 0) {
packet("c", 0, 0, 1);
}
}
} else {
if (player.latestTail != 0) {
packet("c", 0, 0, 1);
}
}
}
}
}
}
function selectToBuild(index, wpn) {
packet("G", index, wpn);
}
function selectWeapon(index, isPlace) {
if (!isPlace) {
player.weaponCode = index;
}
packet("G", index, 1);
}
function sendAutoGather() {
packet("K", 1, 1);
}
function sendAtck(id, angle) {
packet("d", id, angle, 1);
}
// PLACER:
var ae86 = false,
lur = true,
fz = false;
function place(id, rad, rmd) {
try {
if (id == undefined) return;
let item = items.list[player.items[id]];
let tmpS = player.scale + item.scale + (item.placeOffset || 0);
let tmpX = player.x2 + tmpS * Math.cos(rad);
let tmpY = player.y2 + tmpS * Math.sin(rad);
if (id === 0 || (player.alive && inGame && (player.itemCounts[item.group.id] == undefined ? true : player.itemCounts[item.group.id] < (config.isSandbox ? (id === 3 || id === 5) ? 296 : 99 : (item.group.limit ? item.group.limit : 99))))) {
selectToBuild(player.items[id]);
sendAtck(1, rad);
selectWeapon(player.weaponCode, 1);
if (rmd && lur) {
placeVisible.push({
x: tmpX,
y: tmpY,
name: item.name,
scale: item.scale,
dir: rad
});
game.tickBase(() => {
placeVisible.shift();
}, 1);
}
} else {
if (mills.place && id === 3) {
mills.place = false;
}
}
} catch (e) {
}
}
function checkPlace(id, rad) {
try {
if (id == undefined) return;
let item = items.list[player.items[id]];
let tmpS = player.scale + item.scale + (item.placeOffset || 0);
let tmpX = player.x2 + tmpS * Math.cos(rad);
let tmpY = player.y2 + tmpS * Math.sin(rad);
if (objectManager.checkItemLocation(tmpX, tmpY, item.scale, 0.6, item.id, false, player)) {
place(id, rad, 1);
}
} catch (e) {}
}
// 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 predictHeal(times) {
for (let i in times) {
place(0, getAttackDir());
}
}
function antiSyncHealing(timearg) {
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);
}
function biomeGear(mover, returns) {
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.y2 <= config.snowBiomeTop) {
if (returns) return 6;
buyEquip(6, 0);
} else {
if (returns) return 6;
buyEquip(6, 0);
}
}
if (returns) return 0;
}
class Traps {
constructor(UTILS, items) {
this.dist = 0;
this.aim = 0;
this.inTrap = false;
this.replaced = false;
this.antiTrapped = false;
this.info = {};
this.notFast = function() {
return player.weapons[1] == 10 && ((this.info.health > items.weapons[player.weapons[0]].dmg) || player.weapons[0] == 5);
}
this.testCanPlace = function(id, first = -(Math.PI / 2), repeat = (Math.PI / 2), plus = (Math.PI / 18), radian, replacer, yaboi) {
try {
let item = items.list[player.items[id]];
let tmpS = player.scale + item.scale + (item.placeOffset || 0);
let counts = {
attempts: 0,
placed: 0
};
let tmpObjects = [];
liztobj.forEach((p) => {
tmpObjects.push({
x: p.x,
y: p.y,
active: p.active,
blocker: p.blocker,
scale: p.scale,
isItem: p.isItem,
type: p.type,
colDiv: p.colDiv,
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);
},
});
});
for (let i = first; i < repeat; i += plus) {
counts.attempts++;
let relAim = radian + i;
let tmpX = player.x2 + tmpS * Math.cos(relAim);
let tmpY = player.y2 + tmpS * Math.sin(relAim);
let cantPlace = tmpObjects.find((tmp) => tmp.active && UTILS.getDistance(tmpX, tmpY, tmp.x, tmp.y) < item.scale + (tmp.blocker ? tmp.blocker : tmp.getScale(0.6, tmp.isItem)));
if (cantPlace) continue;
if (item.id != 18 && tmpY >= config.mapScale / 2 - config.riverWidth / 2 && tmpY <= config.mapScale / 2 + config.riverWidth / 2) continue;
if ((!replacer && yaboi)) {
if (yaboi.inTrap) {
if (UTILS.getAngleDist(near.aim2 + Math.PI, relAim + Math.PI) <= Math.PI*1.3) {
place(2, relAim, 1);
} else {
player.items[4] == 15 && place(4, relAim, 1);
}
} else {
if (UTILS.getAngleDist(near.aim2, relAim) <= config.gatherAngle / 2.6) {
place(2, relAim, 1);
} else {
player.items[4] == 15 && place(4, relAim, 1);
}
}
} else {
place(id, relAim, 1);
}
tmpObjects.push({
x: tmpX,
y: tmpY,
active: true,
blocker: item.blocker,
scale: item.scale,
isItem: true,
type: null,
colDiv: item.colDiv,
getScale: function() {
return this.scale;
},
});
if (UTILS.getAngleDist(near.aim2, relAim) <= 1) {
counts.placed++;
}
}
if (counts.placed > 0 && replacer && item.dmg) {
if (near.dist2 <= items.weapons[player.weapons[0]].range + (player.scale * 1.8) && configs.spikeTick) {
instaC.canSpikeTick = true;
}
}
} catch (err) {
}
};
this.checkSpikeTick = function() {
try {
if (![3, 4, 5].includes(near.primaryIndex)) return false;
if ((getEl("safeAntiSpikeTick").checked || my.autoPush) ? false : near.primaryIndex == undefined ? true : (near.reloads[near.primaryIndex] > game.tickRate)) return false;
// more range for safe. also testing near.primaryIndex || 5
if (near.dist2 <= items.weapons[near.primaryIndex || 5].range + (near.scale * 1.8)) {
let item = items.list[9];
let tmpS = near.scale + item.scale + (item.placeOffset || 0);
let danger = 0;
let counts = {
attempts: 0,
block: `unblocked`
};
for (let i = -1; i <= 1; i += 1 / 10) {
counts.attempts++;
let relAim = UTILS.getDirect(player, near, 2, 2) + i;
let tmpX = near.x2 + tmpS * Math.cos(relAim);
let tmpY = near.y2 + tmpS * Math.sin(relAim);
let cantPlace = liztobj.find((tmp) => tmp.active && UTILS.getDistance(tmpX, tmpY, tmp.x, tmp.y) < item.scale + (tmp.blocker ? tmp.blocker : tmp.getScale(0.6, tmp.isItem)));
if (cantPlace) continue;
if (tmpY >= config.mapScale / 2 - config.riverWidth / 2 && tmpY <= config.mapScale / 2 + config.riverWidth / 2) continue;
danger++;
counts.block = `blocked`;
break;
}
if (danger) {
my.anti0Tick = 1;
// player.chat.message = "Anti SpikeTick " + near.sid;
//player.chat.count = 2000;
return true;
}
}
} catch (err) {
return null;
}
return false;
}
function getDist(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;
}
}
this.protect = function(aim) {
if (!configs.antiTrap) return;
if(getDist(near, player) > getDist(near, traps.info)) {
//behind u
for(let i=-(Math.PI / 2);i<(Math.PI / 2);i+=(Math.PI / 18)) {
checkPlace(2, near.aim2 + i);
}
} else if(getDist(near, traps.info) > getDist(near, player)) {
//infront of u
for(let i=-(Math.PI / 2);i<(Math.PI / 2);i+=(Math.PI / 18)) {
checkPlace(4, near.aim2 + i);
}
}
// if (player.items[4]) {
// this.testCanPlace(4, -(Math.PI / 2), (Math.PI / 2), (Math.PI / 18), aim + Math.PI);
// this.antiTrapped = true;
// }
};
this.autoPlace = function() {
if (enemy.length && configs.autoPlace && !instaC.ticking) {
if (game.tick % (Math.max(1, parseInt(getEl("autoPlaceTick").value)) || 1) === 0) {
if (liztobj.length) {
let near2 = {
inTrap: false,
};
let nearTrap = liztobj.filter(e => e.trap && e.active && e.isTeamObject(player) && UTILS.getDist(e, near, 0, 2) <= (near.scale + e.getScale() + 5)).sort(function(a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b, near, 0, 2);
})[0];
if (nearTrap) {
near2.inTrap = true;
} else {
near2.inTrap = false;
}
if (near.dist3 <= 450) {
if (near.dist3 <= 200) {
this.testCanPlace(4, 0, (Math.PI * 2), (Math.PI / 24), near.aim2, 0, {
inTrap: near2.inTrap
});
} else {
player.items[4] == 15 && this.testCanPlace(4, 0, (Math.PI * 2), (Math.PI / 24), near.aim2);
}
}
} else {
if (near.dist3 <= 450) {
player.items[4] == 15 && this.testCanPlace(4, 0, (Math.PI * 2), (Math.PI / 24), near.aim2);
}
}
}
}
};
this.replacer = function(findObj) {
if (!findObj || !configs.autoReplace) return;
if (!inGame) return;
if (this.antiTrapped) return;
game.tickBase(() => {
let objAim = UTILS.getDirect(findObj, player, 0, 2);
let objDst = UTILS.getDist(findObj, player, 0, 2);
if (getEl("weaponGrind").checked && objDst <= items.weapons[player.weaponIndex].range + player.scale) return;
if (objDst <= 400 && near.dist2 <= 400) {
let danger = this.checkSpikeTick();
if (!danger && near.dist3 <= items.weapons[near.primaryIndex || 5].range + (near.scale * 1.8)) {
//this.testCanPlace(2, -(Math.PI / 2), (Math.PI / 2), (Math.PI / 18), objAim, 1);
this.testCanPlace(2, 0, (Math.PI * 2), (Math.PI / 24), objAim, 1);
} else {
player.items[4] == 15 && this.testCanPlace(4, 0, (Math.PI * 2), (Math.PI / 24), objAim, 1);
}
this.replaced = true;
}
}, 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;
if (type == "rev") {
selectWeapon(player.weapons[1]);
buyEquip(53, 0);
sendAutoGather();
setTimeout(() => {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
setTimeout(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 225);
}, 100);
} else if (type == "nobull") {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
setTimeout(() => {
selectWeapon(player.weapons[1]);
buyEquip(player.reloads[53] == 0 ? 53 : 6, 0);
setTimeout(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 255);
}, 105);
} else if (type == "normal") {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
setTimeout(() => {
selectWeapon(player.weapons[1]);
buyEquip(player.reloads[53] == 0 ? 53 : 6, 0);
setTimeout(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 255);
}, 100);
} else {
setTimeout(() => {
this.isTrue = false;
my.autoAim = false;
}, 50);
}
};
this.spikeTickType = function() {
this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
}, 1);
};
this.counterType = function() {
this.isTrue = true;
my.autoAim = true;
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
sendAutoGather();
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(53, 0);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
}, 1);
}, 1);
};
this.rangeType = function(type) {
this.isTrue = true;
my.autoAim = true;
if (type == "ageInsta") {
my.ageInsta = false;
if (player.items[5] == 18) {
place(5, near.aim2);
}
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("a", near.aim2);
game.tickBase(() => {
place(4, near.aim2);
selectWeapon(player.weapons[1]);
biomeGear();
buyEquip(11, 1);
sendAutoGather();
packet("a", near.aim2);
game.tickBase(() => {
selectWeapon(player.weapons[0]);
buyEquip(7, 0);
buyEquip(19, 1);
packet("a", near.aim2);
game.tickBase(() => {
sendAutoGather();
this.isTrue = false;
my.autoAim = false;
packet("a", 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) {
selectWeapon(player.weapons[[10, 14].includes(player.weapons[1]) ? 1 : 0]);
}
}
} else {
bQ(22, 0);
bQ(19, 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]);
}
}
} else {
bQ(6, 0);
bQ(12, 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]);
}
}
} else {
biomeGear();
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: near.aim2 + Math.PI,
action: 0
};
} else if (dst > goal.b) {
if (dst <= goal.h) {
if (dst <= goal.f) {
if (dst <= goal.d) {
bQ(40, 0);
bQ(9, 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) {
selectWeapon(player.weapons[[10, 14].includes(player.weapons[1]) ? 1 : 0]);
}
}
} else {
bQ(22, 0);
bQ(19, 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]);
}
}
} else {
bQ(6, 0);
bQ(12, 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]);
}
}
} else {
biomeGear();
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: near.aim2,
action: 0
};
}
return {
dir: undefined,
action: 0
};
}
} else {
this.ticking = false;
return {
dir: undefined,
action: 0
};
}
}
/** wait 1 tick for better quality */
this.bowMovement = function() {
let moveMent = this.gotoGoal(685, 3);
if (moveMent.action) {
if (player.reloads[53] == 0 && !this.isTrue) {
this.rangeType("ageInsta");
} else {
packet("a", moveMent.dir, 1);
}
} else {
packet("a", moveMent.dir, 1);
}
},
this.tickMovement = function() {
let moveMent = this.gotoGoal(([10, 14].includes(player.weapons[1]) && player.y2 > config.snowBiomeTop) ? 240 : player.weapons[1] == 15 ? 250 : player.y2 <= config.snowBiomeTop ? [10, 14].includes(player.weapons[1]) ? 270 : 265 : 275, 3);
if (moveMent.action) {
if (![6, 22].includes(near.skinIndex) && player.reloads[53] == 0 && !this.isTrue) {
([10, 14].includes(player.weapons[1]) && player.y2 > config.snowBiomeTop) || (player.weapons[1] == 15) ? this.oneTickType(): this.threeOneTickType();
} else {
packet("a", moveMent.dir, 1);
}
} else {
packet("a", moveMent.dir, 1);
}
},
this.kmTickMovement = function() {
let moveMent = this.gotoGoal(240, 3);
if (moveMent.action) {
if (near.skinIndex != 22 && player.reloads[53] == 0 && !this.isTrue && ((game.tick - near.poisonTick) % config.serverUpdateRate == 8)) {
this.kmTickType();
} else {
packet("a", moveMent.dir, 1);
}
} else {
packet("a", moveMent.dir, 1);
}
},
this.boostTickMovement = function() {
let dist = player.weapons[1] == 9 ? 365 : player.weapons[1] == 12 ? 380 : player.weapons[1] == 13 ? 390 : player.weapons[1] == 15 ? 365 : 370;
let actionDist = player.weapons[1] == 9 ? 2 : player.weapons[1] == 12 ? 1.5 : player.weapons[1] == 13 ? 1.5 : player.weapons[1] == 15 ? 2 : 3;
let moveMent = this.gotoGoal(dist, actionDist);
if (moveMent.action) {
if (player.reloads[53] == 0 && !this.isTrue) {
this.boostTickType();
} else {
packet("a", moveMent.dir, 1);
}
} else {
packet("a", moveMent.dir, 1);
}
}
/** wait 1 tick for better quality */
this.perfCheck = function(pl, nr) {
if (nr.weaponIndex == 11 && UTILS.getAngleDist(nr.aim2 + Math.PI, nr.d2) <= config.shieldAngle) return false;
if (![9, 12, 13, 15].includes(player.weapons[1])) return true;
let pjs = {
x: nr.x2 + (70 * Math.cos(nr.aim2 + Math.PI)),
y: nr.y2 + (70 * Math.sin(nr.aim2 + Math.PI))
};
if (UTILS.lineInRect(pl.x2 - pl.scale, pl.y2 - pl.scale, pl.x2 + pl.scale, pl.y2 + pl.scale, pjs.x, pjs.y, pjs.x, pjs.y)) {
return true;
}
let finds = ais.filter(tmp => tmp.visible).find((tmp) => {
if (UTILS.lineInRect(tmp.x2 - tmp.scale, tmp.y2 - tmp.scale, tmp.x2 + tmp.scale, tmp.y2 + tmp.scale, pjs.x, pjs.y, pjs.x, pjs.y)) {
return true;
}
});
if (finds) return false;
finds = liztobj.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, pjs.x, pjs.y, pjs.x, pjs.y)) {
return true;
}
});
if (finds) return false;
return true;
}
}
};
class Autobuy {
constructor(buyHat, buyAcc) {
this.hat = function() {
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() {
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];
}
}
}
/** CLASS CODES */
// jumpscare code warn
let tmpList = [];
// 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 traps = new Traps(UTILS, items);
let instaC = new Instakill();
let autoBuy = new Autobuy([6, 7, 22, 12, 53, 40, 15, 31, 20], [11, 13, 19, 18, 21]);
let autoUpgrade = new Autoupgrade();
let lastDeath;
let minimapData;
let mapMarker = {};
let mapPings = [];
let tmpPing;
let breakTrackers = [];
function sendChat(message) {
packet("6", message.slice(0, 30));
}
let runAtNextTick = [];
function checkProjectileHolder(x, y, dir, range, speed, indx, layer, sid) {
let weaponIndx = indx == 0 ? 9 : indx == 2 ? 12 : indx == 3 ? 13 : indx == 5 && 15;
let projOffset = config.playerScale * 2;
let projXY = {
x: indx == 1 ? x : x - projOffset * Math.cos(dir),
y: indx == 1 ? y : y - projOffset * Math.sin(dir),
};
let nearPlayer = players.filter((e) => e.visible && UTILS.getDist(projXY, e, 0, 2) <= e.scale).sort(function(a, b) {
return UTILS.getDist(projXY, a, 0, 2) - UTILS.getDist(projXY, b, 0, 2);
})[0];
if (nearPlayer) {
if (indx == 1) {
nearPlayer.shooting[53] = 1;
} else {
nearPlayer.shootIndex = weaponIndx;
nearPlayer.shooting[1] = 1;
antiProj(nearPlayer, dir, range, speed, indx, weaponIndx);
}
}
}
let projectileCount = 0;
function antiProj(tmpObj, dir, range, speed, index, weaponIndex) {
if (!tmpObj.isTeam(player)) {
tmpDir = UTILS.getDirect(player, tmpObj, 2, 2);
if (UTILS.getAngleDist(tmpDir, dir) <= 0.2) {
tmpObj.bowThreat[weaponIndex]++;
if (index == 5) {
projectileCount++;
}
setTimeout(() => {
tmpObj.bowThreat[weaponIndex]--;
if (index == 5) {
projectileCount--;
}
}, range / speed);
if (tmpObj.bowThreat[9] >= 1 && (tmpObj.bowThreat[12] >= 1 || tmpObj.bowThreat[15] >= 1)) {
place(1, tmpObj.aim2);
my.anti0Tick = 4;
if (!my.antiSync) {
antiSyncHealing(4);
}
} else {
if (projectileCount >= 2) {
place(1, tmpObj.aim2);
my.anti0Tick = 4;
if (!my.antiSync) {
antiSyncHealing(4);
}
}
}
}
}
}
// SHOW ITEM INFO:
function showItemInfo(item, isWeapon, isStoreItem) {
if (player && item) {
UTILS.removeAllChildren(itemInfoHolder);
itemInfoHolder.classList.add("visible");
UTILS.generateElement({
id: "itemInfoName",
text: UTILS.capitalizeFirst(item.name),
parent: itemInfoHolder
});
UTILS.generateElement({
id: "itemInfoDesc",
text: item.desc,
parent: itemInfoHolder
});
if (isStoreItem) {
} 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] + " x" + item.req[i + 1] + "",
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();
// MOUSE INPUT:
var usingTouch;
const mals = document.getElementById('touch-controls-fullscreen');
mals.style.display = 'block';
mals.addEventListener("mousemove", gameInput, false);
function gameInput(e) {
mouseX = e.clientX;
mouseY = e.clientY;
}
let clicks = {
left: false,
middle: false,
right: false,
};
mals.addEventListener("mousedown", mouseDown, false);
function mouseDown(e) {
if (attackState != 1) {
attackState = 1;
if (e.button == 0) {
clicks.left = true;
} else if (e.button == 1) {
clicks.middle = true;
} else if (e.button == 2) {
clicks.right = true;
}
}
}
mals.addEventListener("mouseup", UTILS.checkTrusted(mouseUp));
function mouseUp(e) {
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;
}
}
}
mals.addEventListener("wheel", wheel, false);
let wbe = 1;
function wheel(e) {
if (e.deltaY < 0) {
wbe += 0.15
maxScreenWidth = config.maxScreenWidth * wbe;
maxScreenHeight = config.maxScreenHeight * wbe;
resize()
} else {
wbe -= 0.15
maxScreenWidth = config.maxScreenWidth * wbe;
maxScreenHeight = config.maxScreenHeight * wbe;
resize()
}
}
// 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);
}
function getSafeDir() {
if (!player)
return 0;
if (!player.lockDir) {
lastDir = Math.atan2(mouseY - (screenHeight / 2), mouseX - (screenWidth / 2));
}
return lastDir || 0;
}
let plusDir = 0;
let lastSpin = Date.now();
function getAttackDir(debug) {
if (debug) {
if (!player)
return "0";
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 = getEl("weaponGrind").checked ? "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 (!player.lockDir) {
if (configs.noDir) return "undefined";
lastDir = "getSafeDir()";
}
return lastDir;
} else {
if (!player)
return 0;
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 = getEl("weaponGrind").checked ? 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 (!player.lockDir) {
if (configs.noDir) return undefined;
lastDir = getSafeDir();
}
return lastDir || 0;
}
}
function getVisualDir() {
if (!player)
return 0;
lastDir = getSafeDir();
return lastDir || 0;
}
// KEYS:
function keysActive() {
return (allianceMenu.style.display != "block" &&
chatHolder.style.display != "block" &&
!menuCBFocus);
}
function toggleMenuChat() {
if (menuChatDiv.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();
}
}
}
function keyDown(event) {
let keyNum = event.which || event.keyCode || 0;
if (player && player.alive && keysActive()) {
if (!keys[keyNum]) {
keys[keyNum] = 1;
macro[event.key] = 1;
if (keyNum == 27) {
openMenu = !openMenu;
$("#menuDiv").toggle();
$("#menuChatDiv").toggle();
} else if (keyNum == 69) {
sendAutoGather();
} else if (keyNum == 67) {
updateMapMarker();
} else if (player.weapons[keyNum - 49] != undefined) {
player.weaponCode = player.weapons[keyNum - 49];
} else if (moveKeys[keyNum]) {
sendMoveDir();
} else if (event.key == "m") {
mills.placeSpawnPads = !mills.placeSpawnPads;
} else if (event.key == "z") {
mills.place = !mills.place;
} else if (event.key == "p") {
io.send("6", "Project X Vn Music")
syncChat(getEl("songs").value);
} else if (event.key == "Z") {
typeof window.debug == "function" && window.debug();
} else if (keyNum == 32) {
packet("d", 1, getSafeDir(), 1);
packet("d", 0, getSafeDir(), 1);
} else if (event.key == ",") {
io.send("6", ':(')
project.send(JSON.stringify(["tezt", "ratio"]));
// botSkts.push([botPlayer]);
for(let i = 0; i < botz.length; i++) {
// if(botz[i][0]) {
botz[i][0].zync(near);
// console.log(botz[i][0])
}
// project.send("tezt");
// botSkts.forEach((bot) => {
// bot.zync();
// })
// io.send("S", 1)
}
}
}
}
// let xx = canvaz.width/2;
// let yy = canvaz.height/2;
// let mouze = {
// x: xx - mouzeX,
// y: yy - mouzeY
// }
// let ingamecoorformodabow = {
// x: player.x + mouze.x,
// y: player.x + mouze.x
// }
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 == ",") {
player.sync = false;
}
}
}
}
}
window.addEventListener("keyup", UTILS.checkTrusted(keyUp));
function sendMoveDir() {
if(found) {
packet("a", undefined, 1);
} else {
let newMoveDir = getMoveDir();
if (lastMoveDir == undefined || newMoveDir == undefined || Math.abs(newMoveDir - lastMoveDir) > 0.3) {
if (!my.autoPush && !found) {
packet("a", newMoveDir, 1);
}
lastMoveDir = newMoveDir;
}
}
}
// BUTTON EVENTS:
function bindEvents() {}
bindEvents();
// ITEM COUNT DISPLAY:
let isItemSetted = [];
function updateItemCountDisplay(index = undefined) {
for (let i = 3; i < items.list.length; ++i) {
let id = items.list[i].group.id;
let tmpI = items.weapons.length + i;
if (!isItemSetted[tmpI]) {
isItemSetted[tmpI] = document.createElement("div");
isItemSetted[tmpI].id = "itemCount" + tmpI;
getEl("actionBarItem" + tmpI).appendChild(isItemSetted[tmpI]);
isItemSetted[tmpI].style = `
display: block;
position: absolute;
padding-left: 5px;
font-size: 2em;
color: #fff;
`;
isItemSetted[tmpI].innerHTML = player.itemCounts[id] || 0;
} else {
if (index == id) isItemSetted[tmpI].innerHTML = player.itemCounts[index] || 0;
}
}
}
// AUTOPUSH:
function autoPush() {
let nearTrap = liztobj.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 = liztobj.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 pushAngle = Math.atan2(near.y2 - spike.y, near.x2 - spike.x)
/*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))) + Math.cos(25),
y2: spike.y + ((UTILS.getDist(near, spike, 2, 0) + player.scale) * Math.sin(UTILS.getDirect(near, spike, 2, 0))) + Math.sin(25)
};
let finds = liztobj.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 (finds) {
if (my.autoPush) {
my.autoPush = false;
packet("a", lastMoveDir || undefined, 1);
}
} else {*/
my.autoPush = true;
my.pushData = {
x: spike.x + Math.cos(pushAngle),
y: spike.y + Math.sin(pushAngle),
x2: player.x2+30,
y2: player.y2+30
};
let point = {
x: near.x2 + Math.cos(pushAngle) * 30,
y: near.y2 + Math.sin(pushAngle) * 60,
}
let dir = Math.atan2(point.y - player.y2, point.x - player.x2)
packet("a", dir, 1)
/*let scale = (player.scale / 10);
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);
} else {
packet("a", UTILS.getDirect(pos, player, 2, 2), 1);
}*/
//}
} else {
if (my.autoPush) {
my.autoPush = false;
packet("a", lastMoveDir || undefined, 1);
}
}
} else {
if (my.autoPush) {
my.autoPush = false;
packet("a", lastMoveDir || undefined, 1);
}
}
}
// 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));
}
/** APPLY SOCKET CODES */
// SET INIT DATA:
function setInitData(data) {
alliances = data.teams;
}
// 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;
liztobj.length = 0;
}
}
// ADD NEW PLAYER:
function addPlayer(data, isYou) {
let tmpPlayer = findPlayerByID(data[0]);
if (!tmpPlayer) {
tmpPlayer = new Player(data[0], data[1], config, UTILS, projectileManager,
objectManager, players, ais, items, hats, accessories);
players.push(tmpPlayer);
if (data[1] != playerSID) {
addMenuChText(null, `Found ${data[2]} {${data[1]}}`, "lime");
}
} else {
if (data[1] != playerSID) {
addMenuChText(null, `Found ${data[2]} {${data[1]}}`, "lime");
}
}
tmpPlayer.spawn(isYou ? true : null);
tmpPlayer.visible = false;
tmpPlayer.oldPos = {
x2: undefined,
y2: undefined
};
tmpPlayer.x2 = undefined;
tmpPlayer.y2 = undefined;
tmpPlayer.x3 = undefined;
tmpPlayer.y3 = undefined;
tmpPlayer.setData(data);
if (isYou) {
if (!player) {
window.prepareUI(tmpPlayer);
}
player = tmpPlayer;
camX = player.x;
camY = player.y;
my.lastDir = 0;
updateItems();
updateAge();
updateItemCountDisplay();
if (player.skins[7]) {
my.reSync = true;
}
}
}
// REMOVE PLAYER:
function removePlayer(id) {
for (let i = 0; i < players.length; i++) {
if (players[i].id == id) {
addMenuChText("Game", players[i].name + "[" + players[i].sid + "] left the game", "red");
players.splice(i, 1);
break;
}
}
}
// UPDATE HEALTH:
function updateHealth(sid, value) {
tmpObj = findPlayerBySID(sid);
if (tmpObj) {
// tmpObj.lastshamecount = tmpObj.shameCount;
tmpObj.oldHealth = tmpObj.health;
tmpObj.health = value;
tmpObj.judgeShame();
if (tmpObj.oldHealth > tmpObj.health) {
tmpObj.timeDamaged = Date.now(); //here'
tmpObj.damaged = tmpObj.oldHealth - tmpObj.health;
let damaged = tmpObj.damaged;
tmpObj = findPlayerBySID(sid);
let bullTicked = false;
if (tmpObj.health <= 0) {
if (!tmpObj.death) {
tmpObj.death = true;
if (tmpObj != player) {
if(tmpObj.skinIndex == 45) {
addMenuChText("Game", `${tmpObj.name}[${tmpObj.sid}] has died due to clown`, "red");
} else if(tmpObj.shameCount >= 5) {
addMenuChText("Game", `${tmpObj.name}[${tmpObj.sid}] has died due to high shame`, "red");
} else {
addMenuChText("Game", `${tmpObj.name}[${tmpObj.sid}] has died`, "red");
}
}
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) {
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 = 800/13
let slowHeal = function(timer) {
setTimeout(() => {
healer();
}, timer);
}
/* if(near.dist2 <= 150 && damaged >= 50 && tmpObj.shamecount < 4) {
tmpObj.addDamageThreat(player);
healer();
//healer(); //x2
antiSyncHealing(4);
// predictHeal(2)
buyEquip(6, 0);
}
if(near.dist2 <= 150 && damaged >= 60 && tmpObj.shamecount < 4) {
tmpObj.addDamageThreat(player);
healer();
// predictHeal(2)
buyEquip(6, 0);
}
if(near.dist2 <= 150 && damaged >= 80 && tmpObj.shamecount < 4) {
//tmpObj.addDamageThreat(player);
healer();
// predictHeal(2)
//healer();
antiSyncHealing(4);
// antiSyncHealing(3);
buyEquip(6, 0);
}
if(near.dist2 <= 150 && damaged >= 30 && tmpObj.shamecount < 4) {
//tmpObj.addDamageThreat(player);
healer();
// predictHeal(2)
//healer();
antiSyncHealing(4);
//antiSyncHealing(3);
//buyEquip(6, 0);
}*/
if (near.length && near.damageThreat(player) - (player.canEmpAnti || player.empAnti ? 25 : 0) >= 85) {
player.canEmpAnti = true;
player.antiTimer = game.tick;
let shame = 4;
if (player.shameCount < shame) {
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;
}
}
} else {
tmpObj.timeHealed = Date.now(); //
// game.tickBase(() => {
// }, 2)
}
if (tmpObj.health <= 0) {
bots.forEach((hmm) => {
hmm.whyDie = tmpObj.name;
});
}
}
}
// KILL PLAYER:
function killPlayer() {
inGame = false;
lastDeath = {
x: player.x,
y: player.y,
};
}
// UPDATE PLAYER ITEM VALUES:
function updateItemCounts(index, value) {
if (player) {
player.itemCounts[index] = value;
updateItemCountDisplay(index);
}
}
// 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 && (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 && (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();
}
}
// KILL OBJECT:
function killObject(sid) {
let findObj = findObjectBySid(sid);
objectManager.disableBySid(sid);
if (player) {
for (let i = 0; i < breakObjects.length; i++) {
if (breakObjects[i].sid == sid) {
breakObjects.splice(i, 1);
break;
}
}
if (!player.canSee(findObj)) {
breakTrackers.push({
x: findObj.x,
y: findObj.y
});
}
if (breakTrackers.length > 8) {
breakTrackers.shift();
}
traps.replacer(findObj);
}
}
// KILL ALL OBJECTS BY A PLAYER:
function killObjects(sid) {
if (player) objectManager.removeAllItems(sid);
}
function setTickout(doo, timeout) {
if (!ticks.manage[ticks.tick + timeout]) {
ticks.manage[ticks.tick + timeout] = [doo];
} else {
ticks.manage[ticks.tick + timeout].push(doo);
}
}
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;
}
}
let found = false;
let autoQ = false;
let autos = {
insta: {
todo: false,
wait: false,
count: 4,
shame: 5
},
bull: false,
antibull: 0,
reloaded: false,
stopspin: true
}
// UPDATE PLAYER DATA:
function updatePlayers(data) {
// if(player.shameCount > 0) {
// my.reSync = true;
// } else {
// my.reSync = false;
// }
// let movementPrediction = {
// x: player.x2 + (player.oldPos.x2 - player.x2) * -1,
// y: player.y2 + (player.oldPos.y2 - player.y2) * -1,
// }
// let potentialzpiketick = liztobj.filter((e) => e.active && e.dmg)
// potentialzpiketick.forEach((obj) => {
// if(cdf(obj, player) <= 200) {
// packet('a', undefined);
// }
// })
// let newPos = {
// x: player.x2 + (tracker.lastPos.x - player.x2) * -1,
// y: player.y2 + (tracker.lastPos.y - player.y2) * -1,
// }
function getAngleDifference(angle1, angle2) {
// Normalize the angles to be between 0 and 2π
angle1 = angle1 % (2 * Math.PI);
angle2 = angle2 % (2 * Math.PI);
// Calculate the absolute difference between the angles
let diff = Math.abs(angle1 - angle2);
// Adjust the difference to be between 0 and π
if (diff > Math.PI) {
diff = (2 * Math.PI) - diff;
}
return diff;
}
// function smartMove(oneTickMove) {
// let dir = player.moveDir;
// let found = false
// let buildings = liztobj.sort((a, b) => Math.hypot(player.y2 - a.y, player.x2 - a.x) - Math.hypot(player.y2 - b.y, player.x2 - b.x))
// let spikes = buildings.filter(obj => obj.dmg && cdf(player, obj) < 250 && !obj.isTeamObject(player) && obj.active)
// let newPos = {
// x: player.x2 + (player.x2 - player.oldPos.x2) * 1.2 + (Math.cos(dir) * 50),
// y: player.y2 + (player.y2 - player.oldPos.y2) * 1.2 + (Math.sin(dir) * 50),
// }
// for (let i = 0; i < spikes.length; i++) {
// if (cdf(spikes[i], newPos) < spikes[i].scale + player.scale + 3) {
// found = Math.atan2(player.y2 - spikes[i].y, player.x2 - spikes[i].x)
// }
// }
// if (found != false && !traps.inTrap) {
// packet("a", undefined);
// } else {
// packet("a", dir);
// }
// player.oldPos.x2 = player.x2;
// player.oldPos.y2 = player.y2;
// }
// function detectEnemySpikeCollisions(tmpObj) {
// let buildings = liztobj.sort((a, b) => Math.hypot(tmpObj.y - a.y, tmpObj.x - a.x) - Math.hypot(tmpObj.y - b.y, tmpObj.x - b.x));
// let spikes = buildings.filter(obj => obj.dmg && cdf(player, obj) < 200 && !obj.isTeamObject(player) && obj.active);
// //here you calculate last vel / delta, add that to current pos, if touch spike do the heh
// let enemy = {
// // x: tmpObj.x + (player.oldPos.x2 - tmpObj.x) * -2,
// // y: tmpObj.y + (player.oldPos.y2 - tmpObj.y) * -2,
// x: player.x2 + (player.oldPos.x2 - player.x2) * -1,
// y: player.y2 + (player.oldPos.y2 - player.y2) * -1,
// }
// let found = false;
// for (let i = 0; i < spikes.length; i++) {
// if (cdf(enemy, spikes[i]) < player.scale + spikes[i].scale) {
// found = true;
// }
// }
// // player.oldPos.x2 = tmpObj.x2;
// // player.oldPos.y2 = tmpObj.y2;
// }
game.tick++;
enemy = [];
nears = [];
near = [];
game.tickSpeed = performance.now() - game.lastTick;
game.lastTick = performance.now();
players.forEach((tmp) => {
tmp.forcePos = !tmp.visible;
tmp.visible = false;
if((tmp.timeHealed - tmp.timeDamaged)>0 && tmp.lastshamecount {
bot.showName = 'YEAHHH'
})
for(let i = 0; i < players.length; i++) {
for(let aa = 0; aa < botSkts.length; aa++) {
if(player.id === aa.id) aa.showName = 'YEAHHHHHH'
}
}
if (player.shameCount < 4 && near.dist3 <= 300 && near.reloads[near.primaryIndex] <= game.tickRate * (window.pingTime >= 200 ? 2 : 1)) {
autoQ = true;
healer();
} else {
if (autoQ) {
healer();
}
autoQ = false;
}
if (tmpObj == player) {
if (liztobj.length) {
liztobj.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 nearTrap = liztobj.filter(e => e.trap && e.active && UTILS.getDist(e, tmpObj, 0, 2) <= (tmpObj.scale + e.getScale() + 25) && !e.isTeamObject(tmpObj)).sort(function(a, b) {
return UTILS.getDist(a, tmpObj, 0, 2) - UTILS.getDist(b, tmpObj, 0, 2);
})[0];
if (nearTrap) {
let spike = gameObjects.filter(obj => obj.dmg && cdf(tmpObj, obj) <= tmpObj.scale + nearTrap.scale/2 && !obj.isTeamObject(tmpObj) && obj.active)[0]
traps.dist = UTILS.getDist(nearTrap, tmpObj, 0, 2);
traps.aim = UTILS.getDirect(spike ? spike : nearTrap, tmpObj, 0, 2);
// traps.dist = UTILS.getDist(nearTrap, tmpObj, 0, 2);
// traps.aim = UTILS.getDirect(nearTrap, tmpObj, 0, 2);
traps.protect(caf(nearTrap, tmpObj) - Math.PI);
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;
}
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);
}
});
if (num2 > 0) {
textManager.showText(pos2.x, pos2.y, Math.max(45, Math.min(50, num2)), 0.18, 500, num2, "#8ecc51");
}
if (num > 0) {
textManager.showText(pos.x, pos.y, Math.max(45, Math.min(50, num)), 0.18, 500, num, "#fff");
}
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);
}
});*/
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;
}
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 = false;
//modLog("EmpAnti");
} else {
player.empAnti = false;
player.soldierAnti = true;
//modLog("SoldierAnti");
}
}
}
let prehit = liztobj.filter(tmp => tmp.dmg && tmp.active && tmp.isTeamObject(player) && UTILS.getDist(tmp, near, 0, 3) <= (tmp.scale + near.scale)).sort(function(a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b, near, 0, 2);
})[0];
if (prehit) {
if (near.dist3 <= items.weapons[player.weapons[0]].range + player.scale * 1.8 && configs.predictTick) {
instaC.canSpikeTick = true;
instaC.syncHit = true;
if (configs.revTick && player.weapons[1] == 15 && player.reloads[53] == 0 && instaC.perfCheck(player, near)) {
instaC.revTick = true;
}
}
}
let antiSpikeTick = liztobj.filter(tmp => tmp.dmg && tmp.active && !tmp.isTeamObject(player) && UTILS.getDist(tmp, player, 0, 3) < (tmp.scale + player.scale)).sort(function(a, b) {
return UTILS.getDist(a, player, 0, 2) - UTILS.getDist(b, player, 0, 2);
})[0];
if (antiSpikeTick && !traps.inTrap) {
if (near.dist3 <= items.weapons[5].range + near.scale * 1.8) {
my.anti0Tick = 1;
// player.chat.message = "Anti Vel SpikeTick " + near.sid;
//player.chat.count = 2000;
}
}
}
/*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 = useWasd ? false : instaC.canSpikeTick ? false : true;
} else {
instaC.nobull = false;
}
instaC.can = true;
} else {
instaC.can = false;
}*/
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)) {
instaC.nobull = false;
instaC.can = true;
} else {
instaC.can = false;
}
let nearTrap = gameObjects.filter(e => e.trap && e.active && e.isTeamObject(player) && UTILS.getDist(e, near, 0, 2) <= (near.scale + e.getScale() + 5)).sort(function(a, b) {
return UTILS.getDist(a, near, 0, 2) - UTILS.getDist(b, near, 0, 2);
})[0];
if(nearTrap && near.skinIndex == 6) {
setTimeout(() => {
instaC.can = true;
instaC.nobull = false;
}, items.weapons[near.weaponIndex] - near.reloads[near.weaponIndex] + near.pinge)
}
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 % 1 == 0) {
if (mills.place) {
let plcAng = 7.7;
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) {
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 ([1, 2, 3, 4, 5, 6].includes(player.weapons[0]) && player.reloads[player.weapons[1]] == 0 && !instaC.isTrue) {
instaC.changeType("rev");
chch(null, "[RevSyncHit]", "yellow");
}
} else {
if ([1, 2, 3, 4, 5, 6].includes(player.weapons[0]) && player.reloads[player.weapons[0]] == 0 && !instaC.isTrue) {
instaC.spikeTickType();
if (instaC.syncHit) {
chch(null, "[SyncHit]", "yellow");
}
}
}
}
if (!clicks.middle && (clicks.left || clicks.right) && !instaC.isTrue) {
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);
}
}
if (useWasd && !clicks.left && !clicks.right && !instaC.isTrue && near.dist2 <= (items.weapons[player.weapons[0]].range + near.scale * 1.8) && !traps.inTrap) {
if ((player.weaponIndex != player.weapons[0]) || player.buildIndex > -1) {
selectWeapon(player.weapons[0]);
}
if (player.reloads[player.weapons[0]] == 0 && !my.waitHit) {
sendAutoGather();
my.waitHit = 1;
game.tickBase(() => {
sendAutoGather();
my.waitHit = 0;
}, 1);
}
}
if (traps.inTrap) {
if (!clicks.left && !clicks.right && !instaC.isTrue) {
if (player.weaponIndex != (traps.notFast() ? player.weapons[1] : player.weapons[0]) || player.buildIndex > -1) {
selectWeapon(traps.notFast() ? player.weapons[1] : player.weapons[0]);
}
if (player.reloads[traps.notFast() ? player.weapons[1] : player.weapons[0]] == 0 && !my.waitHit) {
sendAutoGather();
my.waitHit = 1;
game.tickBase(() => {
sendAutoGather();
my.waitHit = 0;
}, 1);
}
}
}
if (clicks.middle && !traps.inTrap) {
if (!instaC.isTrue && player.reloads[player.weapons[1]] == 0) {
if (my.ageInsta && player.weapons[0] != 4 && player.weapons[1] == 9 && player.age >= 9 && enemy.length) {
instaC.bowMovement();
} else {
instaC.rangeType();
}
}
}
if (macro.t && !traps.inTrap) {
if (!instaC.isTrue && player.reloads[player.weapons[0]] == 0 && (player.weapons[1] == 15 ? (player.reloads[player.weapons[1]] == 0) : true) && (player.weapons[0] == 5 || (player.weapons[0] == 4 && player.weapons[1] == 15))) {
instaC[(player.weapons[0] == 4 && player.weapons[1] == 15) ? "kmTickMovement" : "tickMovement"]();
}
}
if (macro["."] && !traps.inTrap) {
if (!instaC.isTrue && player.reloads[player.weapons[0]] == 0 && ([9, 12, 13, 15].includes(player.weapons[1]) ? (player.reloads[player.weapons[1]] == 0) : true)) {
instaC.boostTickMovement();
}
}
if (player.weapons[1] && !clicks.left && !clicks.right && !traps.inTrap && !instaC.isTrue && !(useWasd && near.dist2 <= items.weapons[player.weapons[0]].range + near.scale * 1.8)) {
if (player.reloads[player.weapons[0]] == 0 && player.reloads[player.weapons[1]] == 0) {
if (!my.reloaded) {
my.reloaded = true;
let fastSpeed = items.weapons[player.weapons[0]].spdMult < items.weapons[player.weapons[1]].spdMult ? 1 : 0;
if (player.weaponIndex != player.weapons[fastSpeed] || player.buildIndex > -1) {
selectWeapon(player.weapons[fastSpeed]);
}
}
// if(useWasd) {
// if (!autos.stopspin) {
// setTimeout(()=>{
// autos.stopspin = true;
// }, 375);
// }
// }
} else {
my.reloaded = false;
if(useWasd) {
autos.stopspin = 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) {
if (player.weaponIndex != player.weapons[1] || player.buildIndex > -1) {
selectWeapon(player.weapons[1]);
}
if(useWasd) {
if (!autos.stopspin) {
setTimeout(()=>{
autos.stopspin = true;
}, 750);
}
}
}
}
}
if (!instaC.isTrue && !traps.inTrap && !traps.replaced) {
traps.autoPlace();
}
if (!macro.q && !macro.f && !macro.v && !macro.h && !macro.n) {
packet("D", getAttackDir());
}
let hatChanger = function() {
if (my.anti0Tick > 0) {
buyEquip(6, 0);
} else {
if (clicks.left || clicks.right) {
if (clicks.left) {
buyEquip(player.reloads[player.weapons[0]] == 0 ? getEl("weaponGrind").checked ? 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.right) {
buyEquip(player.reloads[clicks.right && player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0]] == 0 ? 40 : (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 (traps.inTrap) {
// let zpikez = liztobj.filter(tmp => tmp.dmg && 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 (near.dist3 <= 300 && traps.info.health <= 300) {
// if (!zpikez.length)
// buyEquip(6, 0);
// else if (traps.info.health <= items.weapons[player.weaponIndex].dmg ? false : (player.reloads[traps.notFast() ? player.weapons[1] : player.weapons[0]] == 0))
// buyEquip(40, 0);
// } else if (traps.info.health <= items.weapons[player.weaponIndex].dmg ? false : (player.reloads[traps.notFast() ? player.weapons[1] : player.weapons[0]] == 0)) {
// buyEquip(40, 0);
// } else {
// buyEquip((player.empAnti) ? 22 : 6, 0);
// }
if (traps.info.health <= items.weapons[player.weaponIndex].dmg ? false : (player.reloads[player.weapons[1] == 10 ? player.weapons[1] : player.weapons[0]] == 0)) {
if (near.dist3 <= 300 && traps.info.health <= 300 && items.weapons[near.weapons[0]] == 0) {
buyEquip(6, 0);
} else {
buyEquip(40, 0);
}
} else {
buyEquip(6, 0);
}
} else {
if (player.empAnti) {
buyEquip(player.empAnti ? 22 : 6, 0);
} else {
buyEquip(6, 0);
}
}
}
}
let accChanger = function() {
if(near.dist2 <= 300){
buyEquip(0, 1);
}
else if(clicks.left){
buyEquip(0, 1);
}
else {
buyEquip(11, 1);
}
}
let wasdGears = function() {
if (my.anti0Tick > 0) {
buyEquip(6, 0);
} else {
if (clicks.left || clicks.right) {
if (clicks.left) {
buyEquip(player.reloads[player.weapons[0]] == 0 ? getEl("weaponGrind").checked ? 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) {
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 > 4320 && (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 > 4320 && (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(0, 1);
}
} else if (near.dist2 <= items.weapons[player.weapons[0]].range + near.scale * 1.8 && !traps.inTrap) {
buyEquip(0, 1);
} else if (traps.inTrap) {
buyEquip(0, 1);
} else {
buyEquip(11, 1);
}
}
if (storeMenu.style.display != "block" && !instaC.isTrue && !instaC.ticking) {
if (useWasd) {
wasdGears();
} else {
hatChanger();
accChanger();
}
}
//lastMoveDir = getSafeDir();
//packet("a", lastMoveDir, 1);
if (configs.autoPush && enemy.length && !traps.inTrap && !instaC.ticking) {
autoPush();
} else {
if (my.autoPush) {
my.autoPush = false;
packet("a", lastMoveDir || undefined, 1);
}
}
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) {
my.anti0Tick--;
}
if (traps.replaced) {
traps.replaced = false;
}
if (traps.antiTrapped) {
traps.antiTrapped = false;
}
const getPotentialDamage = (build, user) => {
const weapIndex = user.weapons[1] === 10 && !player.reloads[user.weapons[1]] ? 1 : 0;
const weap = user.weapons[weapIndex];
if (player.reloads[weap]) return 0;
const weapon = items.weapons[weap];
const inDist = cdf(build, user) <= build.getScale() + weapon.range;
return (user.visible && inDist) ? weapon.dmg * (weapon.sDmg || 1) * 3.3 : 0;
};
const AutoReplace = () => {
const replaceable = [];
const playerX = player.x;
const playerY = player.y;
const gameObjectCount = gameObjects.length;
for (let i = 0; i < gameObjectCount; i++) {
const build = gameObjects[i];
if (build.isItem && build.active && build.health > 0) {
const item = items.list[build.id];
const posDist = 35 + item.scale + (item.placeOffset || 0);
const inDistance = cdf(build, player) <= posDist * 2;
if (inDistance) {
let canDeal = 0;
const playersCount = players.length;
for (let j = 0; j < playersCount; j++) {
canDeal += getPotentialDamage(build, players[j]);
}
if (build.health <= canDeal) {
replaceable.push(build);
}
}
}
}
const findPlacementAngle = (player, itemId, build) => {
if (!build) return null;
const MAX_ANGLE = 2 * Math.PI;
const ANGLE_STEP = Math.PI / 360;
const item = items.list[player.items[itemId]];
let buildingAngle = Math.atan2(build.y - player.y, build.x - player.x);
let tmpS = player.scale + (item.scale || 1) + (item.placeOffset || 0);
for (let offset = 0; offset < MAX_ANGLE; offset += ANGLE_STEP) {
let angles = [(buildingAngle + offset) % MAX_ANGLE, (buildingAngle - offset + MAX_ANGLE) % MAX_ANGLE];
for (let angle of angles) {
return angle;
}
}
return null;
};
const replace = (() => {
let nearTrap = liztobj.filter(tmp => tmp.trap && tmp.active && tmp.isTeamObject(player) && cdf(tmp, player) <= tmp.getScale() + 5);
let spike = gameObjects.find(tmp => tmp.dmg && tmp.active && tmp.isTeamObject(player) && cdf(tmp, player) < 87 && !nearTrap.length);
const buildId = spike ? 4 : 2;
replaceable.forEach(build => {
let angle = findPlacementAngle(player, buildId, build);
if (angle !== null) {
place(buildId, angle);
textManager.showText(build.x, build.y, 20, 0.15, 1850, '⭐', '#fff', 2);
}
});
});
if (near && near.dist3 <= 360) {
replace();
}
replace;
}
}
}
if (botSkts.length) {
botSkts.forEach((bots) => {
if (true) {
bots[0].showName = 'YEAHHH';
}
});
}
}
for(var i1 = 0; i1 < liztobj.length; i1++) {
if (liztobj[i1].active && liztobj[i1].health > 0 && UTILS.getDist(liztobj[i1], player, 0, 2) < 150 && getEl("antipush").checked) { // || liztobj[i1].buildHealth <= items.weapons[nearEnemy.weaponIndex].dmg)
if(liztobj[i1].name.includes("spike") && liztobj[i1]){
if(liztobj[i1].owner.sid != player.sid && clicks.left == false && tmpObj.reloads[tmpObj.secondaryIndex] == 0){
selectWeapon(player.weapons[1])
buyEquip(40, 0);
packet("D", UTILS.getDirect(liztobj[i1], player, 0, 2))
setTickout( () => {
buyEquip(6, 0)
}, 1);
}
}
}
}
function ez(context, x, y) {
context.fillStyle = "rgba(0, 255, 255, 0.2)";
context.beginPath();
context.arc(x, y, 55, 0, Math.PI * 2);
context.fill();
context.closePath();
context.globalAlpha = 1;
}
// UPDATE LEADERBOARD:
function updateLeaderboard(data) {
lastLeaderboardData = data;
return;
UTILS.removeAllChildren(leaderboardData);
let tmpC = 1;
for (let i = 0; i < data.length; i += 3) {
(function(i) {
UTILS.generateElement({
class: "leaderHolder",
parent: leaderboardData,
children: [
UTILS.generateElement({
class: "leaderboardItem",
style: "color:" + ((data[i] == playerSID) ? "#fff" : "rgba(255,255,255,0.6)"),
text: tmpC + ". " + (data[i + 1] != "" ? data[i + 1] : "unknown")
}),
UTILS.generateElement({
class: "leaderScore",
text: UTILS.sFormat(data[i + 2]) || "0"
})
]
});
})(i);
tmpC++;
}
}
// 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;
}
}
}
// 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(player.damageThreat >= 100 && cdf(player, tmpObj) <= 300)
// healer();
//smart anti insta auto q
if (tmpObj == near && configs.smartantiinsta && tmpObj.dist2 <= 250) {
let weaponName = items.weapons[index].name;
if (weaponName == "polearm") {
buyEquip(1, 6);
if (tmpObj.damaged > 0) {
//storeEquip(1, 22);
if (tmpObj.damaged > 0) {
healer();
// predictHeal(2/2)
antiSyncHealing(3/3)
// selectWeapon(player.weapons[0]);
// storeEquip(1, 11);
// storeEquip(18, 1);
// sendAutoGather();
//sendAutoGather();
}
}
}
if (weaponName == "short sword") {
buyEquip(1, 6);
if (tmpObj.damaged > 0) {
// buyEquip(1, 22);
if (tmpObj.damaged > 0) {
healer();
// predictHeal(2)
// selectWeapon(player.weapons[0]);
// buyEquip(1, 11);
// buyEquip(18, 1);
// sendAutoGather();
// sendAutoGather();
}
}
}
if (weaponName == "musket") {
buyEquip(1, 6);
if (tmpObj.damaged > 0) {
//storeEquip(1, 22);
if (tmpObj.damaged > 0) {
healer();
// predictHeal(2)
antiSyncHealing(5/5)
antiSyncHealing(4/5)
// selectWeapon(player.weapons[0]);
// storeEquip(1, 11);
// storeEquip(18, 1);
// sendAutoGather();
//sendAutoGather();
}
}
}
if (weaponName == "short sword") {
buyEquip(1, 6);
if (tmpObj.damaged > 0) {
// buyEquip(1, 22);
if (tmpObj.damaged > 0) {
healer();
// predictHeal(2)
antiSyncHealing(1)
// selectWeapon(player.weapons[0]);
// buyEquip(1, 11);
// buyEquip(18, 1);
// sendAutoGather();
// sendAutoGather();
}
}
}
if (weaponName == "katana") {
buyEquip(1, 6);
if (tmpObj.damaged > 0) {
//storeEquip(1, 22);
if (tmpObj.damaged > 0) {
// healer();
// predictHeal(2)
// selectWeapon(player.weapons[0]);
// storeEquip(1, 11);
// storeEquip(18, 1);
// sendAutoGather();
//sendAutoGather();
}
}
}
if (weaponName == "hammer") {
buyEquip(1, 6);
if (tmpObj.damaged > 0) {
//storeEquip(1, 22);
if (tmpObj.damaged > 0) {
healer();
// predictHeal(2)
// selectWeapon(player.weapons[0]);
// storeEquip(1, 11);
// storeEquip(18, 1);
// sendAutoGather();
//sendAutoGather();
}
}
}
}
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);
}
}
}
// WIGGLE GAME OBJECT:
function wiggleGameObject(dir, sid) {
tmpObj = findObjectBySid(sid);
if (tmpObj) {
tmpObj.xWiggle += config.gatherWiggle * Math.cos(dir);
tmpObj.yWiggle += config.gatherWiggle * Math.sin(dir);
if (tmpObj.health) {
objectManager.hitObj.push(tmpObj);
}
}
}
// 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);
}
}
// UPDATE PLAYER VALUE:
function updatePlayerValue(index, value, updateView) {
if (player) {
player[index] = value;
if (index == "points") {
if (configs.autoBuy) {
autoBuy.hat();
autoBuy.acc();
}
} else if (index == "kills") {
// Woah Credits To Zod324Myers https://www.youtube.com/@Zod324myers
if (configs.killChat) {
sendChat("Auto-GG Project X Remake++");
setTimeout(() => {
sendChat("Project X V8 Remake");
}, 1500);
}
}
}
}
// 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;
let actionBarItem = getEl("actionBarItem" + tmpI);
actionBarItem.style.display = player.items.indexOf(items.list[i].id) >= 0 ? "inline-block" : "none";
// Add shadow to the element
// actionBarItem.style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.5)";
document.getElementsByTagName('button').style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.5)";
}
for (let i = 0; i < items.weapons.length; i++) {
let actionBarItem = getEl("actionBarItem" + i);
actionBarItem.style.display = player.weapons[items.weapons[i].type] == items.weapons[i].id ? "inline-block" : "none";
// Add shadow to the element
// actionBarItem.style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.5)";
document.getElementsByTagName('button').style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.5)";
}
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);
}
}
}
// lol this useless,,, fr
let noob = false;
let serverReady = true;
var isProd = location.hostname !== "127.0.0.1" && !location.hostname.startsWith("192.168.");
let wssws = isProd ? "wss" : "ws";
let project = new WebSocket(`${wssws}://beautiful-sapphire-toad.glitch.me`);
let withSync = false;
project.binaryType = "arraybuffer";
project.onmessage = function(msg) {
let data = msg.data;
if (data == "isready") {
serverReady = true;
}
if (data == "fine") {
noob = false;
}
if (data == "tezt") {
addMenuChText(`${player.name}[${player.sid}]`, 'EEEEEEEEEEE', "white");
}
if (data == "yeswearesyncer") {
// let delay = Date.now() - wsDelay;
withSync = true;
if (player) {
textManager.showText(player.x, player.y, 35, 0.1, 500, "Sync: " + window.pingTime + "ms", "#fff");
console.log("synced!!!!!!!! also delay: " + window.pingTime + "ms");
}
}
};
project.onopen = function() {
var gameTitle = getEl("gameName");
// gameTitle.innerText = ("Rev v3");
};
// SHOW ALLIANCE MENU:
function allianceNotification(sid, name) {
let findBotSID = findSID(bots, sid);
if (findBotSID) {}
}
function setPlayerTeam(team, isOwner) {
if (player) {
player.team = team;
player.isOwner = isOwner;
if (team == null)
alliancePlayers = [];
}
}
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;
}
}
}
let Nobody = [{
say: "Children used to run and play",
time: 15725
}, {
say: "Look at all this mess we made",
time: 18600
}, {
say: "Guess i never know",
time: 21500
}, {
say: "It went wrong",
time: 23000
}, {
say: "Sometimes i feel like all",
time: 27500
}, {
say: "That's said",
time: 28500
}, {
say: "Goes viral then people forget",
time: 30500
}, {
say: "In this crazy world",
time: 33500
}, {
say: "I don't belong",
time: 34800
}, {
say: "I see fire burning",
time: 39000
}, {
say: "But i close my eyes",
time: 41000
}, {
say: "(I'd rather deny that)",
time: 43300
}, {
say: "Everything is falling",
time: 45000
}, {
say: "Out of place",
time: 46700
}, {
say: "I see trees ripped",
time: 50000
}, {
say: "From the ground but",
time: 52200
}, {
say: "Nobody makes a sound",
time: 54050
}, {
say: "I see fire burning",
time: 57000
}, {
say: "But i'm fine",
time: 59000
}, {
say: "Now i am nobody",
time: 61000
}, {
say: "Now i am nobody",
time: 73000
}, {
say: "The future feels so unsure",
time: 99500
}, {
say: "Didin't we deserve more",
time: 102600
}, {
say: "The burden that you left",
time: 105500
}, {
say: "Is too heavy for me",
time: 106900
}, {
say: "Do you ever feel like",
time: 111300
}, {
say: "The world will die out",
time: 113000
}, {
say: "My anxiety's off",
time: 114400
}, {
say: "The roof i cry out",
time: 115800
}, {
say: "We have gone too far",
time: 117400
}, {
say: "Take me back right now",
time: 118800
}, {
say: "I see fire burning",
time: 123000
}, {
say: "But i close my eyes",
time: 125000
}, {
say: "(I'd rather deny that)",
time: 127300
}, {
say: "Everything is falling",
time: 129000
}, {
say: "Out of place",
time: 131000
}, {
say: "I see trees ripped",
time: 134000
}, {
say: "From the ground but",
time: 135500
}, {
say: "Nobody makes a sound",
time: 138000
}, {
say: "I see fire burning",
time: 141000
}, {
say: "But i'm fine",
time: 143000
}, {
say: "Now i am nobody",
time: 145000
}, {
say: "Now i am nobody",
time: 169000,
end: true
}, ];
let Ae86 = [{
say: "I'm burning",
time: 39800
}, {
say: "Wanna fell your power",
time: 41300
}, {
say: "Right into my veins",
time: 43000
}, {
say: "Come, racer",
time: 46300
}, {
say: "Cross the fire",
time: 47800
}, {
say: "Pushing on the gas",
time: 49000
}, {
say: "So come on",
time: 52600
}, {
say: "So come on,",
time: 53900
}, {
say: "The drift is on my mind!",
time: 55700
}, {
say: "AE eighity Speedy 86",
time: 58600
}, {
say: "Every road is on fire!",
time: 62000
}, {
say: "'Cause i can't stop driving",
time: 64000
}, {
say: "With my 86",
time: 66700
}, {
say: "Anybody will be around me",
time: 68200
}, {
say: "AE eighity Speedy 86",
time: 71200
}, {
say: "See my speed is getting higher",
time: 74900
}, {
say: "'Cause i can't stop driving",
time: 77000
}, {
say: "Go go 86",
time: 79400
}, {
say: "Anybody will be around me",
time: 81000
}, {
say: "Your body",
time: 97300
}, {
say: "Burning like a flame",
time: 98800
}, {
say: "Engine will be fly",
time: 100300
}, {
say: "My racer",
time: 103750
}, {
say: "Can you hear me?",
time: 105300
}, {
say: "Listen to me now!",
time: 106750
}, {
say: "So come on",
time: 110000
}, {
say: "So come on,",
time: 111700
}, {
say: "The drift is on my mind!",
time: 113000
}, {
say: "AE eighity Speedy 86",
time: 116000
}, {
say: "Every road is fire!",
time: 119750
}, {
say: "'Cause i can't stop driving",
time: 121750
}, {
say: "With my 86",
time: 124150
}, {
say: "Anybody will be around me",
time: 126000
}, {
say: "AE eighity Speedy 86",
time: 129000
}, {
say: "See my speed is getting higher",
time: 132250
}, {
say: "'Cause i can't stop driving",
time: 134750
}, {
say: "Go go 86",
time: 137000
}, {
say: "Anybody will be around me",
time: 138750
}, {
say: "So come on",
time: 219000
}, {
say: "So come on,",
time: 220500
}, {
say: "The drift is on my mind!",
time: 222000
}, {
say: "AE eighity go go 86",
time: 225000
}, {
say: "Every road is fire!",
time: 228500
}, {
say: "'Cause i can't stop driving",
time: 230750
}, {
say: "With my 86",
time: 233000
}, {
say: "Anybody will be around me",
time: 234750
}, {
say: "AE eighity Speedy 86",
time: 237750
}, {
say: "See my speed is getting higher",
time: 241200
}, {
say: "'Cause i can't stop driving",
time: 243500
}, {
say: "Go go 86",
time: 245900
}, {
say: "Anybody will be around me",
time: 247500,
end: true
}, ];
let DontStandSoClose = [{
say: "Oh oh ooooh",
time: 2500
}, {
say: "Oh we begin",
time: 4750
}, {
say: "We'll be together",
time: 15500
}, {
say: "till the morning light",
time: 16750
}, {
say: "Don't stand so",
time: 18750
}, {
say: "don't stand so",
time: 20500
}, {
say: "Don't stand so close to me",
time: 22000
}, {
say: "Baby you belong to me",
time: 37000
}, {
say: "Yes you do, yes you do",
time: 40000
}, {
say: "You're my affection",
time: 41750
}, {
say: "I can make a woman cry",
time: 43000
}, {
say: "Yes I do, yes I do",
time: 46250
}, {
say: "I well be good",
time: 47750
}, {
say: "You're like a cruel device",
time: 49750
}, {
say: "Your blood is cold like ice",
time: 51000
}, {
say: "Poison for my veins,",
time: 52500
}, {
say: "I'm breaking my chains",
time: 54000
}, {
say: "One look and you can kill",
time: 55750
}, {
say: "my pain now is your thrill",
time: 57250
}, {
say: "Your love is for me",
time: 58750
}, {
say: "I say",
time: 61000
}, {
say: "Try me",
time: 61750
}, {
say: "take a chance on emotions",
time: 62750
}, {
say: "For now and ever",
time: 64750
}, {
say: "close to your heart",
time: 66000
}, {
say: "I say",
time: 67000
}, {
say: "Try me",
time: 67750
}, {
say: "take a chance on my passion",
time: 68750
}, {
say: "We'll be together all the time",
time: 71000
}, {
say: "I say",
time: 73250
}, {
say: "Try me",
time: 74000
}, {
say: "take a chance on emotions",
time: 75000
}, {
say: "For now and ever",
time: 77000
}, {
say: "into my heart",
time: 78500
}, {
say: "I say",
time: 79250
}, {
say: "Try me",
time: 80000
}, {
say: "take a chance on my passion",
time: 81000
}, {
say: "We'll be together",
time: 83250
}, {
say: "till the morning light",
time: 84500
}, {
say: "Don't stand so",
time: 86750
}, {
say: "don't stand so",
time: 88000
}, {
say: "Don't stand so close to me",
time: 89500
}, {
say: "Baby let me take control",
time: 104750
}, {
say: "Yes I do, yes I do",
time: 107750
}, {
say: "You are my target",
time: 109250
}, {
say: "No one ever made me cry",
time: 111000
}, {
say: "What you do, what you do",
time: 114000
}, {
say: "Baby's so bad",
time: 115500
}, {
say: "You're like a cruel device",
time: 117250
}, {
say: "Your blood is cold like ice",
time: 118500
}, {
say: "Poison for my veins,",
time: 120250
}, {
say: "I'm breaking my chains",
time: 121750
}, {
say: "One look and you can kill",
time: 123000
}, {
say: "my pain now is your thrill",
time: 124750
}, {
say: "Your love is for me",
time: 126500
}, {
say: "I say",
time: 128500
}, {
say: "Try me",
time: 129250
}, {
say: "take a chance on emotions",
time: 130250
}, {
say: "For now and ever",
time: 132750
}, {
say: "close to your heart",
time: 133750
}, {
say: "I say",
time: 134750
}, {
say: "Try me",
time: 135500
}, {
say: "take a chance on my passion",
time: 136500
}, {
say: "We'll be together all the time",
time: 138750
}, {
say: "I say",
time: 141000
}, {
say: "Try me",
time: 141750
}, {
say: "take a chance on emotions",
time: 142750
}, {
say: "For now and ever",
time: 145000
}, {
say: "into my heart",
time: 146000
}, {
say: "I say",
time: 147000
}, {
say: "Try me",
time: 147750
}, {
say: "take a chance on my passion",
time: 148750
}, {
say: "We'll be together",
time: 151000
}, {
say: "till the morning light",
time: 152250
}, {
say: "Don't stand so",
time: 154250
}, {
say: "don't stand so",
time: 155750
}, {
say: "Don't stand so close to me",
time: 157000
}, {
say: "I say",
time: 184000
}, {
say: "Try me",
time: 184750
}, {
say: "take a chance on emotions",
time: 185500
}, {
say: "For now and ever",
time: 188000
}, {
say: "close to your heart",
time: 189000
}, {
say: "I say",
time: 190000
}, {
say: "Try me",
time: 190750
}, {
say: "take a chance on my passion",
time: 192750
}, {
say: "We'll be together all the time",
time: 194000
}, {
say: "I say",
time: 196250
}, {
say: "Try me",
time: 197000
}, {
say: "take a chance on emotions",
time: 198000
}, {
say: "For now and ever",
time: 200250
}, {
say: "into my heart",
time: 201250
}, {
say: "I say",
time: 202500
}, {
say: "Try me",
time: 203250
}, {
say: "take a chance on my passion",
time: 204000
}, {
say: "We'll be together",
time: 206500
}, {
say: "till the morning light",
time: 207500
}, {
say: "Don't stand so",
time: 209750
}, {
say: "don't stand so",
time: 211250
}, {
say: "Don't stand so close to me",
time: 212750,
end: true
}, ];
let HeartLess = [{
say: "Left me alone in the darkness",
time: 14500
}, {
say: "Leave me okay",
time: 17000
}, {
say: "Holding you show now",
time: 20000
}, {
say: "You're heartless",
time: 21000
}, {
say: "Left me alone in the darkness",
time: 36500
}, {
say: "Leave me okay",
time: 39250
}, {
say: "Left me alone in the darkness",
time: 42250
}, {
say: "Leave me okay",
time: 45000
}, {
say: "Holding you show now",
time: 64500
}, {
say: "You're heartless",
time: 65250
}, {
say: "Left me alone in the darkness",
time: 67250
}, {
say: "Leave me okay",
time: 84000
}, {
say: "Leave me okay",
time: 89500
}, {
say: "Left me alone in the darkness",
time: 103250
}, {
say: "Leave me okay",
time: 106250
}, {
say: "Holding you show now",
time: 109000
}, {
say: "You're heartless",
time: 110000
}, {
say: "BASSLINE GONNA MAKE MY SHOTS",
time: 113000
}, {
say: "Holding you show now",
time: 131500
}, {
say: "You're heartless",
time: 132500
}, {
say: "Left me alone in the darkness",
time: 137000
}, {
say: "Leave me okay",
time: 144000
}, {
say: "Left me alone in the darkness",
time: 148000
}, {
say: "Leave me okay",
time: 155000,
end: true
}, ];
let BurnItAllDown = [{
say: "This ain't where the",
time: 9000
}, {
say: "Legends come from",
time: 9750
}, {
say: "You're not what a",
time: 12250
}, {
say: "Hero looks like",
time: 13000
}, {
say: "Pretty little flower won't you",
time: 15500
}, {
say: "Sit back down and go play nice",
time: 18000
}, {
say: "Keep talking, keep laughing",
time: 21500
}, {
say: "One day you'll wish you hadn't",
time: 25000
}, {
say: "All the people want Fire, Fire",
time: 28500
}, {
say: "Maybe it's time they",
time: 31250
}, {
say: "Meet their dragon",
time: 33000
}, {
say: "If you're gonna hold me down",
time: 35500
}, {
say: "And you're not gonna let me in",
time: 38750
}, {
say: "Into your castle walls",
time: 41500
}, {
say: "None of you can keep them",
time: 44300
}, {
say: "Cause if I gotta",
time: 46850
}, {
say: "Bu bu burn it all down",
time: 48000
}, {
say: "Then we'll burn it all down",
time: 52000
}, {
say: "My oh my,",
time: 55250
}, {
say: "Look at who ends up",
time: 57000
}, {
say: "Bigger this time",
time: 58500
}, {
say: "And if I gotta",
time: 60000
}, {
say: "Bu bu break it all down",
time: 61250
}, {
say: "Then let's break it all down",
time: 65000
}, {
say: "Bye bye bye-",
time: 68500
}, {
say: "Playing with fire",
time: 70000
}, {
say: "And we burn it all down",
time: 71850
}, {
say: "This is where the",
time: 78500
}, {
say: "Bruises come from",
time: 79250
}, {
say: "This is when the",
time: 81800
}, {
say: "Game gets ugly",
time: 82500
}, {
say: "These blood, sweat,",
time: 84500
}, {
say: "Tears keep running",
time: 86000
}, {
say: "Licking my plate'",
time: 87750
}, {
say: "Cause I'm so hungry",
time: 88750
}, {
say: "Keep talking, keep laughing",
time: 91111
}, {
say: "One day you'll see what happen",
time: 94500
}, {
say: "All the people want Fire, Fire",
time: 98000
}, {
say: "It's about time they",
time: 100900
}, {
say: "Meet their dragon",
time: 102100
}, {
say: "If you're gonna hold me down",
time: 105000
}, {
say: "And you're not gonna let me in",
time: 108000
}, {
say: "Into your castle walls",
time: 111000
}, {
say: "None of you can keep them",
time: 114000
}, {
say: "Cause if I gotta",
time: 116250
}, {
say: "Bu bu burn it all down",
time: 117750
}, {
say: "Then we'll burn it all down",
time: 121500
}, {
say: "My oh my,",
time: 125000
}, {
say: "Look at who ends up",
time: 126500
}, {
say: "Bigger this time",
time: 128000
}, {
say: "And if I gotta",
time: 129500
}, {
say: "Bu bu break it all down",
time: 131000
}, {
say: "Then let's break it all down",
time: 134850
}, {
say: "Bye bye bye-",
time: 138000
}, {
say: "Playing with fire",
time: 139750
}, {
say: "And we burn it all down",
time: 141500
}, {
say: "It starts right now",
time: 144750
}, {
say: "Baby you're surrounded",
time: 148800
}, {
say: "Put your money where",
time: 151800
}, {
say: "Your mouth is",
time: 153000
}, {
say: "Bury your doubts",
time: 155500
}, {
say: "Under the ground",
time: 158000
}, {
say: "And they gonna watch you",
time: 162000
}, {
say: "Step over the ashes",
time: 164000
}, {
say: "Right now i'm taking my turn",
time: 166500
}, {
say: "With the matches",
time: 169000
}, {
say: "Cause if I gotta",
time: 172750
}, {
say: "Bu bu burn it all down",
time: 174000
}, {
say: "Then we'll burn it all down",
time: 177750
}, {
say: "My oh my,",
time: 181000
}, {
say: "Look at who ends up",
time: 182800
}, {
say: "Bigger this time",
time: 184500
}, {
say: "And if I gotta",
time: 186000
}, {
say: "Bu bu break it all down",
time: 187000
}, {
say: "Then let's break it all down",
time: 191000
}, {
say: "Bye bye bye-",
time: 194500
}, {
say: "Playing with fire",
time: 196000
}, {
say: "And we burn it all down",
time: 197750,
end: true
}, ];
let Invincible = [{
say: "Get myself into the game",
time: 11300,
}, {
say: "I'm a run it up anyway",
time: 13700,
}, {
say: "I get with the violence",
time: 17000,
}, {
say: "I don't think you wanna try it",
time: 19500,
}, {
say: "I'm too up",
time: 22200,
}, {
say: "I feel invincible",
time: 23000,
}, {
say: "I don't know if",
time: 25900,
}, {
say: "They get it though",
time: 26500,
}, {
say: "I'm too up",
time: 28000,
}, {
say: "I feel invincible",
time: 28800,
}, {
say: "Fuck what you said",
time: 31250,
}, {
say: "I'm invincible",
time: 32000,
}, {
say: "Lookin for a break",
time: 34000,
}, {
say: "And now I think",
time: 35000,
}, {
say: "I finally caught one",
time: 35700,
}, {
say: "We're talkin legendary status",
time: 37100,
}, {
say: "When it's all done",
time: 38500,
}, {
say: "I'm a star bitch",
time: 40000,
}, {
say: "If you ever saw one",
time: 41300,
}, {
say: "Law and order over here",
time: 43000,
}, {
say: "And it's a tall one meet",
time: 44000,
}, {
say: "Me at the top",
time: 44900,
}, {
say: "Its goin down",
time: 46500,
}, {
say: "They tryna fit in my circle",
time: 47500,
}, {
say: "I'm not around",
time: 49200,
}, {
say: "I was down before",
time: 50400,
}, {
say: "But not for the count",
time: 52000,
}, {
say: "Shit was real heavy",
time: 53200,
}, {
say: "Now it's dollars not the pounds",
time: 54100,
}, {
say: "Tell me what you smokin",
time: 56150,
}, {
say: "If you think that I'm a joke",
time: 57000,
}, {
say: "Only time I'm trippin is when",
time: 59000,
}, {
say: "I'm out on the road",
time: 60250,
}, {
say: "Only droppin joints if",
time: 62000,
}, {
say: "That shit is fuckin dope",
time: 63000,
}, {
say: "Scary when you see me",
time: 64800,
}, {
say: "Got them meming me like nope",
time: 65650,
}, {
say: "Nope, Nope, Nope...",
time: 67250,
}, {
say: "Hate to say it but",
time: 68750,
}, {
say: "We're running out of time",
time: 70000,
}, {
say: "I don't know bout you",
time: 71650,
}, {
say: "But I'ma make the most of mine",
time: 72650,
}, {
say: "Looking clean until a",
time: 74400,
}, {
say: "Young'n in the dirt",
time: 75300,
}, {
say: "Value through the roof",
time: 77000,
}, {
say: "Yeah yeah I know my worth",
time: 78000,
}, {
say: "Nato",
time: 79250,
}, {
say: "Get myself into the game",
time: 79900,
}, {
say: "I'm a run it up anyway",
time: 82250,
}, {
say: "I get with the violence",
time: 85500,
}, {
say: "I don't think you wanna try it",
time: 88000,
}, {
say: "I'm too up I feel invincible",
time: 90900,
}, {
say: "I don't know if",
time: 94350,
}, {
say: "They get it though",
time: 95100,
}, {
say: "I'm too up I feel invincible",
time: 96750,
}, {
say: "Fuck what you said",
time: 99850,
}, {
say: "I'm invincible",
time: 100800,
}, {
say: "If you wanna try to bring me",
time: 102500,
}, {
say: "Down you gotta reach me",
time: 104000,
}, {
say: "I'm high up in the clouds",
time: 105500,
}, {
say: "While you're just down there",
time: 106500,
}, {
say: "In the seaweeds",
time: 107500,
}, {
say: "I see these",
time: 108125,
}, {
say: "Little rappers they all wanna",
time: 109000,
}, {
say: "Be me",
time: 109800,
}, {
say: "But nobody wanna put the",
time: 110500,
}, {
say: "Work in",
time: 111200,
}, {
say: "Cause they think that",
time: 111800,
}, {
say: "I got it easy but thats sleezy",
time: 112750,
}, {
say: "My path to the top was hard",
time: 113850,
}, {
say: "But nothing out there could",
time: 114900,
}, {
say: "Make me stop every time",
time: 115600,
}, {
say: "I thought it went one way it",
time: 117000,
}, {
say: "Turned out that it did not",
time: 118000,
}, {
say: "Got so many obstacles",
time: 119300,
}, {
say: "From my opps",
time: 120100,
}, {
say: "So many praying",
time: 120850,
}, {
say: "That i would drop",
time: 121750,
}, {
say: "I had to go around the world",
time: 122500,
}, {
say: "Just to get to the",
time: 123350,
}, {
say: "End of my block",
time: 124000,
}, {
say: "I built my skin so tough",
time: 125000,
}, {
say: "Achieving all my desire",
time: 126600,
}, {
say: "I could walk through hell",
time: 128000,
}, {
say: "Without getting burned",
time: 128850,
}, {
say: "By the fire",
time: 130250,
}, {
say: "Oh I admire",
time: 131000,
}, {
say: "Those that are deniers",
time: 132500,
}, {
say: "Cause you messed around and",
time: 133800,
}, {
say: "Turned me to a cold",
time: 134750,
}, {
say: "Blooded fighter",
time: 135500,
}, {
say: "I'm so up I feel Invincible",
time: 136700,
}, {
say: "I hope my words",
time: 139800,
}, {
say: "Feel like insults",
time: 140950,
}, {
say: "I'm up right now",
time: 142250,
}, {
say: "You stuck right now",
time: 143750,
}, {
say: "Stay down there on the ground",
time: 145150,
}, {
say: "Get myself into the game",
time: 148300,
}, {
say: "I'm a run it up anyway",
time: 150850,
}, {
say: "I get with the violence",
time: 154100,
}, {
say: "I don't think you wanna try it",
time: 156800,
}, {
say: "I'm too up I feel invincible",
time: 159500,
}, {
say: "I don't know if",
time: 163000,
}, {
say: "They get it though",
time: 163750,
}, {
say: "I'm too up I feel invincible",
time: 165150,
}, {
say: "Fuck what you said",
time: 168250,
}, {
say: "I'm invincible",
time: 169250,
}, {
say: "Talk like I'm at the top now",
time: 171300,
}, {
say: "If you hit me I cant fall down",
time: 173750,
}, {
say: "Run up I'm not 2nd place and",
time: 177000,
}, {
say: "I tell 'em that I'm running",
time: 179500,
}, {
say: "All my bases",
time: 180600,
}, {
say: "I'm too up I feel invincible",
time: 182500,
}, {
say: "I don't know if",
time: 185850,
}, {
say: "They get it though",
time: 186650,
}, {
say: "I'm too up I feel invincible",
time: 188000,
}, {
say: "Fuck what you said",
time: 191150,
}, {
say: "I'm invincible",
time: 192250,
end: true
}];
var playingMusic = false;
var chatConfig = [];
var playingValue;
var delayTime6 = 0;
let musics = [song1, song2, song3, song4, song5, song6, song7, song8, song9, song10, song11, song12, song13, song14, song15, song16, song17, song18, song19, song20, song21, song22, song23, song24, song25, song26, song27, song28, song29, song30, song31, song32, song33, song34, song35, song36, song37, song38, song39, song40, song41, song42, song43, song44, song45, song46, song47, song48, song49, song50, song51, song52, song53, song54];
let chats = [];
function resetMusics() {
musics.forEach((musik)=>{
musik.pause();
musik.currentTime = 0;
musik.oncanplaythrough = null;
});
chatConfig.forEach((chatk)=>{
clearTimeout(chatk);
});
}
function syncChat(value) {
let playSong = musics[parseInt(value) - 1];
let playWhat = [];
playingValue = value;
new Promise((res,rej)=>{
try {
resetMusics();
playSong.oncanplaythrough = ((aaaaadashdgyauiwhdwq981nu289ceyuhasdgcauyhduasHAHAHAHAHAHADIUHAUDHAISDHASHIDASIDKOLASODOASDJNHCAWUDIOUWCAMDJCWUDGUAIWXDJIWHUIXWIDJAHWDUHWADH) => {
playSong.play();
res("Reset Song");
});
} catch (errjasdoiasdr) {
rej("Error: " + errjasdoiasdr);
}
}
).then((result)=>{
chatConfig = [];
playWhat.forEach((e)=>{
chatConfig.push(
setTimeout(()=>{
io.send("6", e.say);
if (e.end) {
playingMusic = false;
}
}, e.time)
);
});
playingMusic = true;
console.log(result);
}
);
}
// SEND MESSAGE:
function receiveChat(sid, message) {
if (message === ':(' && player.reloads[player.weapons[0]] == 0 && player.reloads[player.weapons[1]] == 0) {
my.autoAim = true;
buyEquip(53, 0);
selectWeapon(player.weapons[1]);
sendAutoGather();
setTimeout(()=>{
selectWeapon(player.weapons[1]);
buyEquip(7, 0);
setTimeout(() => {
sendAutoGather();
my.autoAim = false;
}, 120);
}, 120);
}
if (message === 'a