Jump to content
McKay Development

Recommended Posts

Posted

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)

Posted (edited)

I Just install by: npm i node-steam-bot-manager and don't edit any files from bot manager and trade offer manager. Bot accept offer sucessful, but can't handle receivedOfferChanged

 

 

 

Here is all code:

 
var BotManager = require('node-steam-bot-manager');


function InventoryBot() {


	var botsManager = new BotManager();// Create new instance of the BotManager
	botsManager.on('receivedOfferChanged', function(offer, oldState) {
		console.log('--> STATUS:' + offer.id + ':' + offer.tradeID + ': (OLD: ' + oldState + ') TO (NEW:' + offer.state + ')');
	});


	botsManager.on('newOffer', function (activeAccount, offer) {
		if (offer.itemsToGive.length == 0 && offer.itemsToReceive.length > 0) {
			offer.accept(true, function(err, status) {
				if(err) {
					console.log('Error: ' + err);
				console.log('ACCEPTED');
				}
			});
		}
		else {
			offer.cancel(function (err) {
				if (err)
					console.log(err);
			});
		}
	});



	botsManager.infoDebug("Starting Bot Manager");
	botsManager.startManager(function (err) {
	if (err)
	botsManager.errorDebug("Failed to start Bot Manager");
	});
}


new InventoryBot();
module.exports = InventoryBot;

 

 

Bot accepts offer, and send output to console:

STATUS:undefined:undefined: (OLD: [object Object]) TO (NEW:undefined)
Edited by live4net

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...