Jump to content
McKay Development


  • Posts

  • Joined

  • Last visited

Majok's Achievements

  1. Well, i think u didn't understand me i don't build system such as on lvlup bot or just specified items bot so i can use .market_hash_name to define witch keys or stuff it accepts... I need to link it into database and make him put in offer how many metal it need + item witch bot trade to person... I already saw this posts and why you think if they can solve my problem i made new post ? I searched every single forum and stuff and i cant find anything similar. If i try to follow some guide on github for this specific module but it seems like its rl outdated since im getting errors inside of bot modules, im using newer version of module then when this guide was made. Here again: I need to create system witch will with command triggered when called by name of item existing in database & bots inventory creates trade offer with item witch is called by command and enough currency based on database (ref metal in this situtation), thats why i simply cannot use ..market_hash_name... Bot already understands how much 1 ref =, 1 rec =, 1 scrap is... If i used .market_hash_name it can be either 1,2,3,4,5 ref in offer not 2.33 for example.
  2. Hi, if someone can help me out with this i dont rl know how to build this and i created such a mess here with all of this code... I tryed to search up everywhere and i cant find similar problem... I have prices database in database.json file witch bot loads and then u can acces to !prices <item name>, similar to that i created !buy <item name> command witch is triggered when user insert name of item witch exist in database.json and in bots inventory(inventory.json)... After that bot needs to create offer with this items witch are selected...There i start having some issues. Down is my messed code if someone can explain what im doing wrong, and how i can make trade offer with selected items for price thats inside of database by chat command ? } else if (command === "!buy" && itemName) { const database = JSON.parse(fs.readFileSync('./database.json', 'utf8')); if(database[itemName]) { const buyPrice = database[itemName].sell; const sellPrice = database[itemName].sell.metal let offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=12345678&token=xxxxxxxx"); let t = manager.createOffer(steamID.getSteamID64()); t.getUserDetails((ERR, ME, THEM) => { if (ERR) { console.log("## An error occurred while getting trade holds: " + ERR); client.chatMessage(steamID, "An error occurred while getting your trade holds. Please try again"); } else if (ME.escrowDays == 0 && THEM.escrowDays == 0) { client.chatMessage(steamID, "Processing your request."); manager.getUserInventoryContents(steamID.getSteamID64(), 440, 2, true, (ERR, INV, CURR) => { offer.addTheirItems(INV); offer.addMyItems(INV); var MyItems = require(`./Inventory.JSON`); offer.send(function(err, status) { }, client.chatMessage(steamID, "Prepairing offer...")); if (ETradeOfferState == 12) { console.log(`Offer #${offer.id} sent, but requires confirmation`); community.acceptConfirmationForObject("identitySecret", offer.id, function(err) { if (err) { console.log(err); } else { console.log("Offer confirmed"); } }); } else { console.log(`Offer #${offer.id} sent successfully`); client.chatMessage(steamID, `Trade offer created ! [ offer ID: ${offer.id} ]`); } if (ERR) { console.log("## An error occurred while getting inventory: " + ERR); client.chatMessage(steamID, "An error occurred while loading your inventory. Please try later, or check if your inventory isnt on private ! \n If is that not case error is caused by Steam servers witch seems to be offline... \n Try to sent offer with up given price at link:\n https://steamcommunity.com/tradeoffer/new/?partner=xxxxxxxx "); } }); } });
  • Create New...