Greasy Fork is available in English.

JunkRecycler

Get rid off unnecessary stuffs.

Version vom 2018-03-31 16:28:00 UTC. Aktuellste Version

// ==UserScript==
// @name         JunkRecycler
// @namespace    http://tampermonkey.net/
// @version      1
// @description  Get rid off unnecessary stuffs.
// @author       S.Sikimić
// @include      http://83.popmundo.com/World/Popmundo.aspx/Character/Items/*
// @include      http://84.popmundo.com/World/Popmundo.aspx/Character/Items/*
// @include      http://85.popmundo.com/World/Popmundo.aspx/Character/Items/*
// @include      https://83.popmundo.com/World/Popmundo.aspx/Character/Items/*
// @include      https://84.popmundo.com/World/Popmundo.aspx/Character/Items/*
// @include      https://85.popmundo.com/World/Popmundo.aspx/Character/Items/*
// @grant        GM_getValue
// @grant        GM_setValue
// ==/UserScript==

///////////////////////////////
/////
///// todo: Check all goods, if there is none, start the op.
/////
///////////////////////////////

var throwEnabled = true;
var isNaked = "isNaked-";
var isAllThrown = "isAllThrownn-";

if(GM_getValue(isAllThrown) == undefined || GM_getValue(isAllThrown) == null || !GM_getValue(isAllThrown)){
    GM_setValue(isAllThrown, false);
}

if(throwEnabled){
    console.log("isnaked: "+ GM_getValue(isNaked));

    if(GM_getValue(isNaked)){
        setTimeout(function() {
            throwIt();
        }, 250);
    }else{
        setTimeout(function() {
            undress();
        }, 250);
    }

}else{
    console.log("nothing will be thrown");
}

function undress(){
    GM_setValue(isNaked, true);
    document.getElementById("ctl00_cphLeftColumn_ctl00_btnUndressCompletely").click();

    setTimeout(function() {
        try {
            console.log(document.getElementsByClassName("ui-dialog-buttonset")[7].getElementsByClassName("ui-button ui-corner-all ui-widget")[0].click());
        } catch (ex) {
            try {
                console.log(document.getElementsByClassName("ui-dialog-buttonset")[0].getElementsByClassName("ui-button ui-corner-all ui-widget")[0].click());
            } catch (ex) {
                console.log("no \"yes\" button" + ex);
            }
        }
    }, 250);
}

function throwIt(){
    console.log("isAllThrown: "+ GM_getValue(isAllThrown));
    if(!GM_getValue(isAllThrown)){

        GM_setValue(isAllThrown, true);
        document.getElementById("ctl00_cphLeftColumn_ctl00_repItemGroups_ctl00_imgToggleAll").click();
        document.getElementById("ctl00_cphLeftColumn_ctl00_btnThrowAwaySelectedItems").click();

        setTimeout(function() {
            try {
                console.log(document.getElementsByClassName("ui-dialog-buttonset")[5].getElementsByClassName("ui-button ui-corner-all ui-widget")[0].click());
            } catch (ex) {
                try {
                    console.log(document.getElementsByClassName("ui-dialog-buttonset")[0].getElementsByClassName("ui-button ui-corner-all ui-widget")[0].click());
                } catch (ex) {
                    console.log("no \"yes\" button" + ex);
                }
            }
        }, 250);
    }
}
//alert(GM_getValue(isNaked));