Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Tribal Wars Tag Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description This small script helps users to tag incomes in the game tribalwars
  6. // @author -
  7. // @include /https://.*\.die-staemme\.de/game\.php\?village=.*&screen=overview_villages&mode=incomings&subtype=attacks
  8. // @include /https://.*\.die-staemme\.de/game\.php\?village=.*&screen=overview_villages&mode=incomings&type=unignored&subtype=attacks
  9. // @grant unsafeWindow
  10. // ==/UserScript==
  11.  
  12.  
  13. function rename_existing_attacks(){
  14.  
  15. var new_attack = false;
  16.  
  17. $(".row_a, .row_b").each(function( index ) {
  18. console.log($(this).find(".quickedit-label").first().text().trim());
  19.  
  20. if($(this).find(".quickedit-label").first().text().trim().includes("Angriff")){
  21. $(this).find("[type=checkbox]").first().prop('checked', true);
  22. new_attack = true;
  23. }
  24.  
  25. });
  26.  
  27. if(new_attack){
  28. $("[type=submit]").each(function( index ) {
  29. console.log("hi");
  30. console.log($(this).val().trim());
  31. if($(this).val().trim() == "Umbenennen"){
  32. $(this).trigger('click');
  33. }
  34. });
  35. }
  36.  
  37. var incoming_attacks_234324 = parseInt($("#incomings_amount").first().text());
  38. var incoming_attacks_139829 = $(".row_a, .row_b").size();
  39.  
  40. if(incoming_attacks_234324 > incoming_attacks_139829){
  41. console.log("NEW ATTACK INCOMING");
  42. location.reload();
  43. }
  44. }
  45.  
  46. setInterval(rename_existing_attacks, 5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement