ыба Posted December 31, 2023 Report Share Posted December 31, 2023 when i use my account for script it see trades but when on account for bot it doesn't work(i tested on account where i don't pay 5$ and on account where payed 5$ but need 7 days after adding mobile auth) const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const SteamTrade = require('steamcommunity'); const SteamTradeMann = require('steam-tradeoffer-manager'); const prices = require('./prices.json') const client = new SteamUser(); const community = new SteamTrade(); const manager = new SteamTradeMann({ language: 'en' }); const logOnOptions = { accountName: 'name', password: 'pass' }; client.logOn(logOnOptions); client.on('loggedOn', () => { console.log('succesfully logged'); client.setPersona(1); client.gamesPlayed([440]) }); client.on('webSession', (sessionid, cookies) => { manager.setCookies(cookies); community.setCookies(cookies); community.startConfirmationChecker(20000); }) function acceptOff(offer) { offer.accept((err) => { community.checkConfirmations(); console.log("Accepted"); if (err) console.log("bruh accept"); if (err) acceptOff(offer); }) } function denyOff(offer) { offer.decline((err) => { console.log("Declined"); if (err) console.log("bruh deny"); }) } function processTrade(offer) { console.log("daa"); if (offer.state === 11){ console.log("Trade glithced, declining"); denyOff(offer); } else { var sell = offer.itemsToGive; var buy = offer.itemsToReceive; var ourprice = 0; var theirprice = 0; console.log(sell); console.log(sell.name); //console.log(buy); //console.log(buy.name); for (var i in sell) { var item = sell[i].name; if(prices[item]){ ourprice += prices[item].sell; } else { console.log("Error price sell"); ourprice += 99999; } } for (var i in buy) { var item = buy[i].name; if(prices[item]){ theirprice += prices[item].buy; } else { console.log("Error price buy"); } } console.log("Sell: "+ourprice); console.log("Buy: "+theirprice); if(ourprice <= theirprice){ acceptOff(offer); chataccpt(offer.partner); } else { denyOff(offer); chatdec(offer.partner, ourprice, theirprice); } } } function chataccpt(id){ client.chatMessage(id, "Offer accepted!") } function chatdec(id, our, their){ client.chatMessage(id, "Offer declined!"); client.chatMessage(id, "Your items : "+their); client.chatMessage(id, "My items : "+our); } manager.on('newOffer', function(offer) { console.log("daAAAA"); processTrade(offer); }) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.