So, for the past 8 months I have been trying to bulk request floats of like 1000 inspect links every second. While doing one inspect 1000 times is fine. Whenever I bulk request with 1000 different ones, things tend to go mayhem. I get max 4-5 floats depending on how I choose which floats are first. As example:
M7800872405789066379A37059871447D11863687337479355678
M7903329297310948975A37061864046D11863687337479355678
M7284084347070041204A37057504987D11863687337479355678
M7384289439309646801A37065312421D11863687337479355678
M4863399372752009970A37055616057D11863687337479355678
M7384289439309646711A37065089523D11863687337479355678
M7800872405789081739A37059417732D11863687337479355678
M7903329297310948855A37065289802D11863687337479355678
M7800872405789080869A37059428152D11863687337479355678
returns:
Float value (1): 0.13861724734306335
Float value (4): 0.12481389194726944
Float value (7): 0.1271217167377472
Float value (2): 0.11473843455314636
but, by changing a few links around it sometimes is able to get more. I find this very interesting and get no further error. The only error I have gotten somehow after leaving it running for hours is: Steam error: Error: getaddrinfo ENOTFOUND api.steampowered.com at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'api.steampowered.com' }. Which can be due to me running it on school Wi-fi. I haven't been able to found a fix to bulk request floats but I hope someone here can help me.
csgo.on('connectedToGC', () => {
console.log('Connected to CS:GO Game Coordinator');
fs.readFile('inspect_links.txt', 'utf8', (err, data) => {
console.log("Reading File")
if (err) {
console.error('Error reading inspect_links.txt:', err);
return;
}
const inspectLinks = data.split('\n').map(link => link.trim()).filter(link => link); // Split by newline, trim whitespace, and filter out empty lines
console.log(inspectLinks)
const startTime = process.hrtime();
try {
inspectLinks.forEach((inspectLink, i) => {
console.log("Item")
csgo.inspectItem(inspectLink, (item) => {
console.log("item2")
if (item) {
const float = item.paintwear;
console.log(`Float value (${i + 1}):`, float);
if (i === numRequests - 1) {
// Measure end time when all requests are completed
const endTime = process.hrtime(startTime);
console.log(`Total time taken: ${endTime[0]} seconds ${endTime[1] / 1000000} milliseconds`);
}
} else {
console.error(`Failed to inspect item (${i + 1})`);
}
});
});
} catch (err) {
console.log(err);
};
});
});
Where InspectLinks is just a TXT with 100 different inspect links looking like this:
M7903329297310948855A37065289802D11863687337479355678
M4863399372752009970A37055616057D11863687337479355678
M7800872405789066379A37059871447D11863687337479355678
+97 more lines.