Skip to content

Instantly share code, notes, and snippets.

@epsimatic
Last active August 29, 2015 14:23
Show Gist options
  • Save epsimatic/3187fab203576eb47f76 to your computer and use it in GitHub Desktop.
Save epsimatic/3187fab203576eb47f76 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Steam — fast sell
// @include http*://steamcommunity.com/profiles/*/inventory*
// @include http*://steamcommunity.com/id/*/inventory*
// @description Fast sell Steam items with current price plus extra (epsimatic's mod)
// @version 0.14
// @namespace https://greasyfork.org/users/6507
// ==/UserScript==
const sell_price_factor = 1.4; // Add 40%!
(function (window, undefined) {
var w;
if (typeof unsafeWindow != undefined) {
w = unsafeWindow
} else {
w = window;
}
if (w.self != w.top) {
return;
}
jQuery(document).ready(function($) {
// $('.item_desc_content').append('<a style="background: linear-gradient(to bottom, rgba(33,101,138,1) 5%,rgba(23,67,92,1) 95%)"class="item_market_action_button_contents item_market_action_button fs" href="#">FAST SELL</a>');
//<a class="item_market_action_button item_market_action_button_green"><span class="item_market_action_button_edge item_market_action_button_left"></span><span class="item_market_action_button_contents">Продать за 7.70</span><span class="item_market_action_button_edge item_market_action_button_right"></span></a>
$('.inventory_iteminfo').append('<a class="fs item_market_action_button item_market_action_button_green"><span class="item_market_action_button_edge item_market_action_button_left"></span><span class="item_market_action_button_contents">Быстро продать</span><span class="item_market_action_button_edge item_market_action_button_right"></span></a>');
$('.fs').on('click', sellOne);
});
})(window);
function sellOne() {
inf = jQuery('div.inventory_iteminfo:visible').find('.item_market_actions').text();
expr = /(\d+(?:\.|,?)\d+)/;
price = expr.exec(inf);
price = price[1];
price = parseFloat(price) * sell_price_factor;
SellCurrentSelection();
document.getElementById('market_sell_buyercurrency_input').value = price;
SellItemDialog.OnBuyerPriceInputKeyUp();
document.getElementById("market_sell_dialog_accept_ssa").checked = true;
document.getElementById("market_sell_dialog_accept").click();
document.getElementById("market_sell_dialog_ok").click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment