Greasy Fork is available in English.

SimpleMMO Frog

SimpleAddon for SimpleMMO, Highlight inventory item already exist in your collectables.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         SimpleMMO Frog
// @namespace    https://gist.github.com/hackerfrog
// @version      0.0.1
// @copyright    2021-2021, hackerfrog
// @description  SimpleAddon for SimpleMMO, Highlight inventory item already exist in your collectables.
// @author       HackerFrog
// @match        https://web.simple-mmo.com/*
// @match        http://web.simple-mmo.com/*
// @grant        GM_listValues
// @grant        GM_getValue
// @grant        GM_setValue
// @run-at       document-end
// ==/UserScript==

var pointer = {
    'colGrid' : 'body > div.h-screen > div.flex > main > div.web-app-container > div > div:nth-child(3) > ul',
    'itemList' : 'body > div.h-screen > div.flex > main > div.web-app-container > div > div.mt-8 > div > div > table > tbody'
};

(function loop() {
    highlightCol()
    var body = document.querySelector('body')
    var hfBtn = document.createElement('div')
    hfBtn.classList.add('dark:text-white', 'dark:bg-indigo-600', 'dark:hover:bg-indigo-700', 'fixed', 'bottom-0', 'mb-8', 'mr-8', 'inline-flex', 'items-center', 'px-3', 'py-2', 'border', 'border-gray-300', 'shadow-sm', 'text-sm', 'text-gray-700',
                        'leading-4', 'font-medium', 'rounded-md', 'bg-indigo-600', 'hover:bg-indigo-700')
    hfBtn.setAttribute('style', 'right:116px;')
    hfBtn.innerHTML = 'Scan'
    hfBtn.addEventListener('click', function(event) {
        try {
            var colGrid = document.querySelector(pointer.colGrid)
            for (var i = 0; i < colGrid.children.length; i++) {
                try {
                    var name = colGrid.children[i].querySelector('div > div > div').innerHTML
                    var value = colGrid.children[i].querySelector('div > div > div:nth-child(3)').innerHTML
                    GM_setValue(name, value)
                } catch(err) {
                    console.log('Unable to find details of item')
                }
            }
            console.log('Page Scanned')
        } catch (err) {
            console.log('Not a valid page to scan')
        }
    })
    body.appendChild(hfBtn)
})();

function highlightCol() {
    var list = GM_listValues()
    //console.log(list)
    try {
        var table = document.querySelector(pointer.itemList)
        for(var i = 0; i < table.children.length; i++) {
            var item_name = table.children[i].querySelector('td:nth-child(1) > div > div.ml-4 > div > span:nth-child(2)').innerHTML
            if(list.includes(item_name)) {
                table.children[i].setAttribute('style', 'background:rgba(4, 170, 109, 0.1) !important')
            } else {
                //table.children[i].setAttribute('style', 'background:rgba(255, 255, 204, 0.1) !important')
            }
        }
    } catch(err) {
        console.log('Not a Inventory page')
    }
}