Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Wykrywacz wsparcia u wroga
- // @description Sprawdza czy Twój deff jest u wroga
- // @author "Słupek" (bigfixes) and others
- // @version 1.0.0
- // @updateURL https://pastebin.com/raw/nbYtdCSd
- // @downloadURL https://pastebin.com/raw/nbYtdCSd
- // @run-at document-end
- // @match https://*.plemiona.pl/game.php?village=*&screen=overview_villages*&type=away_detail*&mode=units*
- // @match http://*.plemiona.pl/game.php?village=*&screen=overview_villages*&type=away_detail*&mode=units*
- // ==/UserScript==
- var enemies = ["DOPY", "MEN-N"];//Tutaj wpisuj skróty wrogich plemion
- if ((window.location.href.match("overview_villages") != null) && (window.location.href.match("away_detail") != null)) {
- var iloscwiosek = $("table#units_table>tbody>tr").length;
- var i, j;
- suma3 = 0;
- match = false;
- for (i = 0; i < iloscwiosek - 1; i++) {
- var wies = $("table#units_table>tbody>tr")[i].getElementsByTagName("td")[0];
- var nazwawioski = wies.innerText.toLowerCase();
- for (j = 0; j < enemies.length; j++) {
- if (nazwawioski.indexOf(enemies[j].toLowerCase()) > 1) {
- wies.style.backgroundColor = "red";
- console.log("Wioska " + nazwawioski + " enemies: " + enemies[j]);
- match = true;
- }
- }
- }
- if (match) {
- UI.InfoMessage('Uwaga! Twój def znajduje się u wroga!', 5000, 'error');
- } else {
- UI.InfoMessage('Nie masz żadnego defa u wroga ;)', 5000, 'success');
- }
- } else {
- UI.InfoMessage('Przejdź do Przegląd -> Wojska -> Pomoc', 5000, 'error');
- }
Advertisement
Add Comment
Please, Sign In to add comment