Skip to content

Instantly share code, notes, and snippets.

@AlbertoMonteiro
Created October 27, 2017 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlbertoMonteiro/273b47dcf656406bd168afb1f8245dcc to your computer and use it in GitHub Desktop.
Save AlbertoMonteiro/273b47dcf656406bd168afb1f8245dcc to your computer and use it in GitHub Desktop.
Sell player for futbin prince + 100
// ==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