NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name CatWar Hack // @namespace superhacker // @version 1.2.3 // @description Хак для вара // @author Hacker // @copyright 2020, https://vk.com/nikitaplayminec // @license MIT; https://opensource.org/licenses/MIT // @include https://catwar.su/* // @grant GM_xmlhttpRequest // @downloadURL https://openuserjs.org/install/ProgramZero/CatWar_Hack.user.js // @updateURL https://openuserjs.org/meta/ProgramZero/CatWar_Hack.meta.js // @grant GM.xmlHttpRequest // @require https://code.jquery.com/jquery-3.4.1.min.js // ==/UserScript== (function(win, $) { $(function(){ 'use strict'; return false; const hacks = { location: function() { gui.set(`<p>Оке, а теперь выберите саму локацию(можете указать просто тупик или локацию любую)</p> <input type='text' class='hackInput' id='locChoose'> <button type='button' class='hackButton' id='hackerSubmit'>Подтвердить</button>`); $("#hackerSubmit").on("click", function() { let toloca = $("#locChoose").val(); if (toloca === "тупик") { var taraks = location.find($("#location").html()); if (taraks === false) return; setInterval(function() { tupikLocation(taraks[0].object); }, 1000); gui.set("<p>Машина включена.</p>"); } else { var currLocc = $("#location").html(); var locats = location.find(toloca); if (locats === false) return false; locats[0].object.click(); var secloc = location.find(currLocc); if (secloc === false) { alert("Переход в эту же локацию не был найден."); return false; } setInterval(function() {twoLocs(secloc[0].object, locats[0].object) }, 1000); gui.set("<p>Машина включена.</p>"); } }); } } let moves = 0; let disabledMovings = false; let canIMove = true; let choiceTwoLocs = 1; function tupikLocation(objakt) { if (isLocked()) return; if (!canIMove) return; var b = helpers.randomFloat(2, 5); canIMove = false; setTimeout(function() { objakt.click(); canIMove = true; }, b); } function twoLocs(firstloka, secondloka) { if (isLocked()) return; if (!canIMove) return; var b = helpers.randomFloat(2, 5); if (choiceTwoLocs === 1) { canIMove = false; setTimeout(function() { firstloka.click(); choiceTwoLocs = 2; canIMove = true; }, b); } else if(choiceTwoLocs === 2) { canIMove = false; setTimeout(function() { secondloka.click(); choiceTwoLocs = 1; canIMove = true; }, b); } } function disableMovings() { if (moves === 20) { if (disabledMovings === true) return; var hehe = helpers.randomFloat(100, 200); disabledMovings = true; setTimeout(function() { disabledMovings = false; moves = 0; }, hehe) } } function isLocked() { var notor = $("#block_mess").find("#sek"); if (notor.html() === undefined) { return false; } if (moves >= 20) { disableMovings(); return true; } return true; } const location = { find: function(toloca) { let locats = []; if (toloca === "") return false; var haha = $("tr"); var lolo = $("#cages_div #cages tbody").find(haha); lolo.map(function(ira, row) { var tdo = $("td"); var obje = $("#cages_div #cages tbody").find(`tr:eq(${ira})`); obje.find(tdo).map(function(s, rawa) { var tafda = $("td"); var obka = obje.find(`td:eq(${s})`); var locname = obka.find(".move_name"); if (locname.html() == toloca) { locats.push({ "row": ira, "column": s, object: obka }); return; } }); }); if (locats[0]['row'] === undefined) return false; return locats; }, move: function(toloca) { var haka = location.find(toloca); if (haka === false) return false; haka.object.click(); } } const gui = { "css": `.hackInput { width: 100%; padding: 12px 20px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; box-sizing: border-box; } .hackButton { background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; cursor: pointer; width: 100%; } .hackButton button:hover { opacity: 0.8; } .hackContent { padding: 16px; } span.psw { float: right; padding-top: 16px; } #hackModal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ padding-top: 60px; } #hackModal .hackModal-content { color: #b2b2b2; font-family: Arial, Helvetica, sans-serif; background-color: #222 !important; background-color: #fefefe; margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */ border: 1px solid #888; width: 80%; /* Could be more or less, depending on screen size */ } .hackCancelBtn { width: auto; padding: 10px 18px; background-color: #f44336; } #hackModal .hackClose { position: absolute; right: 25px; top: 0; color: #000; font-size: 35px; font-weight: bold; float: right; padding-top: 16px; } #hackModal .hackClose:hover, #hackModal .hackClose:focus { color: red; cursor: pointer; } `, set: function(newgui) { $('.hackModal-content').html(`<span onclick="$('#hackModal').fadeOut('fast');" class="hackClose" title="Закрыть читерскую панель">×</span><div id='hackResponse'></div>`+newgui+`<button type='button' class='hackButton hackCancelBtn' onclick="$('#hackModal').fadeOut('fast');">Закрыть панель читов.</button>`); }, starter: function() { $("body").append(gui[`start`]); }, "start": ` <div id='hackModal'> <div class='hackModal-content'> <span onclick="$('#hackModal').fadeOut('fast');" class="hackClose" title="Закрыть читерскую панель">×</span> <div id='hackResponse'></div> <p>Выберите хак-режим который вы хотите. 1 - активность</p> <input type='text' class='hackInput' id='hackChoose'> <button type='button' class='hackButton' id='hackSubmit'>Подтвердить</button> <button type='button' class='hackButton hackCancelBtn' onclick="$('#hackModal').fadeOut('fast');">Закрыть панель читов.</button> </div> </div> ` } const helpers = {} helpers.randomFloat = function(min, max) { return Math.floor(Math.random() * (max - min + 1) + min) * 1000 + Math.floor(Math.random() * (999 - 1 + 1) + 1); } const acts = { find: function(act) { return $("#akten").find(`a[data-id='${act}']`); }, click: function(act) { var theact = acts.find(act); if (theact.html() == undefined) return false; theact.click(); return true; } } function addCSS(a) { $("head").append(`<style>${a}</style>`); } function init() { $('.small').first().append(` | <a href="#" onclick='$("#hackModal").fadeIn("fast");'>Настройки читов</a>`); addCSS(gui["css"]); gui.starter(); $("#hackSubmit").on("click", function() { var haski = $("#hackChoose").val(); if (haski == 1) { hacks.location(); } }); } const pageurl = window.location.href; const isCW3 = (/^https:\/\/catwar.su\/cw3(?!(\/kns|\/jagd))/.test(pageurl)); if (isCW3) init(); }); })(window, jQuery);