REPORT NAVIGATOR

Press + to go to next or - to go to previous report and auto press index at the same time.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         REPORT NAVIGATOR
// @version      1.0
// @description  Press + to go to next or - to go to previous report and auto press index at the same time.
// @author       AV
// @include      https://*.grepolis.com/game/*
// @grant        none
// @namespace    none
// @license      MIT
// @icon         https://pluspng.com/img-png/next-button-png-right-arrow-circular-button-338.jpg
// ==/UserScript==

(async function() {
    'use strict';

    document.addEventListener('keypress', (event) => {
        const runIndex = () => {
            const indexBTN = document.getElementById('gd_index_rep_txt');
            if (!indexBTN) return;
            if (indexBTN.textContent === 'Index +') indexBTN.click();
        }
        try{
            if (event.key === '+') {
                // var next = document.getElementsByClassName('btn_next');
                if (document.getElementsByClassName('next_button')) {
                    document.getElementsByClassName('next_button')[0].click();
                    runIndex();
                }
            } else if (event.key === '_') {
                // var prev = document.getElementsByClassName('btn_prev');
                if (document.getElementsByClassName('previous_button')) {
                    document.getElementsByClassName('previous_button')[0].click();
                    runIndex();
                }
            }
        } catch (err) {
            console.log("Buttons Not Found!");
        }
        
    })
})();