Slupik98

[PLEMIONA] Wykrywacz wsparcia u wroga

May 14th, 2017
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Wykrywacz wsparcia u wroga
  3. // @description Sprawdza czy Twój deff jest u wroga
  4. // @author "Słupek" (bigfixes) and others
  5. // @version 1.0.0
  6. // @updateURL https://pastebin.com/raw/nbYtdCSd
  7. // @downloadURL https://pastebin.com/raw/nbYtdCSd
  8. // @run-at document-end
  9. // @match https://*.plemiona.pl/game.php?village=*&screen=overview_villages*&type=away_detail*&mode=units*
  10. // @match http://*.plemiona.pl/game.php?village=*&screen=overview_villages*&type=away_detail*&mode=units*
  11. // ==/UserScript==
  12.  
  13. var enemies = ["DOPY", "MEN-N"];//Tutaj wpisuj skróty wrogich plemion
  14.  
  15. if ((window.location.href.match("overview_villages") != null) && (window.location.href.match("away_detail") != null)) {
  16. var iloscwiosek = $("table#units_table>tbody>tr").length;
  17. var i, j;
  18. suma3 = 0;
  19. match = false;
  20. for (i = 0; i < iloscwiosek - 1; i++) {
  21. var wies = $("table#units_table>tbody>tr")[i].getElementsByTagName("td")[0];
  22. var nazwawioski = wies.innerText.toLowerCase();
  23.  
  24. for (j = 0; j < enemies.length; j++) {
  25. if (nazwawioski.indexOf(enemies[j].toLowerCase()) > 1) {
  26. wies.style.backgroundColor = "red";
  27. console.log("Wioska " + nazwawioski + " enemies: " + enemies[j]);
  28. match = true;
  29. }
  30. }
  31. }
  32. if (match) {
  33. UI.InfoMessage('Uwaga! Twój def znajduje się u wroga!', 5000, 'error');
  34. } else {
  35. UI.InfoMessage('Nie masz żadnego defa u wroga ;)', 5000, 'success');
  36. }
  37. } else {
  38. UI.InfoMessage('Przejdź do Przegląd -> Wojska -> Pomoc', 5000, 'error');
  39. }
Advertisement
Add Comment
Please, Sign In to add comment