WoW Remote AH Enhancement

WoW Remote Auction House Enhancements

27.09.2016 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         WoW Remote AH Enhancement
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  WoW Remote Auction House Enhancements
// @author       Scott Mundorff
// @match        https://us.battle.net/wow/en/vault/character/auction/*
// @grant        none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
var idleTime = 0;
$(document).ready(function(){
    //Increment the idle time counter every minute.
    var idleInterval = setInterval(timerIncrement, 60000); // 1 minute

    //Zero the idle timer on mouse movement.
    $(this).mousemove(function (e) {
        idleTime = 0;
    });
    $(this).keypress(function (e) {
        idleTime = 0;
    });
    
    if(Auction.page == "browse"){
        var items = $("div.auction-house").children("div.table").find("td.item").parent();
        $(items).each(function(key){
            // show ilvl inline
            ParseILvl(this);
        });
        /*
        $("div.profile-sidebar-inner").css("height","auto");
        $("ul.profile-sidebar-menu > li").css("float","left");
        $("div.profile-sidebar-crest").css("display","none");
        $("div.profile-contents").css("width","");
        $("div.profile-contents").css("float","");
        */
    }else if(Auction.page == "create"){
        // select 12 hours
        $("#form-duration").val(0);
        // select per item pricing
        $("#form-priceType").val("perItem");
        // add onclick to ("#similar-auctions .similar-items .table tr")
        $("#similar-auctions .similar-items .table tr .price").click(undercut);
        $("#similar-auctions .similar-items .table tr .price").first().click();
    }
    // Auction.page
    Auction.toasts["AHEnhanced"] = "AH Enhanced Loaded";
    Auction.toast("AHEnhanced",3000,"");
});

function undercut(){
    var gold = $(this).children(".icon-gold").first().text();
    var silver = $(this).children(".icon-silver").first().text();
    var copper = $(this).children(".icon-copper").first().text();
    var money = Auction.deformatMoney(gold, silver, copper);
    if($(this).parent().children().first().text() != Auction.character.name)
        money -= 1;
    AuctionCreate.setStarting(money * 0.98);
    AuctionCreate.setBuyout(money);
}

function ParseILvl(item){
    var level = $(item).children("td.level");
    var minLvl = $(level).children("div").children("strong").first().text();
    var iLvl = $(level).children("div").children("strong").last().text();
    $(level).text(minLvl + " / i" + iLvl);
}

function timerIncrement() {
    idleTime = idleTime + 1;
    if (idleTime > 5) { // 20 minutes
        window.location.reload();
    }
}