sorridi6morto / OGame Auction Hotkeys

// ==UserScript==
// @name         OGame Auction Hotkeys
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  q - rialza metallo, w - rialza cristallo, e - rialza deuterio, r - invia rilancio
// @author       Sorridi6morto
// @include      *.ogame*gameforge.com/game/index.php?page=ingame&component=traderOverview*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    document.onkeydown = function(e) {
        if (e.ctrlKey || e.altKey || e.metaKey) return;
        var char = e.which;
        if (!char) return;
        switch (char) {
            case 81:
                document.querySelector("a.js_sliderMetalMax").click();
                break;
            case 87:
                document.querySelector("a.js_sliderCrystalMax").click();
                break;
            case 69:
                document.querySelector("a.js_sliderDeuteriumMax").click();
                break;
            case 82:
                document.querySelector("a.pay").click();
                break;
        }
        return;
    };
})();