Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Wklejka 1opobt2oabfz dodana przez , 29.06.2013 17:54
Typ:



Steam Community Market Bot
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
// ==UserScript==
// @name		Steam Community Market Bot
// @namespace	//benio.me
// @version		2.0
// @description	Instant buy. Sell and buy bot
// @match		http://steamcommunity.com/market/*
// @copyright	//benio.me
// @require		http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js
// ==/UserScript==
 
 
 
/* USAGE WARNING
 * 
 * Note, using this Steam Community Market Bot violates Valve`s Steam Market usage rules.
 * Bot, as of jQuery UserScript child, simulates very active steam community market user,
 * avoiding Bot typicall activity, making it`s usage just a time safe and leaving a risk.
 */
 
 
 
//////////////////////////////////////////
//										//
//	Steam Community Market Bot			//
//										//
//	@author		Paweł Benetkiewicz		//
//	@homepage	//benio.me				//
//										//
//////////////////////////////////////////
 
 
 
/*
	@desc	convert price to decimal format
    @param	float	n	number to convert
    @param	int		k	digits after dot
    @return	float	prize in decimal format
*/
Math.decimal = function(n, k){
    var factor = Math.pow(10, k+1);
    n = Math.round(Math.round(n*factor)/10);
    return n/(factor/10);
}
 
