Jump to content
McKay Development

Recommended Posts

Posted (edited)

The question is how do I 'filter' trade offers. So only accept the offer if the trade contains ... itemsToReceive and ... itemsToGive. I want to achieve this using another file containing those option. I don't know how I should store them (like as an array, array of objects etc). I think an array of objects could work. So I made this as sample file:

module.exports = {
    trades: [{
        "itemsToReceive": "Breakout Key",
        "itemsToGive": "Mac-10 | Neon Rider (Factory New)"
    }, {
        "itemsToReceive": "Falchion Key",
        "itemsToGive": "P250 | Sand Dune (Battle Scarred)"
    }]
}

//all values represent their market_hash_name's
Edited by timgfx
Posted

What's wrong with the multitude of other threads you have asking this question?

I searched for it but haven't found anything. Continuing the search now I guess. Sorry for wasting your time:P

Posted

This is a bad idea just make the bot send the offer instead of receiving it you'll be selecting one of those whitelisted items instead of checking each item in the offer and stops spamming the forum it's for documentation not on how to build a steam bot 1o1

Posted (edited)

This is a bad idea just make the bot send the offer instead of receiving it you'll be selecting one of those whitelisted items instead of checking each item in the offer and stops spamming the forum it's for documentation not on how to build a steam bot 1o1

Well I think it would be a lot easier if the bot receives offers, I am going to use it as trade bot to buy quicksells (csgo items via csgolounge), and to make it easy people can send their offers and instantly get accepted.

Edited by timgfx
Posted

Well I think it would be a lot easier if the bot receives offers, I am going to use it as trade bot to buy quicksells (csgo items via csgolounge), and to make it easy people can send their offers and instantly get accepted.

 

then loop through itemsToReceive and validate each market_hash_name

Posted (edited)

then loop through itemsToReceive and validate each market_hash_name

Yep I figured it out already. It's too much to explain tho and was a lotta copy pasting. And I didn't use JSON since I like using Javascript objects more. Dunno why, more familiar with it I guess. This is my trades.js file now:

module.exports = {
	trade1: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade2: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade3: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade4: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade5: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade6: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade7: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade8: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade9: {
		"itemsToReceive": "",
		"itemsToGive": ""
	},
	trade10: {
		"itemsToReceive": "",
		"itemsToGive": ""
	}
}

//all values represent the market_hash_names of the item
Edited by timgfx

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