WoW Remote AH Enhancement

WoW Remote Auction House Enhancements

当前为 2016-09-27 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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();
    }
}