Advertisement
Trambambaj

Ruch dywizją 1 klik

Feb 26th, 2023
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       1 klik ruch dywizją
  3. // @require    https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
  4. // @version    0.01
  5. // @match      *hegira.com.pl/engine.php?menu=lad*
  6. // @match      *hegira.eu/engine.php?menu=lad*
  7. // @author     Thing
  8. // ==/UserScript==
  9. const oneClickMove = function (kord) {
  10.   const kordUnp = `[${kord % 25 !== 0 ? kord % 25 : 25},${Math.ceil(
  11.     kord / 25
  12.   )}]`;
  13.   if (
  14.     confirm(`Czy potwierdzasz wysłanie dywizji na współrzędne ${kordUnp}?`) ===
  15.     true
  16.   ) {
  17.     $("div.okienko_floty_1").find('[name="w2"]')[0].value =
  18.       kord % 25 !== 0 ? kord % 25 : 25;
  19.     $("div.okienko_floty_1").find('[name="w3"]')[0].value = Math.ceil(
  20.       kord / 25
  21.     );
  22.     $('[src="img/ico/kurs.png"]').click();
  23.   }
  24. };
  25. if ($('[src="img/ico/kurs.png"]').length === 1) {
  26.   for (let i = 0; i < 625; i++) {
  27.     $('[class="tabela_scisnieta"]').find("tt")[i].outerHTML = $(
  28.       '[class="tabela_scisnieta"]'
  29.     )
  30.       .find("tt")
  31.       [i].outerHTML.replace("tt", `tt id ="${i + 1}"`);
  32.     $(`#${i + 1}`).click(function () {
  33.       oneClickMove(this.id);
  34.     });
  35.   }
  36. } else {
  37.   const czekacz = Number(
  38.     $("td:contains(Atak za)")[0]
  39.       .innerText.replace(/[a-z]/gi, "")
  40.       .replace(".", "")
  41.       .trim()
  42.   );
  43.   setTimeout(function () {
  44.     location.reload();
  45.   }, (czekacz + 2) * 1000);
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement