Hey There! I know that i need to write it by my self, but I already tried so many things and can't resolve my problem...
I need to execute 'get user inv' function after the 'get bot inv' function is done (By reloading the page), because the user inv loads faster and info about overstock comes later as the bot inv is loaded.
I tried to make a sleep function in index.js file. I set it between this two functions (It worked but only for both functions)
I asked on stackoverflow, and some users said me to use promises. But with the promises u can't get that result...
Hey There! I know that i need to write it by my self, but I already tried so many things and can't resolve my problem...
I need to execute 'get user inv' function after the 'get bot inv' function is done (By reloading the page), because the user inv loads faster and info about overstock comes later as the bot inv is loaded.
I tried to make a sleep function in index.js file. I set it between this two functions (It worked but only for both functions)
I asked on stackoverflow, and some users said me to use promises. But with the promises u can't get that result...
var promise2 = new Promise((resolve, reject) => { socket.on('get user inv', (steamID64) => { Trade.getInventory(steamID64, config.appID, config.contextID, (err, data) => { socket.emit('user inv', { error: err, items: data }) resolve(); }) }) })
promise1.then(() => {return promise2});