WoW Remote AH Enhancement

WoW Remote Auction House Enhancements

目前為 2016-09-27 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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();
    }
}