jQuery.support.cors = true;
jQuery(document).ready(function($){
    // Change prices format
    /*$('.market_listing_price').each(function(){
		$(this).html($.trim($(this).html().replace(' ', '').replace(',', '.').replace('€', ' €')));
    });
 
 	// Show clean prices and fees
    $('.market_listing_right_cell.market_listing_their_price').each(function(){
        var total=Math.decimal($.trim($(this).find('.market_listing_price.market_listing_price_with_fee').html()).slice(0, -2).replace(' ', '').replace(',', '.'), 2);
        var subtotal=Math.decimal($.trim($(this).find('.market_listing_price.market_listing_price_without_fee').html()).slice(0, -2).replace(' ', '').replace(',', '.'), 2);
        var fee=Math.decimal(total-subtotal, 2);
 
        $(this).find('.market_listing_price.market_listing_price_without_fee').each(function(){
            $(this).css({
                'display': 'inline',
                'color': 'grey'
            })
            .insertBefore($(this).prev())
            .after('<br>')
            .after($('<span>').addClass('market_listing_price').html(fee+' &euro;').css({
                'display': 'inline',
                'color': 'silver'
            }))
            .after('<br>');
        });
    });*/
 
    // Instant Buy
    $('a.item_market_action_button.item_market_action_button_green')
    	.click(function(){
            var listingid=$(this).attr('href').split("'")[3];
 
            // buys an item and reloads site
            new Ajax.Request( 'http://steamcommunity.com/market/buylisting/' + listingid, {
                method: 'post',
                parameters: {
                    'sessionid': g_sessionID,
                    'currency': g_rgWalletInfo['wallet_currency'],
                    'subtotal': g_rgListingInfo[listingid]['converted_price'],
                    'fee': g_rgListingInfo[listingid]['converted_fee'],
                    'total': g_rgListingInfo[listingid]['converted_price'] + g_rgListingInfo[listingid]['converted_fee']
                },
                onSuccess: function( transport ) { location.reload(); },
                onFailure: function( transport ) { location.reload(); }
            });
 
        	return false;
        })
 
    // settings start
    var shopping_limit=450;		// soft limit of shoppings (to safe some maney at account)
    var item_price_limit=75;	// highest price of item we can afford to buy
 
    // sites rotator // Steam items name identifiers behind the /753/
    var items=new Array(
        // Portal 2
        'Chell',
        'Destruction',
        'Finale',
        'GlaDOS',
        'Intro%20%28Trading%20Card%29',
        'The%20Lab',
        'Mannequin',
        'Underground',
 
        // Dota 2
        'Bounty%20Hunter',
        'Phantom%20Lancer',
        'Razor',
        'Riki',
        'Tidehunter%20%28Trading%20Card%29',
        'Tiny',
        'Tusk',
        'Vengeful%20Spirit%20%28Trading%20Card%29'
    );
    // settings end
 
    // Auto Buy
    if(g_rgWalletInfo['wallet_balance']>=shopping_limit){
        // we redresh site if no good offerts
        var refresh=0;
 
        // limit checking for Steam (753) items only
        if(location.href.substr(0,46)=='http://steamcommunity.com/market/listings/753/'){
            // random refresh time
            refresh=Math.random()*6000+4000;
 
            // get 2 first offer`s prices
            var prices=new Array(2), i=0;
            for(listingid in g_rgListingInfo){
                if(g_rgListingInfo[listingid]['converted_price']){
                	prices[i]=listingid;
                	if(++i>=2)break;
                }
            }
            // check if there are at least 2 offers and the we can stand for buy item
            if(i==2 && g_rgListingInfo[prices[0]]['converted_price'] <= item_price_limit){
                if(
                        g_rgListingInfo[prices[0]]['converted_price']
                    +	g_rgListingInfo[prices[0]]['converted_fee'] + 1
                    <	g_rgListingInfo[prices[1]]['converted_price']
 
                    // netto price of 2nd cheapest offer must be less than brutto price of the cheapest offer plus minimum one to get profit
                ){
                    // finally price to pay for item
                    var total=g_rgListingInfo[prices[0]]['converted_price'] + g_rgListingInfo[prices[0]]['converted_fee'];
 
                    // Buy item
                    new Ajax.Request( 'http://steamcommunity.com/market/buylisting/' + prices[0], {
                        method: 'post',
                        parameters: {
                            'sessionid': g_sessionID,
                            'currency': g_rgWalletInfo['wallet_currency'],
                            'subtotal': g_rgListingInfo[prices[0]]['converted_price'],
                            'fee': g_rgListingInfo[prices[0]]['converted_fee'],
                            'total': total
                        },
                        onSuccess: function( transport ) {
                            // retrieve additional info
                            var lista=$('#listing_'+prices[0]+' a.item_market_action_button.item_market_action_button_green').attr('href').split("'");
                            var contextid=lista[5];
                            var assetid=lista[7];
 
                            // Sell item at price minimum less than 2nd cheapest offer, so we have high chance to sell item, having the cheapiest price` offer
                            new Ajax.Request( 'http://steamcommunity.com/market/sellitem/', {
                                method: 'post',
                                parameters: {
                                    'sessionid': g_sessionID,
                                    'appid': 753,
                                    'contextid': contextid,
                                    'assetid': assetid,
                                    'amount': 1,
                                    'price': g_rgListingInfo[prices[1]]['converted_price']-1
                                },
 
                                // refresh site after making a new offer, even if error occured, we set up limit earlier
                                onSuccess: function( transport ) { document.location.href='http://steamcommunity.com/market/listings/753/'+items[((Math.random()*items.length)|0)]; },
                        		onFailure: function( transport ) { document.location.href='http://steamcommunity.com/market/listings/753/'+items[((Math.random()*items.length)|0)]; }
                            });
                        },
                        // refresh site on failure, fe. if somebody bought item before us
                        onFailure: function( transport ) { document.location.href='http://steamcommunity.com/market/listings/753/'+items[((Math.random()*items.length)|0)]; }
                    });
 
                    // we shall wait for Ajax response, dont refresh site automatically
                    refresh=0;
                }
            }
        }
 
        // Auto Recheck
        if(refresh){
            // we load another site if no good offers available to get profit
            window.setTimeout(function(){ document.location.href='http://steamcommunity.com/market/listings/753/'+items[((Math.random()*items.length)|0)]; }, refresh);
        }
    }
});

Dodanych wklejek: 11179
Powered By (Pav32) Pastebin © 2011