Jump to content
McKay Development

PonyExpress

Member
  • Content Count

    49
  • Joined

  • Last visited

Everything posted by PonyExpress

  1. 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 (!!!) } } });
  2. 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
  3. Thank you for your quick response. Is there any information about all the properties? I would like to know more about the differences between market_hash_name and market_hash and some others.
  4. Can I check which key the user has: The key can be tradable in 7 days (Old key) The key was bought in the game and it can not be traded or sold never (New key) Here are the data I get using manager.getUserInventoryContents(FRIEND_SID, 730, 2, false, (ERR, DATA) Old key: CEconItem { appid: 730, contextid: '2', assetid: '18042278743', classid: '3737821870', instanceid: '143865972', amount: 1, pos: 1, id: '18042278743', background_color: '', icon_url: '-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXX7gNTPcUxuxpJSXPbQv2S1MDeXkh6LBBOievrLVY2i6ebKDsbv47hw4TTlaSsZeKIxztQu8B03L2Y8Imh2Aftrhc-Z3ezetFDsuzS1g', descriptions: [ { type: 'html', value: 'This key only opens Winter Offensive Cases' }, { type: 'html', value: ' ' }, { type: 'html', value: '', color: '00a000' } ], tradable: false, name: 'Winter Offensive Case Key', name_color: 'D2D2D2', type: 'Base Grade Key', market_name: 'Winter Offensive Case Key', market_hash_name: 'Winter Offensive Case Key', commodity: true, market_tradable_restriction: 7, marketable: true, tags: [ { internal_name: 'CSGO_Tool_WeaponCase_KeyTag', name: 'Key', category: 'Type', color: '', category_name: 'Type' }, { internal_name: 'normal', name: 'Normal', category: 'Quality', color: '', category_name: 'Category' }, { internal_name: 'Rarity_Common', name: 'Base Grade', category: 'Rarity', color: 'b0c3d9', category_name: 'Quality' } ], is_currency: false, market_marketable_restriction: 0, fraudwarnings: [] } UNKNOWN key: CEconItem { appid: 730, contextid: '2', assetid: '17964401838', classid: '3586512622', instanceid: '143865972', amount: 1, pos: 2, id: '17964401838', background_color: '', icon_url: '-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXX7gNTPcUxuxpJSXPbQv2S1MDeXkh6LBBOiev8ZQQ30KubIWVDudrgkNncw6-hY-2Fkz1S7JRz2erHodnzig2xqUVvYDrtZNjCAC7WDrU', descriptions: [ { type: 'html', value: 'This key only opens Clutch cases' }, { type: 'html', value: ' ' }, { type: 'html', value: '', color: '00a000' }, { type: 'html', value: ' ' }, { type: 'html', value: '' } ], tradable: false, name: 'Clutch Case Key', name_color: 'D2D2D2', type: 'Base Grade Key', market_name: 'Clutch Case Key', market_hash_name: 'Clutch Case Key', commodity: true, market_tradable_restriction: 7, marketable: false, tags: [ { internal_name: 'CSGO_Tool_WeaponCase_KeyTag', name: 'Key', category: 'Type', color: '', category_name: 'Type' }, { internal_name: 'normal', name: 'Normal', category: 'Quality', color: '', category_name: 'Category' }, { internal_name: 'Rarity_Common', name: 'Base Grade', category: 'Rarity', color: 'b0c3d9', category_name: 'Quality' } ], is_currency: false, market_marketable_restriction: 0, fraudwarnings: [] } As I see, I have to check to see the parameter "marketable"? Should this parameter always be true for all old keys and false for all new keys? Regardless of how the key was received (on the market / trade / purchased in the game long ago). Thanks.
  5. client.chat.sendFriendMessage(sid, "You are deleted. Bye-Bye!", null, (err, response) => { if (err) { // nothing } else { client.removeFriend(sid); } }); I think this should work. Or not?
  6. Thanks. If anyone wants to solve this problem for their bot, here is a temporary solution: const client = new SteamUser({ "language": "english" }); client.delayMessage = function(sid, msg, type) { setTimeout(function() { client.chatMessage(sid, msg, type); }, 1000); }; // Replace all "client.chatMessage" to "client.delayMessage"
  7. Hello! In the last 2-3 days there is an (Steam) error when the user does not receive messages from the bot. Messages are successfully sent and will be found in the user's chat after the client reboots. I noticed a pattern: this applies only to messages that are sent instantly (usually such as !help / !prices). The user may not receive such messages. The user will always receive messages with any delay (usually such as !check / !buy) when the bot needs time to make a calculation (However, the user may still not receive messages such as "I'm fulfilling your request, please wait"). I don't want to wait for Steam to fix this. Can I set the minimum delay (at least 1 sec) globally? Test: if (MSG == "QQQ") { client.chatMessage(SENDER, "Ok, QQQ"); } else if (MSG == "WWW") { client.chatTyping(SENDER); client.chatMessage(SENDER, "Ok, WWW"); } else if (MSG == "EEE") { setTimeout(function() { client.chatMessage(SENDER, "Ok, EEE"); }, 1000); } Results, User client: u: QQQ b: <nothing> u: QQQ b: <nothing> u: QQQ b: Ok, QQQ u: QQQ b: <nothing> u: QQQ b: <nothing> u: WWW b: <nothing> u: WWW b: <nothing> u: WWW b: Ok, WWW u: WWW b: <nothing> u: WWW b: <nothing> u: EEE b: Ok, EEE u: EEE b: Ok, EEE u: EEE b: Ok, EEE u: EEE b: Ok, EEE u: EEE b: Ok, EEE PS: I would not want to change ALL client.chatMessage(); to setTimeout(function() { client.chatMessage(); }, 1000); I want to know how can I do this globally in a module file.
  8. Thanks. I stopped on this option: function GoTrade(SENDER, MSG, OPTIONS) { // SID, MSG, { OFFER, trade or tradelink } let trade; if (OPTIONS.offerdata) { // trade = OPTIONS.offerdata.counter(); // old trade = OPTIONS.offerdata; // NEW } else if (OPTIONS.tradelink) { //TODO: } else { trade = manager.createOffer(SENDER); } trade.getUserDetails((ERR, BotDetails, USERDETAILS) => { if (ERR) { // ... } else { if (OPTIONS.offerdata) { // NEW trade = OPTIONS.offerdata.counter(); } //...
  9. I still have a problem using getUserDetails Should I use getUserDetails before OFFER.counter ? Or maybe i can use for (let trade), which i create? Could you check and tell me the best option that I should use? Thanks! manager.on("newOffer", (OFFER) => { OFFER.itemsToGive = []; // removeTheirItems(OFFER.itemsToReceive); OFFER.itemsToReceive = []; // removeMyItems(OFFER.itemsToGive); //NOTE: Should I do this? // OFFER.getUserDetails((ERR, BotDetails, USERDETAILS) => { // if (ERR) return; // }); //NOTE: Or: // OFFER.getUserDetails((ERR, BotDetails, USERDETAILS) => { // if (!ERR && USERDETAILS.escrowDays <= 3) { // let trade = OFFER.counter(); // GoTrade(OFFER.partner, "trade", {tradedata: trade}); // } // }); GoTrade(OFFER.partner, null, {offerdata: OFFER}); }); client.on("friendMessage", (SENDER, MSG) => { if (MSG == "trade") { GoTrade(SENDER, MSG, {}); } if (MSG.indexOf("https://steamcommunity.com/tradeoffer/new/?partner=") >= 0) { GoTrade(null, null, {tradelink: MSG}); } }); function GoTrade(SENDER, MSG, OPTIONS) { // SID, MSG, { OFFER, trade or tradelink } let trade; if (OPTIONS.offerdata) { trade = OPTIONS.offerdata.counter(); } else if (OPTIONS.tradelink) { //TODO: } else if (OPTIONS.tradedata) { trade = JSON.stringify(tradedata); } else { trade = manager.createOffer(SENDER); } trade.getUserDetails((ERR, BotDetails, USERDETAILS) => { if (ERR) { //NOTE: Should I do this? // if (ERR && !OPTIONS.offerdata) { if (ERR.toString().indexOf("user_inventory_hidden") >= 0) { //... } else if (ERR.toString().indexOf("user_cant_trade") >= 0) { //... } else if (ERR.toString().indexOf("USER_NOT_FRIEND") >= 0) { //... } else { //... } } else if (USERDETAILS.escrowDays > 3) { //... } else { // manager.getUserInventoryContents( ... ) => { // trade.addMyItems( ... ); // trade.addTheirItems( ... ); // trade.setMessage( ... ); // trade.send((ERR) => { } }); }; Also, I don’t understand how it works counter(). How does Steam know if I can send counter or not? Can i send more than one counteroffer usung duplicate()?
  10. Yes. I'm trying to simulate the friendMessage event. I want to use it like this: client.on("friendMessage", (SENDER, MSG, FROM_NEW_OFFER, OFFER) => { // or: client.on("friendMessage", (SENDER, [MSG, FROM_NEW_OFFER, OFFER]) => { if (MSG == "help") { // to do something if (FROM_NEW_OFFER) { OFFER.to_do_something(); } } }); manager.on("newOffer", (OFFER) => { client.emit('friendMessage', OFFER.partner, "help", "FROM_NEW_OFFER", OFFER); }); I know I can do it, but I don’t want to: client.on("friendMessage", (SENDER, MSG) => { if (MSG == "help") { Help(SENDER, MSG); } }); manager.on("newOffer", (OFFER) => { Help(OFFER.partner, "help", "FROM_NEW_OFFER", OFFER); }); function Help(SENDER, MSG, FROM_NEW_OFFER, OFFER) { if (MSG == "help") { // to do something if (FROM_NEW_OFFER) { OFFER.to_do_something(); } } }
  11. Thank you, it looks like what I need. But I can’t figure out how to do it. client.emit('friendMessage', new SteamID('76561197983852931'), "help");
  12. I would like to manually create an event. How should I do this? For example, I want to create an event in which the program will work just like that if it receives a message. I think I should have 2 options: handling multiple event events or creating an event. I think both options should work something like this: var message = {}; client.on("friendMessage", (SENDER, MSG) => { // If an event or variable is not empty: // (client.on("friendMessage", (SENDER, MSG)) || (message != {}) => { if (message) { SENDER = message.msg; MSG = message.sid; message = {}; } client.chatMessage(SENDER, "OK"); }); message = {sid: { universe: 1, type: 1, instance: 1, accountid: 12345678 }, msg: "test"}; // Something like event creation: // client.on("friendMessage", SENDER: { universe: 1, type: 1, instance: 1, accountid: 23587203 }, MSG: "test");
  13. Get your trade offer url: community.getTradeURL((ERR, URL) => { if (ERR) { console.log(ERR); } else { console.log(URL); } }); Get another user's trade offer url - I don’t think it is possible. But you can send a counter offer: The user sends you any trading offer You make a counter offer: manager.on("newOffer", (OFFER) => { let trade = OFFER.counter(); Usage example: << Just send me a trade offer by using this link: https://steamcommunity.com/tradeoffer/new/?for_tradingcard=470480_10&partner=192485611&token=Fj1qrxzG . In a few seconds, you will have a new trade offer from me. >> You will not be able to inform the user about the error if he is not in the list of your friends. For this test to work you must have 10-20 cards, public profile, public inventory etc. Otherwise, you will not receive any response.
  14. PonyExpress

    TF2 Error 15

    The bot sends 1 item to the user. I always thought error 15 means VAC-ban. However, this may also mean that the user is full of inventory (50/50 if user Free-to-play player). Is there a way to determine the reason why the bot cannot send a trade offer? trade.send((ERR) => { if (ERR && ERR.toString().indexOf("(15)") >= 0) { // VAC or Inv. full
  15. Is there any way to find any hidden chat features?Everyone knows about /code, /pre, etc.But in some cases we can see a special design like "Link removed", "Error sending message". Is it possible that this can be used like for example [error=Error]Any text[/error] Have an idea how to send a link without converting to a block? When the link is at the beginning or end of the message.Will be converted: "https://steamcommunity.com","Text https://steamcommunity.com" or "https://steamcommunity.com Text" Will not be: "Text https://steamcommunity.com Text" If you open a chat with a bot that uses the old script, you will see that the voice call button is not available (with description: User is not in beta testing chat).Is there any way to do this (disable this button) in the latest version node-steam-user without losing any functionality?
  16. I have a function that runs on average about 2 minutes. console.log(currentTime() + " START"); community.getSteamUser... if (DATA.onlineState == "online"... let trade = manager.createOffer... manager.getUserInventoryContents... for (let i in BotSets.BaseSets) {.... } for (let i in BotSets.FoilSets) {.... } // ---------------------------- INV = INV.filter((ITEM) => ITEM.getTag("item_class").internal_name == "item_class_2"); console.log(currentTime() + " TEST, STEP 05-A"); INV = INV.filter((ITEM) => ITEM.market_hash_name.indexOf("470480-Messenger") == -1); for (let i = 0; i < INV.length; i++) { if (i == 5000) console.log(currentTime() + " TEST, ITEMS CHECKED: 5,000"); if (i == 40000) console.log(currentTime() + " TEST, ITEMS CHECKED: 40,000"); if (i == 50000) console.log(currentTime() + " TEST, ITEMS CHECKED: 50,000"); if (i == 60000) console.log(currentTime() + " TEST, ITEMS CHECKED: 60,000"); if (i == 70000) console.log(currentTime() + " TEST, ITEMS CHECKED: 70,000"); if (i == 80000) console.log(currentTime() + " TEST, ITEMS CHECKED: 80,000"); if (i == 90000) console.log(currentTime() + " TEST, ITEMS CHECKED: 90,000"); if (i == 100000) console.log(currentTime() + " TEST, ITEMS CHECKED: 100,000"); if (i == 110000) console.log(currentTime() + " TEST, ITEMS CHECKED: 110,000"); if (amount < CONFIG.LIMITS.MAXTRANSFERCARDS && !idList.includes(INV[i].assetid)) { trade.addMyItem(INV[i]); amount++; } else if (amount == CONFIG.LIMITS.MAXTRANSFERCARDS && !idList.includes(INV[i].assetid)) { reachedLimit = true; break; } } console.log(currentTime() + " TEST, STEP 05-B"); // ---------------------------- trade.send((ERR) => { .... In the end, I get: 23:24 START 23:25 TEST, STEP 05-A 23:25 TEST, ITEMS CHECKED: 5,000 23:25 TEST, ITEMS CHECKED: 40,000 23:26 TEST, ITEMS CHECKED: 50,000 23:26 TEST, ITEMS CHECKED: 60,000 23:26 TEST, ITEMS CHECKED: 70,000 // >> here I see that the bot goes offline 23:26 TEST, ITEMS CHECKED: 80,000 23:26 TEST, ITEMS CHECKED: 90,000 23:27 TEST, STEP 05-B 23:27 Error: HTTP error 401 23:27 client.steamID: null 23:27 (WAIT FOR RECONECT) 23:27 An error occurred while sending trade offer: Error: Not Logged In 23:27 (Login...) Sometimes this function works, about 50/50%, but lately very often the bot goes offline before the trade offer is sent. Are there any tips, how can I prevent the bot from shutting down while this function is running?
  17. I turned off language in tradeoffermanager settings due to memory problems. I think the best option for me will be getting assetid/classid when I receive my inventory, for example when I receive my card sets.
  18. How can I find out what item the user wants to receive? 1. I want to continue if item name = "Abc name Trading Card" 2. If not, decline assetid/classid change very often and the code stops working. manager.on("newOffer", (OFFER) => { console.log(OFFER); if (OFFER.itemsToGive.length == 1 && (OFFER.itemsToGive[0].id == "10964018350" || OFFER.itemsToGive[0].id == "11724177271" )) { // accept TradeOffer { partner: SteamID { universe: 1, type: 1, instance: 1, accountid: 23587203 }, id: '3695907410', message: '', state: 2, itemsToGive: [ EconItem { appid: 753, contextid: '6', assetid: '11497188550', classid: '2238354881', instanceid: '0', amount: 1, missing: false, est_usd: '7', id: '11497188550', fraudwarnings: [], descriptions: [], owner_descriptions: [], actions: [], owner_actions: [], market_actions: [], tags: [], tradable: false, marketable: false, commodity: false, market_tradable_restriction: 0, market_marketable_restriction: 0 } ], itemsToReceive: [], isOurOffer: false, created: 2019-09-04T11:04:43.000Z, updated: 2019-09-04T11:04:43.000Z, expires: 2019-09-18T11:04:43.000Z, tradeID: null, fromRealTimeTrade: false, confirmationMethod: 0, escrowEnds: null, rawJson: '{\n\t"tradeofferid": "3695907410",\n\t"accountid_other": 23587203,\n\t"message": "",\n\t"expiration_time": 1568804683,\n\t"trade_offer_state": 2,\n\t"items_to_give": [\n\t\t{\n\t\t\t"appid": 753,\n\t\t\t"contextid": "6",\n\t\t\t"assetid": "11497188550",\n\t\t\t"classid": "2238354881",\n\t\t\t"instanceid": "0",\n\t\t\t"amount": "1",\n\t\t\t"missing": false,\n\t\t\t"est_usd": "7"\n\t\t}\n\t],\n\t"is_our_offer": false,\n\t"time_created": 1567595083,\n\t"time_updated": 1567595083,\n\t"from_real_time_trade": false,\n\t"escrow_end_date": 0,\n\t"confirmation_method": 0\n}' } However, I see no way to get the name (without loading all inventory). Is there any way to get the name of the items like getReceivedItems, but for itemsToGive? (And I also wanted to know why tradable = false)
  19. Solved. community.httpRequestGet("https://steamcommunity.com/my/inventory/", (ERR) => { if (ERR) { console.log("ERR"); } else { console.log("OK"); } }); To just reset the count to 0, if I have a large steam inventory, is there any difference to use "https://steamcommunity.com/my/inventory/"or "https://steamcommunity.com/my/inventory/#440"?
  20. Up. I still have not found a solution and am waiting for help.
  21. I do not understand how to reset the value. I want it to be reset after how the value was shown in the console. client.on("newItems", function(count) { if (parseInt(count) > 0) { console.log("New items: " + count); // RESET } });
  22. It depends on which bot you use. Most likely you need to find: .filter((ITEM) => ITEM.getTag("cardborder").internal_name == "cardborder_0"); "cardborder_0" (base cards) and try "cardborder_1" (foil). But you also need to check out many other parts of the code, including getting user profile badges.
  23. There is a limit by Steam: No more than 10 changes in 3 minutes. So the maximum that you can get, animation with 1 frame in 18 seconds.
  24. Dr. McKay, Thank you, at first glance it helped reduce memory consumption to 250-900 Mb. If I open bot trade offers page, I see that the offers are not cleared until i see them.For example, if I open the page 'Sent offers', first time I will see: 1. [Exchange rejected May 3. 2019] 2. [Exchange accepted May 3. 2019] 3. [Exchange accepted May 3. 2019, Delay: 12 days]After uptade this page I will see: 1. [Exchange accepted May 3. 2019, Delay: 12 days] I need to worry about it and somehow clean them or not?
  25. To make it more visual, I deleted almost everything and checked: var SteamTotp = require("steam-totp"); var TradeOfferManager = require("steam-tradeoffer-manager"); var SteamCommunity = require("steamcommunity"); var SteamUser = require("steam-user"); var CONFIG = require("config.js"); var client = new SteamUser(); var community = new SteamCommunity(); var manager = new TradeOfferManager({ "steam": client, "community": community, "language": "en", "pollInterval": "10000", "dataDirectory": CONFIG.POOLDATA.DIR, // "./pool_data" "savePollData": CONFIG.POOLDATA.SAVE // true }); client.logOn({ accountName: CONFIG.USERNAME, password: CONFIG.PASSWORD, twoFactorCode: SteamTotp.getAuthCode(CONFIG.SHAREDSECRET), identity_secret: CONFIG.IDENTITYSECRET, shared_secret: CONFIG.SHAREDSECRET, logonID: 1 }); client.on("loggedOn", () => { console.log("currentTime()" + " [ ACCOUNT ] [ LOGIN ] Name: " + CONFIG.USERNAME + " (" + client.steamID + ")"); client.setPersona(1); }); client.on("webSession", (sessionID, cookies) => { manager.setCookies(cookies, (ERR) => { if (ERR) { console.log("currentTime()" + " [ ACCOUNT ] [ LOGIN ] An error occurred while setting cookies: " + ERR); } else { console.log("currentTime()" + " [ ACCOUNT ] [ LOGIN ] Websession created and cookies set"); } }); community.setCookies(cookies); }); community.on("sessionExpired", () => { console.log("currentTime()" + " [ ACCOUNT ] [ LOGIN ] Session expired. Relogging..."); client.webLogOn(); }); // 800-1400 Mb memory, ~30-50% cpu// w/o manager.setCookies: 72-107 Mb memory, 0.2-1.5% cpu
×
×
  • Create New...