Jump to content
McKay Development

Search the Community

Showing results for tags 'node.js'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • Releases & Updates
  • Help & Support
    • General
    • Guides
    • node-steam-user
    • node-steamcommunity
    • node-steam-tradeoffer-manager
    • node-steam-session

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Location


Interests

  1. Sup guys. I've been getting this error every once in a while when trying to confirm a trade: ``` 14|trade | Error: Could not act on confirmation 14|trade | at /root/tradingbot/node_modules/steamcommunity/components/confirmations.js:145:12 14|trade | at SteamCommunity.<anonymous> (/root/tradingbot/node_modules/steamcommunity/components/confirmations.js:276:3) 14|trade | at Request._callback (/root/tradingbot/node_modules/steamcommunity/components/http.js:67:15) 14|trade | at Request.self.callback (/root/tradingbot/node_modules/request/request.js:186:22) 14|trade | at emitTwo (events.js:125:13) 14|trade | at Request.emit (events.js:213:7) 14|trade | at Request.<anonymous> (/root/tradingbot/node_modules/request/request.js:1163:10) 14|trade | at emitOne (events.js:115:13) 14|trade | at Request.emit (events.js:210:7) 14|trade | at IncomingMessage.<anonymous> (/root/tradingbot/node_modules/request/request.js:1085:12) ``` Here is my code (it's monstrously horrendous. Ive cut too many corners to neaten it): ```js acceptOffer(offer) { return new Promise((resolve, reject) => { offer.accept((err, status) => { if (err) { if (err.message == 'Not Logged In') { this.once('managerCookies', () => { this.acceptOffer(offer) }) return } return reject(err) } this.manager.once('receivedOfferChanged', (offer, oldState) => { if (offer.state == 3) { this.pushBullet.note('Trade Offer Accepted:', `Giving: \n${offer.itemsToGive.map(item => item.market_hash_name).join('\n')} \nReceiving: \n${offer.itemsToReceive.map(item => item.market_hash_name).join('\n')}`) offer.getReceivedItems((err, items) => { this.emit('debug', 'Accepted trade offer') this.emit('debug', 'Updating inventory cache') this.backpack.loadBptfInventory() .then(() => { this.emit('debug', 'Loaded BPTF inventory') for (let item of items) { if (this.prices[item.market_hash_name]) { if (!this.prices[item.market_hash_name].isCurrency) { this.emit('debug', 'Attempting to list the item') this.backpack.createSellListing(item.id, this.backpack.scrapToRef(this.prices[item.market_hash_name].sell)) .then(res => { if (res.listings[item.id].created == 1) { this.emit('debug', 'Created Listing') } else { this.emit('debug', 'Error creating listing') } }) .catch(err => { this.emit('debug', err) }) } } } }) .catch(err => { this.emit('debug', 'Error loading my bptf Inventory...') this.emit('debug', err) }) //should do error handling here. }) return resolve(true) } }) this.community.acceptConfirmationForObject(this.logOnOptions.identitySecret, offer.id, err => { if (err) { return reject(err) } }) }) }) } ```
  2. Stack Trace: TypeError: Path must be a string. Received undefined at assertPath (path.js:28:11) at Object.join (path.js:489:7) at userData (C:\Users\timol\Desktop\myFolder\node_modules\appdirectory\lib\appdirectory.js:16:25) at AppDirectory._setTemplates (C:\Users\timol\Desktop\myFolder\node_modules\appdirectory\lib\appdirectory.js:134:34) at new AppDirectory (C:\Users\timol\Desktop\myFolder\node_modules\appdirectory\lib\appdirectory.js:129:10) at new SteamUser (C:\Users\timol\Desktop\myFolder\node_modules\steam-user\index.js:104:34) at my files This is steam-user index.js:104. This was always there, so this is weird. The exact same thing happens in steam-tradeoffer-manager this.options.dataDirectory = (new AppDirectory({ "appName": "node-steamuser", "appAuthor": "doctormckay" })).userData();
  3. Hi, is it possible to convert background/emotes into gems with a bot? Basically, I want the bot to scan it's inventory once a trade is completed, find Backgrounds/Emotes worth 20+ Gems and turn them into Gems. Is it possible to do?
  4. Hey, I've created a bot and when I write to him !sell [item], he displays me how much i need to pay and creates a offer - with the item and his payment. The problem is it sometimes sends me the payment and I shouldn't give him anything. I've checked it with itemsToGive ItemsToRecieve and it didn't work. Then I saw the isGlitched() method but everytime the bot sends a trade, it shows that it's glitched although sometimes it isn't..
  5. Title says it all. How would i go about checking if a steamid64 is your friend? am having some crashing issues with my bot attempting to message non friends.
  6. Hello, I've saw that there's an error when the bot tries to reconnect after a session expires [ERROR] default - Error: Cannot log onto steamcommunity.com without first being connected to Steam network at SteamUser.webLogOn (/var/www/node_modules/steam-user/components/web.js:9:9) at SteamCommunity.<anonymous> (/var/www/socket/main.js:1453:29) at emitOne (events.js:96:13) at SteamCommunity.emit (events.js:188:7) at SteamCommunity._notifySessionExpired (/var/www/node_modules/steamcommunity/components/http.js:85:7) at /var/www/node_modules/steamcommunity/components/confirmations.js:21:10 at /var/www/node_modules/steamcommunity/components/confirmations.js:272:4 at SteamCommunity._checkHttpError (/var/www/node_modules/steamcommunity/components/http.js:90:3) at Request._callback (/var/www/node_modules/steamcommunity/components/http.js:50:61) at self.callback (/var/www/node_modules/request/request.js:186:22) And I want to know if there's a callback, so when an error comes in to just return;Can I do like: client.webLogOn(function(err) { if(err) return; }); Or something like this? Please help me. Thanks!
  7. To describe my problem: Everything runs smoothly until a few days went by. Then I'm apparently not logged in anymore (I get 'Error: Not Logged In' when trying to send a tradeoffer). I would prefer to deal with beeing logged of instead of relogging based on the errorcallback when sending the trade. First: autoRelogin doesn't seem to handle that issue, is autoRelogin ONLY for the weekly downtime that happens on tuesday? Second: Since this is quite hard to test (I don't know how to force it, maybe by logging into the client manually while the bot is logged in?), I hope to find the answer here: Will the error / disconnect fire when I get logged out / the session expires, and is it enough to just do a new logOn() then? Thanks in advance! ** ** Edit: What I was able to test so far: Logging in manually into the client kills the session. If that happens, the error and the disconnect-event don't fire. If I try to just do client.logOn again, I get the error "already logged on". Edit2: Looks like I found a fix, client.webLogOn(); does the trick. Is there a more elegant way of dealing with this issue other than just relogging when the error happens? I would prefer to relog after getting logged out / The session expiring.client.webLogOn(); Edit3: People told me to listen for the sessionExpired event and to renew the session if it fires. However this event doesn't fire when I manually destroy the cookies, and it doesn't fire when I make the cookies invalid by logging into the client manually. When does it fire? My solution for now: I have a cronschedule that does webLogOn() every 45 min (does that time make sense?), and whenever that error fires I also do a webLogOn(). Still not satisfied by that solution tbh tho.
  8. Hi. I'm using tradeoffer-manager for buying/selling items on OPSkins and few other marketplaces, but lately Valve started to ban my accounts. Usually I have 40-70 trades per day per account. What I need to change to stop receiving bans? Maybe you have some advices what i shouldn't do? Because Valve don't want to tell me what exactly am I doing agains their rules
  9. The action link on EconItems only opens steam and not CS:GO for item inspection?
  10. Does anybody have any "list_of_subs=" parm from a coupon is based on? Or anybody got any idea on how to know which games a coupon comes from without searching the market?
  11. I need help with receivedOfferChanged. It don't receive offer.id and status. Below is my code and output from console. var botsManager = new BotManager(); botsManager.on('receivedOfferChanged', function(offer, oldState) { console.log('--> STATUS ' + offer.id + ':' + offer.tradeID + ': (OLD:' + oldState + ') TO (NEW:' + offer.state + ')'); }); Output: --> STATUS undefined:undefined: (OLD:[object Object]) TO (NEW:undefined)
  12. Recently gamesPlayed appear to have been broken. It will no longer show non steam games. I haven't modified my code in a while and this don't seem to be only me as many bots are stuck on "online" status only could you check this out ?
  13. hey i wanted to ask how i use the SteamGameCoordinator like in node-steam (https://github.com/seishun/node-steam/tree/master/lib/handlers/game_coordinator)
  14. I am trying to get the users name, and not just any recent name, but the actual current name. These methods deliver outdated names, and I wonder why that is. Is there some caching going on or what am I doing wrong? Edit: I ended up using the webapi
  15. I have read this polling.js however I didn't understand how does it function from the core (trying to port it to another languge) my issue, is node-steam-tradeoffer-manager constantly sending requests HTTP to steam API in order to retrieve trade status (which sounds reaaaallllly inefficient) ? or there is a way to actually ask steam to send us data once a trade has been updated ( like a socket or something) ? if it's HTTP based, I know how to implement it but if it's socket based please can you provide links to resources which I can read to properly understand how to use it/explain it
  16. Hello, I have a question. I would like to send httpRequest request on store.steampowered.com website. But I noticed that after login cookies are set only on steamcommunity.com website. For this reason I am able to do it, but only as "guest" user. Is it possible somehow to send a request and stay online? I think It will be pretty good idea to share cookies between store and community like Steam does. Because both websites using the same cookie. Thank you.
  17. Installed packages. +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] bot: new SteamUser(), community: new SteamCommunity(), offers: new TradeOfferManager(), function trade(botid, senderid, trd) { bots[botid].offers.getInventoryContents(753, 6, true, function(err, inventory) { if (err) { logger.error(err); return; } if (inventory.length == 0) { logger.warn("Steam inventory is empty"); return; } logger.info("Found " + inventory.length + " Steam items"); var trode = bots[botid].offers.createOffer(new TradeOfferManager.SteamID('' + senderid + ''), '' + trd + ''); trode.addMyItems(inventory); trode.setMessage("items"); trode.send(function(err, status) { if (err) { logger.error(err); return; } if (status == 'pending') { logger.info('Offer sent, but requires confirmation'); bots[botid].community.acceptConfirmationForObject(bots[botid].identity_secret, trode.id, function(err) { if (err) { logger.error(err); } else { logger.info('Offer confirmed'); } }); } }); }); } When I do not specify a token, I get an error. Sorry for my bad english and ty for helping.
  18. Hey i'm wondering is there any option to make steam bot that will buy games from steam store?
  19. Hi, Is possible to see how many days left '7 days trade ban' for csgo item ? cant find this information in CEconItem{}. Regards, Thank you
  20. how would i go about loading somebodies inventory without being logged into an account? is that even possible?
  21. I'm having multiple bots which I store in a public array named `publicManager`. I have set my manager options as the following for each bot; const manager = new TradeOfferManager({ steam: client, community: community, language: 'en', "cancelTime": 60 * 3 * 1000 }); manager.id = data.id; manager.identity_secret = data.identity_secret; When the bot his client receives the webSession call I push the object into the publicManager array, now whenever I try send a trade with it I will get the bot by finding his BotId. Now I'm having issues trying to confirm the offer, everything goes well until it gets to the confirmation part; offer.send((err, status) => { if (err) { console.log(err); } else { selectedManager.acceptConfirmationForObject(selectedManager.identity_secret, offer.id, function(err){ if(err){ console.log(err); return; } console.log('Succesfully confirmed the offer.'); }); } }); for some odd reason it throws the error OfferLimitExceeded (e15), altough there are no trades open, did I misuse acceptConfirmationForObject? Cause' I'm a bit lost at this point. Thanks in advance.
  22. Good afternoon, I need my account # 1 to load inventory and send it to my account # 2. Is it possible to implement this? Tell me please. Now I'm doing authorization, it seems to work. var SteamUser = require('steam-user'); var SteamCommunity = require('steamcommunity'); var SteamTotp = require('steam-totp'); var TradeOfferManager = require('steam-tradeoffer-manager'); var fs = require('fs'); var request = require('request'); var async = require('async'); var client = new SteamUser({ "dataDirectory": null // Kasutame oma sentry-t. }); var manager = new TradeOfferManager({ "steam": client, "domain": "skins.ee", "language": "en" }); var community = new SteamCommunity(); var steamID = SteamCommunity.SteamID; if(fs.existsSync('./users/users.json') && fs.existsSync('./users/master_ssfn')) { var users = JSON.parse(fs.readFileSync('./users/users.json')); var sentry = fs.readFileSync('./users/master_ssfn'); } else { console.log("Users file or master ssfn missing. Exiting.."); process.exit(1); } var user = users.thor1; var user2 = users.thor; var logOnOptions = { "accountName": user.accountName, "password": user.password, "twoFactorCode": SteamTotp.getAuthCode(user.twoFactorCode) }; var logOnOptions = { "accountName": user2.accountName, "password": user2.password, "twoFactorCode": SteamTotp.getAuthCode(user2.twoFactorCode) }; if(fs.existsSync('./polls/' + user.accountName + '.json')) { manager.pollData = JSON.parse(fs.readFileSync('./polls/' + user.accountName + '.json')); } if(fs.existsSync('./polls/' + user2.accountName + '.json')) { manager.pollData = JSON.parse(fs.readFileSync('./polls/' + user2.accountName + '.json')); } client.setSentry(sentry); client.logOn(logOnOptions); client.on('loggedOn', function() { console.log("Logged into Steam account " + user.accountName); }); client.on('loggedOn', function() { console.log("Logged into Steam account " + user2.accountName); }); 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 + " for user " + user.accountName); }); community.setCookies(cookies); community.startConfirmationChecker(30000, user.identitySecret); // Checks and accepts confirmations every 30 seconds client.setPersona(SteamUser.Steam.EPersonaState.Online, user.personaName); sessionInterval(3600000); }); 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 + " for user " + user2.accountName); }); community.setCookies(cookies); community.startConfirmationChecker(30000, user2.identitySecret); // Checks and accepts confirmations every 30 seconds client.setPersona(SteamUser.Steam.EPersonaState.Online, user2.personaName); sessionInterval(3600000); }); manager.on('newOffer', function(offer) { var steamID64 = offer.partner.getSteamID64(); console.log('Received new offer from ' + steamID64); if(steamID64 == "76561198099243226","7656119826044197","76561198376145647","76561198828998292","76561198828975623","76561198824853703","76561198824809848","76561198824795016") { offer.accept(); } else { offer.decline(); } }); manager.on('pollData', function(pollData) { fs.writeFile('./polls/' + user.accountName + '.json', JSON.stringify(pollData)); }); function sessionInterval(time) { setTimeout(function() { console.log('Getting new cookies.'); client.webLogOn(); }, time); } /** * Express API to access SteamBot features and functions */ var express = require('express'); var app = express(); var bodyParser = require('body-parser'); app.use(bodyParser.json()); // for parsing application/json app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded app.get('/', function(req, res) { res.send('"Иди в дом, там мама тебе нальёт томатного." - Энди Картрайт'); }); app.listen(1337, function () { console.log('Express API listening on port 1337'); });
  23. Hi, I'm trying to get the assetid after the sentOfferChanged notices an accepted error, the code that I'm currently using logs the old assetid (at least thats what I think) instead of the new one. What seems to be the issue? Should offer.itemsToReceive be changed to something else, as this basically says ToReceive as in still have to get as in these assetids will not be updated? Code: manager.on('sentOfferChanged', function(offer) { var state = offer.state; //check for deposit or witrhdrawl, if withdrawl refund to their inventory. if(state === 3){ console.log('[SteamBot] A sent offer was accepted.'); var items = offer.itemsToReceive, user = offer.partner.getSteamID64(), socket = server.getSocket(user); items.forEach(function(item){ database.query('INSERT INTO `inventories` SET `assetid` = ' + database.pool.escape(item.assetid) + ', `market_hash_name` = ' + database.pool.escape(item.market_hash_name) + ', `user` = ' + database.pool.escape(user) + ', `image` = ' + database.pool.escape(item.icon_url) + ', `status` = 1, `bot` = ' + database.pool.escape(data.id), function(error, call) { if(error){ return; } }); }); server.showAlert(socket, 'success', 'Transaction was successfully completed.'); } }); Thanks in advance.
×
×
  • Create New...