您需要先安装一个扩展,例如 篡改猴、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 2017.6.3.1 // @description Detects if your orders are outbid // @author sreyemnayr // @match http://theshownation.com/marketplace/orders // @match http://www.theshownation.com/marketplace/orders // @grant none // ==/UserScript== function orderHelper(){ $('.helperDiv').remove(); 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 = ""; var profitMargin = ""; $.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, "")); profitMargin = parseInt(thisBuyNowPrice * 0.90 - thisSellNowPrice); if(myBuyPrice < thisSellNowPrice) { this.className = 'btn btn-warning'; $($(this).parent().parent().children()[2]).append("<div class=\"helperDiv\" 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+"</div>"); } else { this.className = 'btn btn-success'; } $($(this).parent().parent().children()[1]).append("<div class=\"helperDiv\"><span style=\"background-color:white; font-size:80%\">"+ "Buy Now: <img class=\"currency-icon-small\" src=\"https://s3.amazonaws.com/mlb17-shared/dist/3/img/stub-icon.png\" style=\"width:15%; height:15%;\"> "+ thisBuyNowPrice+ "</span><br /><span style=\"background-color:white; font-size:80%\">Sell Now: <img class=\"currency-icon-small\" src=\"https://s3.amazonaws.com/mlb17-shared/dist/3/img/stub-icon.png\" style=\"width:15%; height:15%;\"> "+ thisSellNowPrice+ "</span><br /><span style=\"background-color:white; font-size:80%\">Profit: <img class=\"currency-icon-small\" src=\"https://s3.amazonaws.com/mlb17-shared/dist/3/img/stub-icon.png\" style=\"width:15%; height:15%;\"> "+ profitMargin+"</span></div>"); }); }); $(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 = ""; var profitMargin = ""; $.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, "")); profitMargin = parseInt(thisBuyNowPrice * 0.90 - thisSellNowPrice); console.log('mySell: ',mySellPrice,' thisBuy: ',thisBuyNowPrice); if(mySellPrice > thisBuyNowPrice) { this.className = 'btn btn-warning'; $($(this).parent().parent().children()[2]).append("<div class=\"helperDiv\" 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+"</div>"); } else { this.className = 'btn btn-success'; } $($(this).parent().parent().children()[1]).append("<div class=\"helperDiv\"><span style=\"background-color:white; font-size:80%\">"+ "Buy Now: <img class=\"currency-icon-small\" src=\"https://s3.amazonaws.com/mlb17-shared/dist/3/img/stub-icon.png\" style=\"width:15%; height:15%;\"> "+ thisBuyNowPrice+ "</span><br /><span style=\"background-color:white; font-size:80%\">Sell Now: <img class=\"currency-icon-small\" src=\"https://s3.amazonaws.com/mlb17-shared/dist/3/img/stub-icon.png\" style=\"width:15%; height:15%;\"> "+ thisSellNowPrice+ "</span><br /><span style=\"background-color:white; font-size:80%\">Profit: <img class=\"currency-icon-small\" src=\"https://s3.amazonaws.com/mlb17-shared/dist/3/img/stub-icon.png\" style=\"width:15%; height:15%;\"> "+ profitMargin+"</span></div>"); }); }); } (function() { 'use strict'; orderHelper(); setInterval(orderHelper,15000); })();