Jump to content
McKay Development

Recommended Posts

Posted (edited)

I will sit and code. After having logged in and out a couple of times this would happen!

 

CODE:

var SteamUser = require('steam-user');
var SteamCommunity = require('steamcommunity');
var SteamTotp = require('steam-totp');
var TradeOfferManager = require('steam-tradeoffer-manager'); // use require('steam-tradeoffer-manager') in production
var market = require('steam-market-pricing');


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": "densexsedebjorn",
"password": "*****",
};


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 is coming in! " + offer.partner );
if(offer.itemsToGive.length == 0 ) {
console.log(offer.itemsToReceive.length);
console.log(offer.itemsToReceive[0].market_hash_name);
market.getItemPrice(730, 'MP9 | Storm (Minimal Wear)', function(err, data) {
     if(err) { console.log("Price couldn't load" + err);
} else { console.log( data.median_price ) } });
} else { offer.cancel(); console.log("Offer got denied " + "ASKED FOR ITEMS!?");}
});

ERROR:

events.js:141
      throw er; // Unhandled 'error' event
      ^


Error: RateLimitExceeded
    at SteamUser._handlers.(anonymous function) (c:\Node.js\Steam\node_modules\steam-user\components\logon.js:320:16)
    at SteamUser._handleMessage (c:\Node.js\Steam\node_modules\steam-user\components\messages.js:200:29)
    at emitThree (events.js:97:13)
    at CMClient.emit (events.js:175:7)
    at CMClient._netMsgReceived (c:\Node.js\Steam\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:278:8)
    at CMClient.handlers.(anonymous function) (c:\Node.js\Steam\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:386:8)
    at CMClient._netMsgReceived (c:\Node.js\Steam\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:260:24)
    at emitOne (events.js:77:13)
    at TCPConnection.emit (events.js:169:7)
    at TCPConnection._readPacket (c:\Node.js\Steam\node_modules\steam-user\node_modules\steam-client\lib\tcp_connection.js:73:7)
Edited by Melonos

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...