Created
October 27, 2017 02:51
-
-
Save AlbertoMonteiro/273b47dcf656406bd168afb1f8245dcc to your computer and use it in GitHub Desktop.
Sell player for futbin prince + 100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Sell for futbin value | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Alberto Monteiro | |
// @match https://www.easports.com/fifa/ultimate-team/web-app/* | |
// @match https://www.easports.com/*/fifa/ultimate-team/web-app/* | |
// @updateURL https://gist.github.com/AlbertoMonteiro/273b47dcf656406bd168afb1f8245dcc | |
// @downloadURL https://gist.github.com/AlbertoMonteiro/273b47dcf656406bd168afb1f8245dcc | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Your code here... | |
var targetNodes = $(document); | |
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; | |
var myObserver = new MutationObserver (mutationHandler); | |
var obsConfig = { childList: true, characterData: true, attributes: false, subtree: true }; | |
targetNodes.each ( function () { | |
myObserver.observe (this, obsConfig); | |
} ); | |
function mutationHandler (mutationRecords) { | |
mutationRecords.forEach ( function (mutation) { | |
if ($(mutation.target).hasClass("DetailView") && $(mutation.target).find('.DetailPanel')) { | |
setTimeout(function(){ | |
if ($(mutation.target).find('#sellFutBin').length === 1) return; | |
var botao = $("<button class='standard' id='sellFutBin'>Vender por FutBin</button>"); | |
botao.click(function() { | |
var inputs = $("div.buttonInfo.bidSpinner input"); | |
var valor = +$(".listFUTItem.selected .futbin span.coins.value").text().replace(",", ""); | |
inputs.eq(0).val(valor); | |
inputs.eq(1).val(valor+100); | |
$(".QuickListPanel .panelActions").addClass("open"); | |
}); | |
$(mutation.target).find('.QuickListPanel').append(botao); | |
}, 0); | |
} | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment