-
Posts
3388 -
Joined
-
Last visited
Reputation Activity
-
Dr. McKay got a reaction from null in Set account phone number?
You can use steamstore to add phone numbers.
-
Dr. McKay got a reaction from What Comes Around in Set account phone number?
You can use steamstore to add phone numbers.
-
Dr. McKay got a reaction from E46 in Exporting TrustFactory Status/Level?
I don't really know a whole lot about the inner workings of CS:GO, but I'd think that if it's not exposed in the existing profile methods, then it's probably incredibly tricky to retrieve otherwise. I've not seen anything in the protobufs that refer to trust levels.
-
Dr. McKay got a reaction from PlanZed in How do I send a trade offer with items on both ends?
https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#getpartnerinventorycontentsappid-contextid-callback
-
Dr. McKay got a reaction from PlanZed in How do I send a trade offer with items on both ends?
You need to retrieve both parties' inventories, find the items you want to trade, and add them to the offer using addMyItem and addTheirItem.
-
Dr. McKay got a reaction from PonyExpress in EYldRefreshAppIfNecessary failed with EResult 55
If loadUserInventory works more reliably for you and you're okay with the possibility of things breaking as a result of using a deprecated endpoint, then go for it.
-
Dr. McKay got a reaction from CUTONI8 in getUserDetails
No problem, that's the recommended way to see if you can trade with someone.
-
Dr. McKay got a reaction from vrtgn in EYldRefreshAppIfNecessary failed with EResult 55
55 = RemoteCallFailed
That error means that the Steam Community backend wasn't able to get the inventory from the GC (item server), likely because the GC is overloaded (status is probably "critical" at steamstat.us).
-
Dr. McKay got a reaction from What Comes Around in Check if user accepted trade?
createOffer doesn't actually do anything on the network, so calling createOffer will never fail. You can check if the user's trade token is valid either by creating an offer and then calling getUserDetails, which will fail if the trade token is invalid (or the user cannot trade). You can also use GetTradeHoldDurations to check if a trade token is valid.
-
Dr. McKay got a reaction from What Comes Around in Function doesn't return inventory
Thanks so much for the help @vrtgn.
It may be worth noting that if you're using async, you don't need to use .catch((err) => . . .). You can use try/catch:
try { const inventory = await getInventory(); // do whatever } catch (err) { console.error(err); }
-
Dr. McKay got a reaction from vrtgn in Function doesn't return inventory
Thanks so much for the help @vrtgn.
It may be worth noting that if you're using async, you don't need to use .catch((err) => . . .). You can use try/catch:
try { const inventory = await getInventory(); // do whatever } catch (err) { console.error(err); }
-
Dr. McKay reacted to vrtgn in Function doesn't return inventory
I also made this mistake as a beginner.
You have a misunderstanding of asynchronous code in javascript. Fetching the inventory takes some time, and so by returning inventory, the variable is being returned before the program can even fetch your inventory.
You will have to create your own callback and that works by taking in a function as a callback parameter, and then executing that function once the inventory has been fetched.
const getInventory = (callback) => { manager.loadInventory(730, 2, true, (err, inventory) => { if (err) { callback(err); } else { callback(null, inventory); } }) } I personally prefer to check for errors first, but whatever you prefer you can change it to.
When we want to fetch the inventory we use it like so:
getInventory((err, inventory) => { if (err) { console.log('error getting the inventory :('); } else { // code to do whatever you want with inventory here } })
I also saw that you are using the loadInventory method, it would be much better if you used the getInventoryContents method as it says this in the docs:
EDIT: Callbacks are getting ugly nowadays imo so you can also use a promise if you prefer:
const getInventory = () => { return new Promise((resolve, reject) => { manager.loadInventory(730, 2, true, (err, inventory) => { if (err) { reject(err); } else { resolve(inventory); } }); }); } getInventory() .then(inventory => { // do whatever here }) .catch(err => console.log('oops')); // OR // this must be inside a async function try { const inventory = await getInventory(); // do whatever here } catch (err) { console.error(err) }
-
Dr. McKay reacted to vrtgn in How to properly use getUserDetails function
You can make the function a private and place it in the body of the MyHandler, but you will have to call it by prefixing "this." before the function.
this.getPartnerDetails(...) As for the "this" error you can change the parameters of the getPartnerDetails to:
function getPartnerDetails(this: any, offer: TradeOfferManager.TradeOffer, callback: (err: any, details: any) => void): any {
-
Dr. McKay got a reaction from Gabriel1375 in How to wait for user input on event "steamGuard" ?
Node.js will automatically exit if nothing is waiting for input. You just need to add some code to accept the code from the user somehow, and the application won't exit.
-
Dr. McKay got a reaction from vrtgn in Change user description
You can use node-steamcommunity for that: https://github.com/DoctorMcKay/node-steamcommunity/wiki/SteamCommunity#editprofilesettings-callback
-
Dr. McKay got a reaction from vrtgn in Userscript for steam-twofactor-server not working anymore
You're correct. I'll update that now.
-
Dr. McKay reacted to Akaz in Userscript for steam-twofactor-server not working anymore
Wow that was a quick fix, thanks a lot
-
Dr. McKay got a reaction from Gergely Szabo in Interacting with CS:GO Storage Units programmatically
Added in v2.1.0.
-
Dr. McKay got a reaction from SnaBe in Interacting with CS:GO Storage Units programmatically
It's a planned feature for globaloffensive, but I haven't gotten around to adding it yet.
-
Dr. McKay got a reaction from E46 in SteamUser class won't get cleared from memory after error event
I don't see any reason why that should be the case. The only reason I could figure that would happen is that it doesn't clean up some timer or something, but every instance where it emits error, it also calls _disconnect, which cleans up after itself.
Do you know what particular error code(s) cause this?
-
Dr. McKay got a reaction from bigshishka073 in Error with install request
The modules may work without the peer dependencies, or you should just install them yourself manually with npm install.
-
Dr. McKay reacted to lll in Best practice to logIn
This logic will be written in the constructor. Something like this :
constructor(accountName) { this.setCookies = util.promisify(this.manager.setCookies).bind(this.manager); this.user.on('error', this.logOut); this.user.on('loginKey', loginKey => db.findOne('bot', { accountName }, { loginKey })); }
-
Dr. McKay got a reaction from vrtgn in Unable to get polling to work
The CM sends a notification message to the Steam client (which steam-user can receive), but that message only contains the count of pending trade offers. To get any details at all about the actual content of the trade, we need to hit the API for that.
-
Dr. McKay got a reaction from sNIP in Whats the best way of running multiple accounts?
It's very much not a bad idea to spawn one process per account. That way, if something causes one bot to crash, the rest don't also crash. Also, Node.js is single-threaded, so that's the best way to take advantage of multiple processor cores.
About the only downside of spawning multiple processes is the increased memory usage. But if you have enough RAM, go for it.
-
Dr. McKay got a reaction from vrtgn in Whats the best way of running multiple accounts?
It's very much not a bad idea to spawn one process per account. That way, if something causes one bot to crash, the rest don't also crash. Also, Node.js is single-threaded, so that's the best way to take advantage of multiple processor cores.
About the only downside of spawning multiple processes is the increased memory usage. But if you have enough RAM, go for it.