TextDynasty
-
Posts
144 -
Joined
-
Last visited
Posts posted by TextDynasty
-
-
One more question. How to get the offerid?
Got this error
Offer Sent!! Check your trade offer by clicking here https://steamcommunity.com/tradeoffer/undefined . Feel free to contact my owner. //it should be the id instead of undefined there.
var token = manager.getOffer; // Add what we should to the current trade console.log("Adding " + amount + " rec."); for (let i = 0; i < amount; i++) { trade.addMyItem(pool[i]); } // Send the offer off to Steam with a cute message trade.send(); community.startConfirmationChecker(15 * 1000, config.identity); client.chatMessage(steamID, "Offer Sent!! Check your trade offer by clicking here https://steamcommunity.com/tradeoffer/" + token.id + ". Feel free to contact my owner.");
-
Either call
trade.addMyItem
to add items one-by-one, or calltrade.addMyItems
on the entirepool
to add them all at once.addMyItem
is for single items.addMyItems
is for arrays of multiple items.addMyItem solved my problem. Thanks and Merry Christmas
-
node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:173 items.forEach(function(item) { ^ TypeError: items.forEach is not a function
Got that error.
My code
manager.getInventoryContents(440, 2, true, function (err, inventory){ if (err) { console.log(err); } else { // Filter out all the crates var pool = inventory.filter(function (item) { return item.name == "Reclaimed Metal" }); // Let the user know we don't have any if (pool.length === 0) { client.chatMessage(steamID, 'I don\'t have available. Sorry!'); return true; // Give up } // Let the user know we don't have enough else if (amount > pool.length) { console.log('User requested '+amount+' of I only have '+pool.length+' available.'); client.chatMessage(steamID, 'I only have '+pool.length+' crates of series available. Sending a trade offer with all crates of this series.'); } // Start a new trade offer var trade = manager.createOffer(steamID); // Add what we should to the current trade console.log('Adding '+ amount +' rec '); for (let i = 0; i < amount; i++) { trade.addMyItems(pool[i]); } // Send the offer off to Steam with a cute message trade.send(); } });
-
-
How to delete crates automatically with the tf2 package
-
-
Thanks npm update solve my problem
-
The Error said:
TimeoutOverflowWarning: 1512342843522 does not fit into a 32-bit signed integer. Timeout duration was set to 1.
And what do you mean by timer of 2^31?
It works fine on my local computer, but in the cloud server this just happen when i sent the bot offer
-
My server console was fulled of this warming what can i do
-
Need some help to solve the problem. The bot run fine in local but it cannot read any modules in the cloud server (heroku)
-
Anyone tell me what can i do with the backpack.tf listing api? Is there anyway to accept the trade offer with correct listing in bp.tf
-
Is that possible to make the bot crosscheck the listing price of the bp.tf website?
-
Any ideas?
-
I don't think that is just Steam issue. The onlyRKeys works perfectly, but the onlyGKeys always pop up that message even the amount is correct
-
manager.on("newOffer", function(offer) { console.log("Incoming offer from " + offer.partner.toString()); //Declining all Trade Holds offer.getUserDetails(function(err, me, them) { if (them) { if (them.escrowDays > 0) { offer.decline(); console.log("They have trade holds. Declining."); client.chatMessage(admin, "User sent a offer with trade hold. Declined.") client.addFriend(user); setTimeout(function() {client.chatMessage(user, "Sorry. We don't accept offer with trade hold.")}, 10000); }} }); var Rkey = 0 var Gkey = 0 var Gmetal = 0 var Rmetal = 0 var user = offer.partner.getSteam3RenderedID() var admin = "76561198302774490" offer.itemsToReceive.forEach(function(item) { if (item.name == "Mann Co. Supply Crate Key"){ return Rkey++ } else if (item.name == "Refined Metal"){ return Rmetal += 9 } else if (item.name == "Reclaimed Metal"){ return Rmetal += 3 } else if (item.name == "Scrap Metal"){ return Rmetal++ }} ); offer.itemsToGive.forEach(function(item) { if (item.name == "Mann Co. Supply Crate Key"){ return Gkey++ } else if (item.name == "Refined Metal"){ return Gmetal += 9 } else if (item.name == "Reclaimed Metal"){ return Gmetal += 3 } else if (item.name == "Scrap Metal"){ return Gmetal++ } }); var onlyGKeys = (offer.itemsToGive.every(function(item) { return item.name == "Mann Co. Supply Crate Key"; })); var onlyRKeys = (offer.itemsToReceive.every(function(item) { return item.name == "Mann Co. Supply Crate Key"; })); //sell key if (onlyGKeys) { if (Rmetal === Gkey * sellkeyprice) { offer.accept(function(err) { if (err) console.log(err); else console.log("Sold " + Gkey + " Keys."); console.log("Amount Correct! Accepting the trade offer."); if (Gkey > 0) { client.chatMessage(admin, "Sold " + Gkey + " Mann Co. Supply Keys."); } setTimeout(function() {client.chatMessage(user, "Thanks for using. http://steamcommunity.com/id/111111111")}, 5000); }); } else { offer.decline(function(err) { if (err) console.log(err); else console.log("Trade offer not validated. Declining"); client.chatMessage(admin, "They are buying it for " + Rmetal + " Scrap Metal."); client.addFriend(user); setTimeout(function() {client.chatMessage(user, "Your offer is incorrect. Please check it again or resent it later.")}, 10000); }); }} //buy key if (onlyRKeys) { if (Gmetal === Rkey * buykeyprice) { offer.accept(function(err) { if (err) console.log(err); else console.log("Bought " + Rkey + " Keys."); console.log("Amount Correct! Accepting the trade offer."); if (Rkey > 0) { client.chatMessage(admin, "Bought " + Rkey + " Mann Co. Supply Keys."); } setTimeout(function() {client.chatMessage(user, "Thanks for using. http://steamcommunity.com/id/11111111")}, 5000); }); } else { offer.decline(function(err) { if (err) console.log(err); else console.log("Trade offer not validated. Declining"); client.chatMessage(admin, "They are selling it for " + Gmetal + " Scrap Metal."); client.addFriend(user); setTimeout(function() {client.chatMessage(user, "Your offer is incorrect. Please check it again or resent it later.")}, 15000); }); }} //other offers will be declined else { offer.decline(function(err) { if (err) console.log(err); else console.log("Trade offer not validated. Declining"); client.chatMessage(admin, "User provided a wrong offer. Declined."); client.addFriend(user); setTimeout(function() {client.chatMessage(user, "Your offer is incorrect. Please check it again or resent it later.")}, 15000); }); }});
Error:
Trade offer not validated. Declining { Error: There was an error accepting this trade offer. Please try again later. (11) at Object.exports.makeAnError (C:\Users\Admin\Desktop\Ashley\node_modules\steam-tradeoffer-manager\lib\helpers.js:17:12) at SteamCommunity.manager._community.httpRequestPost (C:\Users\Admin\Desktop\Ashley\node_modules\steam-tradeoffer-manager\lib\classes\TradeOffer.js:485:13) at Request._callback (C:\Users\Admin\Desktop\Ashley\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (C:\Users\Admin\Desktop\Ashley\node_modules\request\request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (C:\Users\Admin\Desktop\Ashley\node_modules\request\request.js:1163:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage.<anonymous> (C:\Users\Admin\Desktop\Ashley\node_modules\request\request.js:1085:12) eresult: 11 } Amount Correct! Accepting the trade offer.
Anyone can help?
-
Is there any ways to run the bot 24/7 without VPS or opening the local computer 24/7?
-
Is there a way to autobump the listing in bp.tf in the node? If so, any advices?
-
How to relaunch the tf2 after a while so that it can load.
if (message == "scrap") {{ if (refCount > 1) { let refinedToSmelt = refCount; console.log("Smelting Refined Metals".green); if (refinedToSmelt > usableRefineds.length) { console.log(("We should have %d refineds to balance the reclaimeds, but we " + ((usableRefineds.length > 0) ? ("only have " + usableRefineds.length + ".") : "have none. Skipping.") + (config.get("avoidMetalInActiveTradeOffers") ? " Maybe some metal are in trade offers?" : "")).magenta, refinedToSmelt); refinedToSmelt = usableRefineds.length; } for (let i = 0; i < refinedToSmelt; i++) { metalCrafter.smeltRefined(usableRefineds[i].id); }} if (recCount > 1) { let reclaimedToSmelt = recCount; console.log("Smelting Reclaimed Metals".green); if (reclaimedToSmelt > usableReclaimeds.length) { console.log(("We should have %d reclaimeds to balance the scraps, but we " + (usableReclaimeds.length > 0) ? ("only have " + usableReclaimeds.length) : "have none. Skipping.").magenta, reclaimedToSmelt); reclaimedToSmelt = usableReclaimeds.length; } for (let i = 0; i < reclaimedToSmelt; i++) { metalCrafter.smeltReclaimed(usableReclaimeds[i].id); }} // If we haven't smelt anything, yet we should have, let it continue as we probably will smelt refined. client.setPersona(0); client.gamesPlayed(440); // it instantly reopened tf2 and not showing the metals }}
-
How to renew to backpack after craft. Because i need to reopen the bot to see the crafted metals.
-
Bots filter the message sent to the specific number (with .replace, .split, whatever) Then convert the data type of that string containing a number to an actual number with parseInt, then it processes the trade with X items
Yes, could you give me an example, so i can start configuring it? Thanks
-
How can the bot send an offer according to the number people are asking
-
Found a way doing that. Thanks for help
-
-
I wanted to build a bot with a function that can automatically detect metal and smelt them to make the trade easiler
Question
in node-steam-tradeoffer-manager
Posted
It fixed thanks.
But when i run the code it just go this error
Code
ERROR