Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Tribal Wars Tag Script
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description This small script helps users to tag incomes in the game tribalwars
- // @author -
- // @include /https://.*\.die-staemme\.de/game\.php\?village=.*&screen=overview_villages&mode=incomings&subtype=attacks
- // @include /https://.*\.die-staemme\.de/game\.php\?village=.*&screen=overview_villages&mode=incomings&type=unignored&subtype=attacks
- // @grant unsafeWindow
- // ==/UserScript==
- function rename_existing_attacks(){
- var new_attack = false;
- $(".row_a, .row_b").each(function( index ) {
- console.log($(this).find(".quickedit-label").first().text().trim());
- if($(this).find(".quickedit-label").first().text().trim().includes("Angriff")){
- $(this).find("[type=checkbox]").first().prop('checked', true);
- new_attack = true;
- }
- });
- if(new_attack){
- $("[type=submit]").each(function( index ) {
- console.log("hi");
- console.log($(this).val().trim());
- if($(this).val().trim() == "Umbenennen"){
- $(this).trigger('click');
- }
- });
- }
- var incoming_attacks_234324 = parseInt($("#incomings_amount").first().text());
- var incoming_attacks_139829 = $(".row_a, .row_b").size();
- if(incoming_attacks_234324 > incoming_attacks_139829){
- console.log("NEW ATTACK INCOMING");
- location.reload();
- }
- }
- setInterval(rename_existing_attacks, 5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement