// ==UserScript== // @name Steam Community Market-Autobuy // @description For my eyes only. // @author Alexander (Tikhonex), Pyroman // @include http://steamcommunity.com/market/listings/570/Dragonclaw%20Hook* // ==/UserScript== var maxPrice = 1.00; // Максимальная цена за предмет в рублях var item = document.getElementsByClassName('market_listing_row'); var itemPrice = document.getElementsByClassName('market_listing_price_with_fee'); var itemButton = document.getElementsByClassName('item_market_action_button_green'); var i = 0; while(item[i]) { var price = itemPrice[i].innerHTML.replace(/\s+/g, ' '); price = price.substring(-5,5); price = price.replace(",", "."); price = parseFloat(price); if(price > maxPrice){ console.log('item '+i+' - ' + price + ' is more than '+maxPrice+' and was skipped'); }else { var found = true; console.log('>> item '+i+' - ' + price + ' is less than '+maxPrice+', time to buy!'); //alert ('АЛАРМ!! Скорее пополни баланс на '+price); itemButton[i].click(); setTimeout(buyItem,40); } i++; } if(found != true) { setTimeout(refresh,1000); } if(found == true) { window.open('http://www.youtube.com/watch?v=GWXLPu8Ky9k'); } function buyItem() { document.getElementById('market_buynow_dialog_accept_ssa').checked = true; document.getElementById('market_buynow_dialog_purchase').click(); setTimeout(refresh,2000); } function refresh() { location.reload(true); }