Jump to content


Photo
Question

receivedOfferChanged dont receive offer.id

node.js node-steam-tradeoffer-manager

  • Please log in to reply
3 replies to this topic

#1 live4net

live4net

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 03 May 2018 - 01:06 PM

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)


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,751 posts

Posted 03 May 2018 - 04:18 PM

You must have a problem in BotManager somewhere.



#3 live4net

live4net

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 04 May 2018 - 02:09 AM

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, 04 May 2018 - 02:11 AM.


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 1,751 posts

Posted 04 May 2018 - 11:34 AM

I cannot help you with node-steam-bot-manager.







Also tagged with one or more of these keywords: Question, node.js, node-steam-tradeoffer-manager

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users