
ahmet
Member-
Posts
11 -
Joined
-
Last visited
Everything posted by ahmet
-
checks the user's gems and sends a trade offer. but I want the bot to add 1 gems to the trade offer created, but it always gives an error. I'm trying to do this with the following code trying to add 1 ore from the bot's inventory offer.addMyItems(item.amount = 1); I want the bot to add 1 gems to the trade offer. How can I do that? My Codes; case "gems": community.getUserInventory(partner, 753, 6, true, (error, items) => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } let accepted = files.getConfig().steamGems; var botgems = 0; var need = price; for (var i = 0; i < items.length; i += 1) { var item = items[i]; if (need !== 0) { if (accepted.indexOf(item.market_hash_name) >= 0) { item.amount = need <= item.amount ? need : item.amount; need -= item.amount; botgems += item.amount; } } offer.addTheirItem(item); offer.addMyItems(item.amount = 1); if(botgems == price) break; } if(botgems < price) { users.removeReservation(partner, true, removeFunc); return callback("/quote You do not have enough gems to purchase unique games."); } if(botgems > price) { users.removeReservation(partner, true, removeFunc); return callback("/quote ❌ An error occurred, please try again later."); } offer.send((error, status) => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } if(status == "pending") { community.acceptConfirmationForObject(files.getConfig().identity, offer.id, error => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } callback(null, "https://steamcommunity.com/tradeoffer/" + offer.id); }); } else if(status == "sent") callback(null, "https://steamcommunity.com/tradeoffer/" + offer.id); }); }); break;
-
The bot checks the user's gems and if there are enough gems, it transmits the swap offer. If the user cancels this trade offer and tries to create an offer again, then the bot says there are not enough gems. There's no problem creating the first trade offer, but if the first trade offer is canceled, the bot will always tell you there are not enough gems. I could not solve this problem. Can you please help? @Dr. McKay @SnaBe My Codes; case "gems": community.getUserInventory(partner, 753, 6, true, (error, items) => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } let count = 0; for(let i = 0; i < items.length; i++) { let item = items[i]; if(item.type.toLowerCase() != "steam gems") continue; count += item.amount; if(count > price) { item.amount -= (count - price); count -= (count - price); } offer.addTheirItem(item); if(count == price) break; } if(count < price) { users.removeReservation(partner, true, removeFunc); return callback("/quote You do not have enough gems to purchase unique games."); } if(count > price) { users.removeReservation(partner, true, removeFunc); return callback("/quote ❌ An error occurred, please try again later."); } offer.send((error, status) => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } if(status == "pending") { community.acceptConfirmationForObject(files.getConfig().identity, offer.id, error => { if(error) { users.removeReservation(partner, true, removeFunc); return callback(error); } callback(null, "https://steamcommunity.com/tradeoffer/" + offer.id); }); } else if(status == "sent") callback(null, "https://steamcommunity.com/tradeoffer/" + offer.id); }); }); break;
-
3 minutes timeout after a trade offer has been submitted
ahmet replied to ahmet's topic in node-steamcommunity
So how can I use cancelTime in an if else? I want to use this under another condition elsewhere -
3 minutes timeout after a trade offer has been submitted
ahmet posted a topic in node-steamcommunity
Bot bir takas teklifi gönderdiğinde, kullanıcı 3 dakika içinde kabul etmezse, otomatik olarak iptal etmesini istiyorum, bunu nasıl yapacağımı bilmiyorum. kodlarım: -
Question Error: Not Logged In (webLogOn() doesn't work)
ahmet replied to roughnecks's topic in node-steamcommunity
same problem. but nobody wants to find a solution to this problem! we have almost the same codes. -
Hello, bot successfully accepts first trade offer but does not accept next day or second offer; my console log is : trade offer status : undefined.
- 1 reply
-
- suggestion
- nodejs
-
(and 2 more)
Tagged with:
-
Switch Case Default exclusion Trade Offer Messages
ahmet replied to ahmet's topic in node-steamcommunity
can you give me an example I don't know how to believe it -
Hello, when someone sends a trading offer to the boat. Unknown Command sends message How can I exclude this
-
Very nice thank you!
-
bots write msg
-
hello, after adding bot friends, the welcome message sometimes sends, sometimes not, what could be the reason? client.on('friendRelationship', (steamID, relationship) => { if(relationship === SteamUser.EFriendRelationship.RequestRecipient) { info = 'info'; client.getPersonas([steamID], function(err, personas) { if (err) {console.log('error.')} else { var persona = personas[steamID.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamID.getSteamID64() + "]"); client.getSteamLevels([steamID], function(err, results) { if (err) {console.log('error.')} else { var level = results[steamID.getSteamID64()]; client.addFriend(steamID); print(`${auto.log(info)} Add User: ${name.yellow}, Steam Leveli: ${level}, İd: ${steamID.getSteamID64().yellow}`); if(config.friends.add_message) { var chat = auto.manageMessage(name) client.chatMessage(steamID, chat); print(`${auto.log(info)} Send Welcome Messages ${name.yellow}`); } } }); } }); } });