Jump to content


Photo
Question

inventory is undefined

node.js node-steamcommunity

  • Please log in to reply
7 replies to this topic

#1 EliteOneTUbe

EliteOneTUbe

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 29 April 2019 - 02:35 PM

The line that the error pops up : 

manager.getUserInventoryContents('76561198083528564', 440, 2, true, function (error, inventory) {
                        console.log(inventory.length);
                        for(let l = 0 ; l < inventory.length; l++) {
                            if(inventory[l].market_hash_name == prices[i].name) itemid = inventory[l].assetid;
                        }
})

Error: 

Attached File  Capture.PNG   26.6KB   0 downloads


Edited by EliteOneTUbe, 29 April 2019 - 02:37 PM.


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,127 posts

Posted 29 April 2019 - 02:55 PM

Check error.



#3 EliteOneTUbe

EliteOneTUbe

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 30 April 2019 - 01:08 AM

Check error.

{ Error: The request is a duplicate and the action has already occurred in the past, ignored this time
    at C:\Users\Nick\Desktop\botv2\node_modules\steamcommunity\components\users.js:440:12
    at SteamCommunity._checkHttpError (C:\Users\Nick\Desktop\botv2\node_modules\steamcommunity\components\http.js:110:3)    at Request._callback (C:\Users\Nick\Desktop\botv2\node_modules\steamcommunity\components\http.js:50:61)
    at Request.self.callback (C:\Users\Nick\Desktop\botv2\node_modules\request\request.js:185:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (C:\Users\Nick\Desktop\botv2\node_modules\request\request.js:1161:10)
    at Request.emit (events.js:182:13)
    at Gunzip.<anonymous> (C:\Users\Nick\Desktop\botv2\node_modules\request\request.js:1083:12)
    at Object.onceWrapper (events.js:273:13)
    at Gunzip.emit (events.js:187:15) eresult: '29' }


#4 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,127 posts

Posted 30 April 2019 - 02:16 AM

That's just Steam being Steam.



#5 EliteOneTUbe

EliteOneTUbe

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 30 April 2019 - 02:18 AM

That's just Steam being Steam.

So I cant call my inventory if I called it a few seconds ago?



#6 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,127 posts

Posted 30 April 2019 - 02:19 AM

That's not necessarily what that means. What exactly that error means is pretty much unknown. The takeaway here should be that you need to catch and handle errors, or else your stuff will crash.



#7 EliteOneTUbe

EliteOneTUbe

    Newbie

  • Member
  • Pip
  • 5 posts

Posted 30 April 2019 - 02:25 AM

That's not necessarily what that means. What exactly that error means is pretty much unknown. The takeaway here should be that you need to catch and handle errors, or else your stuff will crash.

I guess its time for me to google how to handle errors


Edited by EliteOneTUbe, 30 April 2019 - 02:25 AM.


#8 SnaBe

SnaBe

    Advanced Member

  • Member
  • PipPipPip
  • 31 posts
  • LocationDenmark

Posted 01 May 2019 - 04:08 AM

You could use Try Catch for error handling. 


"Truth can only be found in one place: the code." - Robert C. Martin






Also tagged with one or more of these keywords: Question, node.js, node-steamcommunity

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users