Jump to content
McKay Development

All Activity

This stream auto-updates     

  1. Today
  2. Yesterday
  3. Last week
  4. It's a planned feature for globaloffensive, but I haven't gotten around to adding it yet.
  5. How to change currency in getMarketItem? Is it possible? I wanna get price of item in another currency(not usd). UPD: ye, "Currently, non-USD currencies are not supported." on CMarketItem wiki When will it be supported? It's very important for me. UPD2: I've just found another nmp package named "steam-market-pricing" that can help me UPD3: I was looking for better solution. So(from "steamcommunity\components\CMarketItem.js"): SteamCommunity.prototype.getMarketItem = function(appid, hashName, currency, callback) { if (typeof currency == "function") { callback = currency; currency = 1; } var self = this; this.httpRequest("https://steamcommunity.com/market/listings/" + appid + "/" + encodeURIComponent(hashName), function(err, response, body) { if (err) { callback(err); return; } var $ = Cheerio.load(body); if($('.market_listing_table_message') && $('.market_listing_table_message').text().trim() == 'There are no listings for this item.') { callback(new Error("There are no listings for this item.")); return; } var item = new CMarketItem(appid, hashName, self, body, $); item.updatePrice(currency, function(err) { if(err) { callback(err); } else { callback(null, item); } }); }, "steamcommunity"); }; Yep. I can set currency. So wiki on github is outdated. P.S lowestPrice and highestBuyOrder is set to the correct currency but medianSalePrices' currency is usd so, I checked it medianSalePrices can be converted from usd to XXX by exchange rate but lowestPrice and highestBuyOrder cant
  6. Hi! Does anyone know how could I go about operating with CSGO storage units? (adding / retrieving items programmatically) Thanks.
  7. That's not implemented in any publicly-released module, to my knowledge.
  8. I want purchase games and send gift to my friends , can helpme to know how i can this or is allready implemented in the node and i don't find it?. Pls is very necesary work with this.
  9. This isn't the forum for this but Friends/old friends can be seen through here: https://steamid.uk/ (provided there profile is/was public) Inventory can be seen through: https://backpack.tf and https://csgo.backpack.tf.
  10. You need to call community.setCookies, and you can obtain cookies from the webSession event.
  11. "use strict"; const SteamUser = require("steam-user"); const SteamTotp = require("steam-totp"); const SteamID = require('steamid') const Steamcommunity = require("steamcommunity"); const community = new Steamcommunity(); const client = new SteamUser(); client.logOn(just say i logged); client.on('loggedOn', ()=>{ console.log('logged'); client.setPersona(SteamUser.EPersonaState.Online); client.gamesPlayed(440); }); function isOwner(steamid){ return config.owner.includes(steamid) }; function Command(string){ if (string.startsWith('!')){ const command = string.toLowerCase().split(' ')[0].substr(1); return command; } else { return null; } } client.on('friendMessage', (steamid, message)=>{ message = message.trim(); const SteamID = steamid.getSteamID64(); const command = Command(message); if (command == 'avatar' && isOwner(SteamID)){ const avatarURL = message.substr(message.toLowerCase().indexOf('avatar') + 7); if (avatarURL == ''){ client.chatMessage(SteamID, 'No URL'); } community.uploadAvatar(avatarURL, function(err){ if (err){ client.chatMessage(SteamID, err); } else { client.chatMessage(SteamID, 'Avatar Changed'); } }) } }) why bot always saying Error: not logged in how can i fix it?
  12. Hello, Is there any page that I enter steam id64 profile and show its whole friendlist? need to see how many items in steam items, csgo items, tf2 items If you know, please comment. well thank you.
  13. No, there isn't a way to get an "inventory hash" or anything similar.
  14. Earlier
  15. I'll just leave it in case someone needs. // For test: let CONFIG, SENDER = "76561197983852931", amountOfKeys = 10; CONFIG.ACCEPTEDKEYSCS = ["CS20 Case Key", "Prisma Case Key", "Danger Zone Case Key", "Horizon Case Key", "Clutch Case Key", "Spectrum 2 Case Key", "Spectrum Case Key", "Gamma 2 Case Key", "Gamma Case Key", "Glove Case Key", "Chroma 3 Case Key", "Operation Wildfire Case Key", "Falchion Case Key", "Chroma 2 Case Key", "Chroma Case Key", "Operation Vanguard Case Key", "Operation Breakout Case Key", "Huntsman Case Key", "Operation Phoenix Case Key", "Shadow Case Key", "Revolver Case Key", "Winter Offensive Case Key", "eSports Key", "CS:GO Case Key"]; // Getting Inventory: manager.getUserInventoryContents(SENDER, 730, 2, false, (ERR, USERINVENTORY) => { // (!!!) false if (ERR) { console.log(ERR); } else { let hisKeys = [], notMarketable = 0, notTradable = 0; for (let i = 0; i < USERINVENTORY.length; i++) { if (hisKeys.length == amountOfKeys) { break; } else if (CONFIG.ACCEPTEDKEYSCS.includes(USERINVENTORY[i].market_hash_name)) { // This key is accepted if (USERINVENTORY[i].tradable && USERINVENTORY[i].marketable) { hisKeys.push(USERINVENTORY[i]); } else if (!USERINVENTORY[i].marketable) { // This key is not marketable, never notMarketable++; } else if (!USERINVENTORY[i].tradable) { // This key is not tradable, delay up to 7 days notTradable++; } } } // Cancel if the user does not have keys or their quantity is not enough: if (hisKeys.length < amountOfKeys) { let addInfo = ""; if (notTradable) { addInfo += "\n\nSome of your keys (" + notTradable + ") have an exchange delay of up to 7 days."; } if (notMarketable) { addInfo += "\n\nSome of your keys (" + notMarketable + ") bought in the game and can not be exchanged or sold, never!" + "\nYou can return them back within 48 hours after purchase." + "\nhttps://help.steampowered.com/en/wizard/HelpWithGameIssue/?appid=730&issueid=107"; } if (hisKeys.length < 1) { // No one client.chatMessage(SENDER, "You do not have the keys that I accept." + addInfo); } else { // Less than need client.chatMessage(SENDER, "You do not have enough keys." + addInfo); } } else { console.log(hisKeys.length + "/" + amountOfKeys); // trade.addTheirItems(hisKeys); // Adding keys to the trade (!!!) } } });
  16. Hey. I wanted to know if there is a way to find out if the User's inventory has been changed? Without a second inventory check. Maybe there is a way to get an inventory hash or item count? Suppose the following situation: User uses command !CHECK The bot receives the user's inventory and gives information. User uses command !SELL The bot receives the user's inventory and and sends the trade offer. I would like to get rid of the second inventory check and use the first (I save it). But there may be another situation: User uses command !CHECK The bot receives the user's inventory and gives information. User receives or sells items / Inventory has been changed User uses command !SELL ? Any ideas? I think I can save the result with a time stamp. But I think that even here rare errors are possible. // !check: community.getUserInventoryContents( ... (err, inv) => { hisInv = [inv, Date.now()]; // !sell: if (hisInv and hisInv[1] < Date.now() - $minute) { //sendtradeoffer } else { community.getUserInventoryContents( ... (err, inv) => { //sendtradeoffer
  17. I would wager that the event listeners you attached to the bot are keeping it in memory. You might need to call bot.removeAllListeners().
  18. Might be an issue with my code actually. This is what I've got currently as start/stop function: function startBot(steamUsername, steamPassword) { if(typeof activeBots[steamUsername] !== 'undefined' && activeBots[steamUsername]) { stopBot(steamUsername); } activeBots[steamUsername] = createBot(steamUsername, steamPassword); activeBots[steamUsername].steamLogin(); } function stopBot(steamUsername) { if(typeof activeBots[steamUsername] !== 'undefined' && activeBots[steamUsername]) { activeBots[steamUsername].logOff(); // logout delete activeBots[steamUsername]; // clear memory? log('bot stopped', steamUsername); } } When I run a test like this, it always seem to leave the SteamUser class in memory forever, Even though they exit with error 34: async function runTest1() { startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account1', ''); startBot('account2', ''); startBot('account3', ''); await sleep(30000); stopBot('account1'); stopBot('account2'); stopBot('account3'); await sleep(200000); }
  19. After login in steam with node js i get in console sessionid,steamLogin and SteamLoginSecure how i can get access to steamcommunity.com using this data for example i mean steamcommunity.com/?sessionid=MYID&SteamLoginSecure=MYinfo but it’s not work
  20. The modules may work without the peer dependencies, or you should just install them yourself manually with npm install.
  21. Hello,i need help.I try resolve the problem 4 days.. Today i register for ask community. After [npm i ws],[npm i socket.io] and other npm packages i get answer npm WARN [email protected] requires a peer of [email protected]^4.0.1 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of [email protected]^5.0.2 but none is installed. You must install peer dependencies yourself. i try install bufferutil and utf-8-validate,try install with --save option,not help. Try on ubuntu 16.04,Debian 9 Please,help.
  22. 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 })); }
  23. 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?
  24. That looks fine, although you aren't going to handle any scenarios where the bot gets kicked off of Steam after logon.
  25. Hello, What is the proper way to remove/clear a steamUser class from memory after it has run into the error event? If the logOn(); was successful and I call the logOff() and then delete the var it seems to get cleared properly or picked up by the GC at least. with an error this doesn't seem the case and hangs around in the memory forever. (tested with --inspect) (I know delete might not work if it is referenced somewhere else but its not. Also I understand that it won't get cleared instantly but might be picked up by the garbage collector correct? but even after leaving it idle for a long time afterwards with no running bots the steamUser in the memory never gets cleared) Or am I doing something obviously wrong in the code? Any help would be appreciated. SteamUser: 4.13.2 NodeJS: v12.16.1 const SteamUser = require('steam-user'); var activeBots = {}; var botOptions = { promptSteamGuardCode: false, singleSentryfile: false, autoRelogin: true, //localAddress: '', dataDirectory: null, }; function createBot(steamUsername, steamPassword) { var bot = new SteamUser(botOptions); /* * Bot Functions */ bot.steamLogin = function () { bot.logOn({ 'accountName': steamUsername, 'password': steamPassword, }); } /* * Bot Events */ bot.on('loggedOn', function(details) { log('loggedOn successful', steamUsername); bot.gamesPlayed([730]); // csgo log('loggedOn gamesPlayed successful', steamUsername); }); bot.on('error', function(err) { switch(err.eresult) { case 5: log('error: invalid password'); case 84: log('error: rate limit exceeded'); case 6: log('error: logged in elsewhere'); default: log('error: ' + err.eresult, steamUsername); } // stop bot on any error stopBot(steamUsername); }); return bot; } function startBot(steamUsername, steamPassword) { activeBots[steamUsername] = createBot(steamUsername, steamPassword); activeBots[steamUsername].steamLogin(); } function stopBot(steamUsername) { if(typeof activeBots[steamUsername] !== 'undefined' && activeBots[steamUsername]) { //await activeBots[steamUsername].logOff(); // logOff is not async function? activeBots[steamUsername].logOff(); // logout, but if the bot ran into an error its not logged in delete activeBots[steamUsername]; // seems to work, but not if it ran into an error log('bot stopped', steamUsername); } } /* * Logging */ function log(message, steamUsername = false) { if (steamUsername) { console.log('[' + steamUsername + '] ' + message); } else { console.log(message); } } // testing runTest1(); async function runTest1() { startBot('', ''); await sleep(5000); stopBot(''); await sleep(200000); } function sleep(ms) { return new Promise((resolve) => { setTimeout(resolve, ms); }); } console.log('end of file');
  26. I have a Bot class and an async method for logIn, are there any better way for writing this method? completeLogin(botDetails, useLoginKey) { this.user.logOn(this.details(botDetails, useLoginKey)); return new Promise((done, reject) => { const cxt = this; async function success(_, cookies) { try { await cxt.setCookies(cookies); cxt.user.off('error', failed); done(); } catch(err) { reject(err); } } function failed(err) { cxt.user.off('webSession', success); reject(err); } cxt.user.once('webSession', success); cxt.user.once('error', failed); }); }
  1. Load more activity
×
×
  • Create New...