Jump to content
McKay Development

IdiotScriptieKid

Member
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

452 profile views

IdiotScriptieKid's Achievements

  1. Thank you for the help, now I understand I literally broke my head and the answer was pretty obvious, thank you very much such a helpful community. But how can I make this as a loop? is there an example code that i can refer? Much appreciated!
  2. I am entirely new on java script and learning on day by day, i want to get on sending the items in a steam bots inventory. Sending it one by one and loops until the inventory is empty. Sorry for the trouble this might be spoon feeding the code to me, i can not get it undone its been lingering in my mind to post this, but i cant seem to do it because its kinda shameful, but i did it anyways. It will be a great help for my research. I just want somebody to modify the example code of the great doctormckay the offloader.js, in which it will send the items one by one and loops until the inventory is empty. Thank you in advance /** * OFFLOADER * * Once logged in, sends a trade offer containing this account's entire tradable CS:GO inventory. */ var SteamUser = require('steam-user'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var TradeOfferManager = require('../lib/index.js'); // use require('steam-tradeoffer-manager') in production var fs = require('fs'); var client = new SteamUser(); var manager = new TradeOfferManager({ "steam": client, // Polling every 30 seconds is fine since we get notifications from Steam "domain": "example.com", // Our domain is example.com "language": "en" // We want English item descriptions }); var community = new SteamCommunity(); // Steam logon options var logOnOptions = { "accountName": "username", "password": "password", "twoFactorCode": SteamTotp.getAuthCode("sharedSecret") }; if (fs.existsSync('polldata.json')) { manager.pollData = JSON.parse(fs.readFileSync('polldata.json')); } client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam"); }); client.on('webSession', function(sessionID, cookies) { manager.setCookies(cookies, function(err) { if (err) { console.log(err); process.exit(1); // Fatal error since we couldn't get our API key return; } console.log("Got API key: " + manager.apiKey); // Get our inventory manager.loadInventory(730, 2, true, function(err, inventory) { if (err) { console.log(err); return; } if (inventory.length == 0) { // Inventory empty console.log("CS:GO inventory is empty"); return; } console.log("Found " + inventory.length + " CS:GO items"); // Create and send the offer var offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=12345678&token=xxxxxxxx"); offer.addMyItems(inventory); offer.setMessage("Here, have some items!"); offer.send(function(err, status) { if (err) { console.log(err); return; } if (status == 'pending') { // We need to confirm it console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); } }); }); }); community.setCookies(cookies); }); manager.on('sentOfferChanged', function(offer, oldState) { console.log(`Offer #${offer.id} changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`); }); manager.on('pollData', function(pollData) { fs.writeFile('polldata.json', JSON.stringify(pollData), function() {}); }); /* * Example output: * * Logged into Steam * Got API key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx * Found 117 CS:GO items * Offer #1601569319 sent, but requires confirmation * Offer confirmed */
×
×
  • Create New...