DGVaniX
-
Posts
6 -
Joined
-
Last visited
Posts posted by DGVaniX
-
-
Hi, so I'm making a bot that send the user a trade offer with 350 gems, but the problem is that it's my first time using JS, so I find it kinda difficult to do it...
I found this online but I don't understand it at all....:
manager.getUserInventoryContents(steamID, 753, 6, true, (err, inv) => { if (err) { throw err; } let gems = inv.filter(item => item.market_hash_name == "Gems"); let item = gems[0]; item.amount = 350; offer.addMyItem(item); offer.send(function(err, status) { if (err) { console.log(err); return; } //Some code }); });
But the problem is that I need:
1. Check if the user has at least 350 Gems or more in their inventory
2. Send the trade offer with the 350 gems
So I basically have no idea how to do it...
Anyone can help me out?
Thanks.
-
Hi, so I am making a bot and the user has a "!buy" command that also has a parameter. How do I find out what number the user enters after the command when the user enters it like this "!buy 3"?
if (msg.toUpperCase() == '!BUY' && '!BUY' == msg.toUpperCase().substring(0,4)){ if(!isNaN(msg.charAt(5)) && parseInt(msg.charAt(5)) > 0){ var string_start=msg.indexOf("UY"); var nrOfSets= ""; string_start+=3; for (var i = string_start; i < msg.length; i++) { nrOfSets+= msg.charAt(i); } var sets = parseInt(nrOfSets);
I tried that but it doesn't work, it just skips to the last "else" which tells the user that the command is not recognized...
Thanks.
---- EDIT
FIXED!
-
Hi, so I need a bit of help on making a bot using node-steam, and I've noticed that there's only node-steam-user on this forum which might not be the same as node-steam so I thought I might as well post in general.
I'm making this bot and I want it to automatically message people who message the bot with a predefined message:
var Steam = require('steam'); var fs = require('fs'); var bot = new Steam.SteamClient(); if (fs.existsSync('sentryfile_' + process.argv[2])){ var sentry = fs.readFileSync('sentryfile_' + process.argv[2]); console.log('[BOT] logging in with sentry '); bot.logOn({ accountName: process.argv[2], password: process.argv[3], authCode: process.argv[5], shaSentryfile: sentry }); }else{ console.log('[BOT] logging in without sentry'); bot.logOn({ accountName: process.argv[2], password: process.argv[3], authCode: process.argv[5] }); }
This is my first bot in js and I can't see the predefined functions of node-steam anywhere...
Thanks.
Sending trade offer with gems
in node-steam-tradeoffer-manager
Posted · Edited by DGVaniX
Thanks for the reply.
I don't really understand what you said there... I'm not really a programmer so I don't really know the terminology. How do I 'iterate' the array? And how do I add gems from each stack?
Thanks.
--- EDIT
So I've googled this a bit and found some codes and I tried to use those examples but its TOO CONFUSING, I don't understand how to do it...