DO-Auto-Move

auto move players (it works 60% of the time every time)

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name    DO-Auto-Move
// @version 4.2.2
// @description auto move players (it works 60% of the time every time)
// @author  holycrawler
// @match *.dugout-online.com/players/*
// @namespace https://greasyfork.org/users/798407
// ==/UserScript==

(() => {
  if (!document.querySelector(".top_positions")) return;
  const isSpreadSheet = !document.querySelector("#spread2").className.match("tab_off");
  const n = isSpreadSheet ? 1 : 0;
  let postData;
  const movePlayers = () => {
    const table = document.querySelectorAll("tr[class*='matches_row']");
    table.forEach((e) => {
      const url = e.querySelector("a").href;
      const age = +e.cells[4 + n].textContent;
      if (age < 19) {
        fetch(url, {
          method: "POST",
          headers: { "Content-Type": "application/x-www-form-urlencoded" },
          body: postData,
        })
          .catch((err) => console.log(err))
          .then(() => e.remove());
      }
    });
  };
  const newcell = document.querySelector(".compare_players_wrapper tr").insertCell();
  if (!isSpreadSheet) newcell.style.width = "440px";
  const newbutton = document.createElement("input");
  newbutton.type = "button";
  newbutton.style.float = "right";
  newcell.append(newbutton);
  newbutton.addEventListener("click", movePlayers);
  const isFirst = isSpreadSheet ? view_mode.youth.value === "1" : document.querySelector("#first1") != null;
  [postData, newbutton.value] = isFirst ? ["movetoyouth=1", "move to youth"] : ["moveto1st=1", "move to 1st"];
})();