chnel
-
Posts
9 -
Joined
-
Last visited
Posts posted by chnel
-
-
Hi there,
i've been doing some tries as hobby and i wanted to share with you. I believe it will be usefull.
before read or copying the code just consider some valuable;
♦manager is a call from TradeOfferManager, so you will need to replace atleast tags.
var manager = new TradeOfferManager({"steam":client,"domain":"google.com","language":"en"});
function getInv(sTeamID,itmName){manager.loadUserInventory(sTeamID,730,2,false,function(err,inventory){if(err){console.log("[WARNING]: Couldn't load inventory of " + sTeamID + "!");}else{console.log(sTeamID+"inventory loaded");for (var p = 0;p<inventory.length;p++){if(inventory[p].market_hash_name == itmName){return inventory[p].assetid;}else{console.log(sTeamID+"item could not found");return false;}}}})}How to use :
explanation of valuables;
sTeamID : is the steamid of the person who own's that inventory.
itmName : is the item that you want to get assetid you need to set here market_hash_name.
Example using :
var hisItem = getInv("[U:1:00000000]","P2000 | Fire Elemental (Factory New)");
That will return to you asset id with that you can easily send trade offers.
Also you can combine with https://dev.doctormckay.com/topic/643-function-that-sends-offer-basic/ this to send trade easy as well.
Note : that function have been written for CSGO if you want to use this for other apps just edit the appid with yours or you could add a valuable to function and send it while calling the function.
-
Hi there,
i've been doing some tries as hobby and i wanted to share with you. I believe it will be usefull.
before read or copying the code just consider some valuable;
♦offer is a call from TradeOfferManager, so you will need to replace atleast tags.
var manager = new TradeOfferManager({"steam":client,"domain":"google.com","language":"en"});
♦client is a call of SteamUser.
var client = new SteamUser();
function sndTrade(mnItm,cItm,trdLink) { manager.setCookies(cookies, function(err) { if (err){console.log(err);process.exit(1);return;} var offer = manager.createOffer(trdLink); offer.addMyItem({"assetid":mnItm,"appid":730,"contextid":2}); offer.addTheirItem({"assetid":cItm,"appid":730,"contextid":2}); offer.send(function(err,status) { if (err) {console.log(err);return;} if (status == "pending"){console.log("offer #${offer.id} sent, but reqires confirmation.");} }); community.setCookies(cookies); }); }
How to use :
explanation of valuables;
mnItm : is your item's assetid that you want to add to trade.
cItm : is the assetid of you want to get.
trdLink: is the trade link of the person you want to trade.
Example using :
sndTrade("0000000","1111111",https://steamcommunity.com/tradeoffer/new/?partner=0000000&token=1111111)
To easily get assetid of the other user's item you can use https://dev.doctormckay.com/topic/644-function-that-returns-the-assetid-of-specific-item-basic/ as well.
Note : that function have been written for CSGO if you want to use this for other apps just edit the appid with yours or you could add a valuable to function and send it while calling the function.
-
manager.loadUserInventory("steam64id", 730, 2, false, function (err, inventory) { if (err) { console.log(warning("[WARNING]: Couldn't load inventory of " + user + "!")); } else { for (var p = 0; p< inventory.length; p++) { if (inventory[p].name == "skinname") { console.log(inventory[p].assetid); } } } });
here is how its solved if anyone needs.
set the steam id and skin name it will write down the asset id.
-
The documentation is pretty clear about how to add an item by assetid: https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#addmyitemitem
Yes it absolutely is, but what i tried to ask was not how to add an item by assetid. It was how to find it.
-
There are some examples in the examples directory that may help: https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/tree/master/examples
Well, thanks your time again but i could not figured out how to get assetid of item i want.
-
You can't try to send the offer until the callback of webSession. Please read up on asynchronous JavaScript and callbacks.
thanks for your time.
-
hi, im getting not logged in error and i could not find why
here is my code :
var SteamUser = require("steam-user"); var client = new SteamUser; var TradeOfferManager = require('steam-tradeoffer-manager'); var manager = new TradeOfferManager({ steam: client, domain: "localhost", language: "en", pollInterval: 10000, cancelTime: 300000 }); client.logOn({ "accountName":"steamid", "password":"steampw", }); client.on('loggedOn', function(details){ console.log("["+client.steamID.getSteam3RenderedID()+"]Logged on"); client.setPersona(SteamUser.EPersonaState.Online); client.gamesPlayed(440); }); client.on('error',function(e){console.log(e)}); client.on('webSession',function(sessionID,cookies){console.log("++WebSession++")}); client.on('newItems',function(count){console.console.log(count+" yeni eÅŸya.");}) client.on('accountLimitations', function(limited, communityBanned, locked, canInviteFriends) { var limitations = []; if(limited) { limitations.push('LIMITED'); } if(communityBanned) { limitations.push('COMMUNITY BANNED'); } if(locked) { limitations.push('LOCKED'); } if(limitations.length === 0) { console.log("Our account has no limitations."); } else { console.log("Our account is " + limitations.join(', ') + "."); } if(canInviteFriends) { console.log("Our account can invite friends."); } }); var offer = manager.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=11111&token=22222") offer.addMyItems([ { "appid": 730, "contextid": 2, "assetid": "7883664867" } ]); offer.addTheirItems([ { "appid": 730, "contextid": 2, "assetid": "7679971620" } ]); offer.send(function(err, status) { if (err) { throw err; } console.log("Offer #" + offer.id + " is now " + status); });
-
Hi there, i've been trying to do a bot as hobby. All the think i've been trying to is send a tradeoffer to my other account for spesific item. I've done it with the item id, which i get it by html code from chrome.
What i want to do is get that item id and send the offer.
Ex : i've a deagle sunset ww and i want to sent offer to myaccount2 this item for usp-s orion mw.
getting stuck at sending trades in loop
in node-steam-tradeoffer-manager
Posted
Hi, i've been trying to send trade offers in loop every time it blows.
Here is what im doing in theory:
im reading some valuables from local text file such as my items assetid, tradelinks and market hash name of item that i want to add trade.
then im creating offers in loop and sending them. i tried to sleep in loop and so many things every time it gives error.
in code :
i've tried without/with functions, tried to log every value to check up.