Wall Barb

Hotkeyy

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Wall Barb
// @version      3
// @description  Hotkeyy
// @include      https://*/game.php*screen=place*
// @namespace https://greasyfork.org/users/1388863
// ==/UserScript==

(function() {
    'use strict';

    // Tambahkan event listener untuk mendeteksi tombol keyboard yang ditekan
    document.addEventListener('keydown', function(event) {
        // Periksa apakah tombol yang ditekan adalah "."
        if (event.key === ".") {
            // Pilih elemen <a> di dalam baris tabel dengan kelas "row_a"
            const element = document.querySelector('tr.row_a td a.troop_template_selector');

            if (element) {
                element.click(); // Memicu klik pada elemen tersebut
                console.log('Element clicked successfully!');
            } else {
                console.error('Element not found!');
            }
        }

        // Periksa apakah tombol yang ditekan adalah "Enter"
        if (event.key === "Enter") {
            // Pilih elemen pertama yang cocok dari dua elemen target
            const attackButton = document.querySelector('#target_attack');
            const confirmButton = document.querySelector('#troop_confirm_submit');

            if (attackButton) {
                attackButton.click(); // Klik tombol "Attack"
                console.log('Attack button clicked!');
            } else if (confirmButton) {
                confirmButton.click(); // Klik tombol "Send attack"
                console.log('Confirm button clicked!');
            } else {
                console.error('No target button found!');
            }
        }
    });
})();