Bauws / Auktionator

// ==UserScript==
// @name         Auktionator
// @namespace    http://tampermonkey.net/
// @version      2024-03-18
// @description  try to take over the world!
// @author       Bauws
// @match        https://*.ogame.gameforge.com/game/index.php?page=ingame&component=traderOverview
// @icon         https://www.google.com/s2/favicons?sz=64&domain=gameforge.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function bid() {
        document.querySelector("#div_traderAuctioneer > div.content > div.right_box > div.right_content > div > table > tbody > tr:nth-child(1) > td:nth-child(5) > a").click();
        document.querySelector("#div_traderAuctioneer > div.content > div.right_box > div.right_content > a").click();
    }

    function addBidButton() {
        var button = document.createElement('button');
        button.textContent = 'Biete';
        button.addEventListener('click', bid);

        // Add the button to the page, adjust the selector according to your needs
        var targetElement = document.querySelector('#siteHeader');
        targetElement.appendChild(button);
    }

    // Call the function to add the button
    addBidButton();
})();