shashumga 3000

shashumga 3000 buff autobuy

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         shashumga 3000
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  shashumga 3000 buff autobuy
// @author       You
// @match        https://buff.163.com/goods/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=163.com
// @grant        none
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/axios.min.js
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    let amountBought = 0

    const req = (sell_order_id, goods_id, price) => {
        axios({
            method: 'post',
            url: 'https://buff.163.com/api/market/goods/buy',
            data: {
                "game":"csgo",
                "goods_id":goods_id,
                "sell_order_id":sell_order_id,
                "price":price,
                "pay_method":3,
                "allow_tradable_cooldown":0,
                "token":"",
                "cdkey_id":""
            },
            headers: {
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0",
                "Accept": "application/json, text/javascript, */*; q=0.01",
                "Accept-Language": "pl,en-US;q=0.7,en;q=0.3",
                "Accept-Encoding": "gzip, deflate, br",
                "Content-Type": "application/json",
                "X-CSRFToken": localStorage.getItem("csrf"),
                "X-Requested-With": "XMLHttpRequest",
                "Origin": "https://buff.163.com",
                "Connection": "keep-alive",
                "Referer": `https://buff.163.com/goods/${goods_id}`,
                "Sec-Fetch-Dest": "empty",
                "Sec-Fetch-Mode": "cors",
                "Sec-Fetch-Site": "same-origin"
            },
            withCredentials: true // This ensures cookies are sent with the request
        })
            .then(response => {
            if(response.data.code === 'OK'){
                console.log(`%c${++amountBought}`, 'font-size: 40px; color: red');
            } else {
                console.log(`error: `, response.data)
            }
        })
            .catch(error => {
            console.error("Error sending request:", error);
        });
    }

    const autobuy = (newCsrf) => {
        newCsrf && localStorage.setItem("csrf", newCsrf)

        let timeout = 0
        document.querySelectorAll('.btn-buy-order').forEach((element) => {
            setTimeout(()=> {
                req(element.getAttribute('data-orderid'), element.getAttribute('data-goodsid'), element.getAttribute('data-price'))
            }, timeout)
            timeout += 750
        })
        setTimeout(()=> {
            location.reload()
        }, timeout + 2000)
    }

    window.autobuy = autobuy
})();