Jump to content
McKay Development

tchosniper

Member
  • Content Count

    11
  • Joined

  • Last visited

  1. Hello, I'm trying to use function getExchangeDetails, to get old asseit and new_assetid, but if I type offer.getExchangeDetails(function(err, receivedItems) { if(!err) { console.log("New items: " + receivedItems); console.log(receivedItems[0].new_assetid); console.log(receivedItems[0].assetid); } else { console.log("[ERROR] Loading offer items details."); } });the output is: 3 (But items count was 4, maybe 0 is number too) undefined or TypeError: Cannot read property '0' of undefined undefined or TypeError: Cannot read property '0' of undefined I don't know where is the mistake, somebody can explain to me, please? Thanks, Alex.
  2. Hello, I'm need cancel offer from offerID, this is my code: manager.getOffer(row.offer_id, function(offer, err) { console.log(offer + ", " + row.offer_id); if(!err) { offer.cancel(); console.log("[ERROR] Offer canceled"); //Delete record from MySQL } else { console.log("[ERROR] With cancel offer" + err); } }); The output: null, 1717716013 [ERROR] With cancel offer [object Object] Where I do mistake ? Because I'm getting error.
  3. And the code work perfectly, but after +- 30-60 minutes I will get this error
  4. Thanks, but If I fix something, I must get new error.. And now I think that is not in documentation (Atleast I didn't found it) offer.getUserDetails(function (err, them, me, escrowDays) { if(!err) { console.log("[INFO] Trade escrow(buddy): " + them['escrowDays'] + ", me: " + me['escrowDays']); // more code } else { console.log("[ERROR] Error - loading user data. " + err); if(err == "Error: Not Logged In") { console.log("[INFO] Reason: not login, trying relog"); client.logOn({ "accountName": config.username, "password": config.password }); } } }); From this code, I was getting "[ERROR] Error - loading user data. Error: Not Logged In" so I tried add code to login client.logOn({ "accountName": config.username, "password": config.password }); But after I get this in console: /root/node_modules/steam-user/components/logon.js:11 throw new Error("Already logged on, cannot log on again"); ^ Error: Already logged on, cannot log on again at SteamUser.logOn (/root/node_modules/steam-user/components/logon.js:11:9) at /root/bot2/ust.js:246:56 at Object.exports.makeAnError (/root/node_modules/steam-tradeoffer-manager/lib/helpers.js:33:4) at manager._community.httpRequestGet (/root/node_modules/steam-tradeoffer-manager/lib/classes/TradeOffer.js:801:12) at SteamCommunity._checkCommunityError (/root/node_modules/steamcommunity/components/http.js:129:3) at Request._callback (/root/node_modules/steamcommunity/components/http.js:51:88) at Request.self.callback (/root/node_modules/request/request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/root/node_modules/request/request.js:1081:10) So I'm dont understand to "Error: Not Logged In"
  5. Oh, thanks. But If its correct why I get 0, If the trade will be holded for 1 day? (=I had authentificator, but I removed it and now I again activate so I'm need wait 7 days to instant trades, but why I getting 0 If I should get 1?)
  6. About escrow, is this code right? Because I'm getting always 0 offer.getUserDetails(function (err, them) { if(!err) { console.log(them['escrowDays']); And I think you dont understand to my question (Its maybe because my english) but I'm need to check from offer.id if the offer is sent/confirmed/declined/(changed - counter offer)
  7. Thanks, but that is only 1 answer. You probably dont understand what I mean. This is my block of code repeat(20000, function() { //TRADE REQUEST objConn.query('SELECT * from trade_request', function(err, rows, fields) { if (!err){ if (rows.length > 0) { var time = new Date().toISOString().replace(/T/, ' ').replace(/\..+/, ''); console.log("[" + time + "] " + "[INFO] There is " + rows.length + " new requests (TRADE)"); for (var i = 0; i < rows.length; i++) { var row = rows[i]; if (row.type == 1) { var time = new Date().toISOString().replace(/T/, ' ').replace(/\..+/, ''); console.log("[" + time + "] " + "[INFO] New deposit request from " + row.steamID + " (request id: " + row.ID + ")"); if(row.status == 1) { //send offer var offer = manager.createOffer(row.trade_url); offer.addTheirItem({"appid": 730, "contextid": 2, "assetid": row.assetid}); offer.send(function(err, status) { if (err) { console.log("[ERROR] Sending offer - " + err); } else { console.log("Offer #" + offer.id + " " + status); //SET STATUS = 2 objConn.query('UPDATE trade_request SET status=2 WHERE ID='+row.ID, function(err, rows, fields) { if (!err){ console.log("[INFO] Trade request for " + row.ID + " updated to: 2."); } else { console.log("[INFO] Error updating status " + err); } }); } console.log(status); }); } } else if (row.status == 2) { //check sent offer } else { //del request } } The bot check MySQL table If there is some new deposit request. In status 1, the bot will check if he have mobile authentificator, send offer and update status for deposit status to 2 and also in console I'll see 'sent' + Offer.id. And I want to ask If there is any option to check the status after like manager.checkOfferStatus(Offer.id) ?
  8. Hello, this is my code var offer = manager.createOffer(row.trade_url); offer.addTheirItem({"appid": 730, "contextid": 2, "assetid": row.assetid}); offer.send(function(err, status) { if (err) { console.log("[ERROR] Sending offer - " + err); } else { console.log("Offer #" + offer.id + " " + status); } console.log(status); }); Everything works, but can I check If he have mobile authentificator on?
  9. Okay thanks, and can I ask you why currencies say undefined?
  10. So can I use offer.addMyItem({"appid": 730, "contextid": 2, "classid": "xxxx"}); or offer.addMyItem({"appid": 730, "contextid": 2, "instanceid": "xxxx"}); or I need use only with assetid?
×
×
  • Create New...