Meshi8 Posted May 6, 2018 Report Posted May 6, 2018 Hi, is it possible to convert background/emotes into gems with a bot? Basically, I want the bot to scan it's inventory once a trade is completed, find Backgrounds/Emotes worth 20+ Gems and turn them into Gems. Is it possible to do? Quote
Revadike Posted May 9, 2018 Report Posted May 9, 2018 https://github.com/DoctorMcKay/node-steamcommunity/wiki/CSteamUser#getinventoryappid-contextid-tradableonly-callbackhttps://github.com/DoctorMcKay/node-steamcommunity/wiki/SteamCommunity#turnitemintogemsappid-assetid-expectedgemsvalue-callback Quote
Meshi8 Posted May 9, 2018 Author Report Posted May 9, 2018 https://github.com/DoctorMcKay/node-steamcommunity/wiki/CSteamUser#getinventoryappid-contextid-tradableonly-callbackhttps://github.com/DoctorMcKay/node-steamcommunity/wiki/SteamCommunity#turnitemintogemsappid-assetid-expectedgemsvalue-callbackThanks! I wasn't aware these existed! However, I'm pretty new to this and really not sure how to use these methods.. Say I have an array called "Selected_Items" with items I filtered myself I go through it with a for loop and try to convert each item to gems. I'm supposed to get gemValue first so that I can pass that variable to turnItemIntoGems() method right? I'm not sure how to use getGemValue() method. Could you give me a simple example by any chance? Quote
Revadike Posted May 9, 2018 Report Posted May 9, 2018 getGemValue just calculates how many gems you will get for an item after using turnItemIntoGems. You can use them both independently. Quote
Dr. McKay Posted May 9, 2018 Report Posted May 9, 2018 You have to use getGemValue first because turnItemIntoGems needs the expected value. Quote
Meshi8 Posted May 9, 2018 Author Report Posted May 9, 2018 (edited) You have to use getGemValue first because turnItemIntoGems needs the expected value.That's what I figured. However, I'm not sure I'm doing this right. Here's my attempt: // I'm going through my steam inv with a for loop let MyItem = MySteamInventory[i]; community.getGemValue(MyItem.appid,MyItem.assetid, (res) => { console.log("This Item is worth: "+res.gemValue); }); Am I supposed to use community.getGemValue since getGemValue belongs to node-SteamCommunity? The Error: This Item is worth: undefined Edited May 9, 2018 by Meshi8 Quote
Dr. McKay Posted May 10, 2018 Report Posted May 10, 2018 The first argument to the callback is (as always) err. The AppID it wants is not the item's AppID but the AppID of the game, which is generally available as market_fee_app. Quote
Recommended Posts
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.