Scraebs
-
Posts
8 -
Joined
-
Last visited
Posts posted by Scraebs
-
-
You can't use this module with a limited account.
Hello, could you look here? It's seems to be right, but it doesn't conferm trades automaticaly
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 offers = 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(); var logOnOptions = { "accountName": "*****", "password": "***", "twoFactorCode": SteamTotp.getAuthCode("****") }; if (fs.existsSync('polldata.json')) { offers.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) { offers.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: " + offers.apiKey); }); var trade = offers.createOffer("76561197982243076"); offers.loadInventory(570, 2, true, function(err, myItems) { if(err) { console.log(err); return; } trade.loadPartnerInventory(570, 2, function(err, theirItems) { if(err) { console.log(err); return; } trade.addMyItem(myItems[0]); //trade.addMyItem({"appid": "570","contextid": "2", "assetid": "994253688" }); trade.addTheirItem(theirItems[0]); trade.send(function(err, status) { if (err) { console.log("send" + err); } else { console.log("Offer #" + trade.id + " " + status) } }); }); }); community.setCookies(cookies); community.startConfirmationChecker(30000, "identitySecret"); });
And could you say, how bot can get assetid of item and whan I use "id" from http://steamcommunity.com/profiles/76561198106184535/inventory/json/570/2 it brings error(26)
-
var offer = manager.createOffer("[U:1:46143802]"); offer.addMyItem({"appid": 440, "contextid": 2, "assetid": "1234567890"}); offer.send("Hi there", "KYworVTM", function(err, status) { if (err) { console.log(err); } else { console.log("Offer #" + offer.id + " " + status); } });
Something like that, where [u:1:46143802] is my SteamID and KYworVTM is my trade token.
And if my bot should create trade offer with it's friend, how it will look like?
-
Hello, I would like to try to create steambot using your nice manager. I have read examples, there are only confirmation described, but I want to make bot, that will send tradeoffers by him self. Could you say, is there any example or describe implementation of this construction in short? I have found ('../lib/classes/TradeOffer.js') but how can I call function send(), should I require it from my file or just require ('../lib/index.js') etc?
-
Sorry for such a stupid question, I just did sth wrong with twofactorcode, now it's up
-
How can I fix it? Replenish the balance of the Steam?
-
Hello, I just started to use node-steam-tradeoffer manager. I installed node modules and wanted to run example (storehouse-steam) but it trow err.
In the storehouse-steam.js I filled accountName and password (they are correct). It didnt send me code to the email. How should I fill "twoFactorCode": SteamTotp.getAuthCode("sharedSecret") if it needed and what else should I fill in this file? Thanks.
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": "acname", "password": "mypassword", "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); }); community.setCookies(cookies); community.startConfirmationChecker(30000, "identitySecret"); // Checks and accepts confirmations every 30 seconds }); manager.on('newOffer', function(offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID()); offer.accept(function(err) { if (err) { console.log("Unable to accept offer: " + err.message); } else { community.checkConfirmations(); // Check for confirmations right after accepting the offer console.log("Offer accepted"); } }); }); manager.on('receivedOfferChanged', function(offer, oldState) { console.log(`Offer #${offer.id} changed: ${TradeOfferManager.ETradeOfferState[oldState]} -> ${TradeOfferManager.ETradeOfferState[offer.state]}`); if (offer.state == TradeOfferManager.ETradeOfferState.Accepted) { offer.getReceivedItems(function(err, items) { if (err) { console.log("Couldn't get received items: " + err); } else { var names = items.map(function(item) { return item.name; }); console.log("Received: " + names.join(', ')); } }); } }); manager.on('pollData', function(pollData) { fs.writeFile('polldata.json', JSON.stringify(pollData)); });
Confirmation
in node-steamcommunity
Posted
Hello, could you look here? It's seems to be right, but it doesn't conferm trades automaticaly
And could you say, how bot can get assetid of item because than I use "id" from http://steamcommunity.com/profiles/76561198106184535/inventory/570/2 it brings error(26)