您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Detects if your orders are outbid
当前为
// ==UserScript== // @name MLB The Show Nation Order Helper // @namespace https://greasyfork.org/en/users/8332-sreyemnayr // @version 0.3 // @description Detects if your orders are outbid // @author sreyemnayr // @match http://theshownation.com/marketplace/orders // @grant none // ==/UserScript== (function() { 'use strict'; var tables = $('.marketplace-search'); var buy_orders = tables[0]; var sell_orders = tables[1]; $(buy_orders).find('a').each(function(i){ var url = $(this).attr('href'); var myBuyPrice = parseInt($($(this).parent().parent().children()[2]).text()); var thisBuyNowPrice = ""; var thisSellNowPrice = ""; $.ajax({url:url, context:this}).done(function(b){ thisBuyNowPrice = parseInt($(b).find('.quick-actions form[action="/marketplace/create_buy_now"] input[name="price"]').val().replace(/,/g, "")); thisSellNowPrice = parseInt($(b).find('.quick-actions form[action="/marketplace/create_sell_now"] input[name="price"]').val().replace(/,/g, "")); if(myBuyPrice < thisSellNowPrice) { this.className = 'btn btn-warning'; $($(this).parent().parent().children()[2]).append("<br /><span style=\"background-color:yellow\">Outbid at <img class=\"currency-icon-small\" src=\"https://s3.amazonaws.com/mlb17-shared/dist/3/img/stub-icon.png\"> "+thisSellNowPrice+"</span>"); } else { this.className = 'btn btn-success'; } }); }); $(sell_orders).find('a').each(function(i){ var url = $(this).attr('href'); var mySellPrice = parseInt($($(this).parent().parent().children()[2]).text()); var thisBuyNowPrice = ""; var thisSellNowPrice = ""; $.ajax({url:url, context:this}).done(function(b){ thisBuyNowPrice = parseInt($(b).find('.quick-actions form[action="/marketplace/create_buy_now"] input[name="price"]').val().replace(/,/g, "")); thisSellNowPrice = parseInt($(b).find('.quick-actions form[action="/marketplace/create_sell_now"] input[name="price"]').val().replace(/,/g, "")); if(mySellPrice > thisBuyNowPrice) { this.className = 'btn btn-warning'; $($(this).parent().parent().children()[2]).append("<br /><span style=\"background-color:yellow\">Outbid at <img class=\"currency-icon-small\" src=\"https://s3.amazonaws.com/mlb17-shared/dist/3/img/stub-icon.png\"> "+thisBuyNowPrice+"</span>"); } else { this.className = 'btn btn-success'; } }); }); })();