Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name 1 klik ruch dywizją
- // @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
- // @version 0.01
- // @match *hegira.com.pl/engine.php?menu=lad*
- // @match *hegira.eu/engine.php?menu=lad*
- // @author Thing
- // ==/UserScript==
- const oneClickMove = function (kord) {
- const kordUnp = `[${kord % 25 !== 0 ? kord % 25 : 25},${Math.ceil(
- kord / 25
- )}]`;
- if (
- confirm(`Czy potwierdzasz wysłanie dywizji na współrzędne ${kordUnp}?`) ===
- true
- ) {
- $("div.okienko_floty_1").find('[name="w2"]')[0].value =
- kord % 25 !== 0 ? kord % 25 : 25;
- $("div.okienko_floty_1").find('[name="w3"]')[0].value = Math.ceil(
- kord / 25
- );
- $('[src="img/ico/kurs.png"]').click();
- }
- };
- if ($('[src="img/ico/kurs.png"]').length === 1) {
- for (let i = 0; i < 625; i++) {
- $('[class="tabela_scisnieta"]').find("tt")[i].outerHTML = $(
- '[class="tabela_scisnieta"]'
- )
- .find("tt")
- [i].outerHTML.replace("tt", `tt id ="${i + 1}"`);
- $(`#${i + 1}`).click(function () {
- oneClickMove(this.id);
- });
- }
- } else {
- const czekacz = Number(
- $("td:contains(Atak za)")[0]
- .innerText.replace(/[a-z]/gi, "")
- .replace(".", "")
- .trim()
- );
- setTimeout(function () {
- location.reload();
- }, (czekacz + 2) * 1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement