andrewda / node-steam-guide Goto Github PK
View Code? Open in Web Editor NEWA guide to creating Steam bots and websites using Node.js
License: Creative Commons Attribution 4.0 International
A guide to creating Steam bots and websites using Node.js
License: Creative Commons Attribution 4.0 International
I followed your guide (thank you a lot btw) and everything went smooth so far, now I'm stuck though as the bot won't react to sent tradeoffers. From what I understand the even newOffer is never registered (I could be wrong I'm pretty new to coding). The bot definitely does get the offers, I can even log into the account and accept them manually. I downloaded your code and tried with that still no luck. Any help would be appreciated!
hey, i just started learning, it's cool!
but I ran into the issue, I read that the steam guard app code thing would be automated but I gotta enter it myself, I used my own code then I tried the example one, still, doesnt work and I took the correct stuff
im sure that i used the correct values, cause i took them from steam desktop authenticator
anyone else ran into this issue and fixed it?
Both handling and sending
Error: InvalidPassword
at SteamUser._handlers.(anonymous function) (/Users/wolfy/Desktop/Steambot/node_modules/steam-user/components/logon.js:363:16)
at SteamUser._handleMessage (/Users/wolfy/Desktop/Steambot/node_modules/steam-user/components/messages.js:216:29)
at emitThree (events.js:116:13)
at CMClient.emit (events.js:194:7)
at CMClient._netMsgReceived (/Users/wolfy/Desktop/Steambot/node_modules/steam-client/lib/cm_client.js:323:8)
at CMClient.handlers.(anonymous function) (/Users/wolfy/Desktop/Steambot/node_modules/steam-client/lib/cm_client.js:603:8)
at CMClient._netMsgReceived (/Users/wolfy/Desktop/Steambot/node_modules/steam-client/lib/cm_client.js:305:24)
at emitOne (events.js:96:13)
at TCPConnection.emit (events.js:188:7)
at TCPConnection._readPacket (/Users/wolfy/Desktop/Steambot/node_modules/steam-client/lib/tcp_connection.js:179:7)
Its keeps saying when I code on chapter 1.4 and above. If its a bug please fix. If not, please help me whats going on thanks.
It would be very helpful if you show how to do price checking from database!
Thanks,
Leaving aside how much more complicated it would be to do this through a web hosting service. Mainly because this tutorial (which looks like a great tutorial) won't help me with that. My question is simply: Is there a way to make automatic trading using PHP instead of node.js? And also, using a web hosting service vs using my own home server, do I even have enough access to even be able to do the things needed for sending automatic trade requests.
Alternatively, it it possible to handle the automatic bot trading using node.js on my home machine and having it communicate with my website (PHP) hosted by a web hosting service.
Thank you.
Good Day,
I have been following your work (I love it) but I have run into a few issues with the latest code. (Chapter 6.1 - Getting Started)
Here is the steps I followed:
Technical Details about my environment:
irmandos@alfred-container:~/trade-bot$ node app.js
module.js:442
throw err;
^Error: Cannot find module 'passport.socketio'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/irmandos/trade-bot/app.js:5:24)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
When I remove the const passportSocket = require('passport.socketio');
section in app.js it continues to the 2nd error
irmandos@alfred-container:~/trade-bot$ node app.js
module.js:442
throw err;
^Error: Cannot find module 'connect-mongo'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/irmandos/trade-bot/app.js:13:20)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (node.js:348:7)
at startup (node.js:140:9)
at node.js:463:3
When I remove the const MongoStore = require('connect-mongo')(session);
section in app.js it continues to the 3rd error.
irmandos@alfred-container:~/trade-bot$ node app.js
/home/irmandos/trade-bot/app.js:28
const sessionStore = new MongoStore({ mongooseConnection: mongoose.connection });
^ReferenceError: MongoStore is not defined
at Object. (/home/irmandos/trade-bot/app.js:28:26)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (node.js:348:7)
at startup (node.js:140:9)
at node.js:463:3
Hello.
I tried running project 6 and it seems to be working fine , exept one thing : It doesn't save any information to the database. I checked using mongo and it had database "guide" that had 3 collections: "prices" , "sessions" and "users" , none of them had any info. It also desn't show anything in the withdraw page on the app.
How do i get them to run properly ?
How would I go about uploading the finished product to github, seeing as it used an external server hosts functions.
Title says it all, unsure if it was just forgotten about but it was never brought up in the documentation, had to take it from the pre-made.
I believe I saw a markdown prettier linter a while ago. Would be good to incorporate that and a pre-commit hook.
Hello guys, can you try to add some features, like:
Hello. I used your code as a base to try and make some project of mine and now i want to add credits on each user. Should i add it in the database collection User or should i create a separate Credits collection. If I want to implement credits on the User model how should i go on about updating the info when i serialize the user ? I want to use the credits property as "req.user.credits". How do i do that ?
the bot isnt accepting it? is it because it is a limited account
When i try to start the bot with node project1.js nothing happens
DeprecationWarning:
open()
is deprecated in mongoose >= 4.11.0, useopenUri()
instead, or set theuseMongoClient
option if usingconnect()
orcreateConnection()
. See http://mongoosejs.com/docs/connections.html#use-mongo-client
Hi, i just started yesterday trying to do my own project Play4Skins, that isnt for cs go btw. I created sourcemod plugin etc, but im very confused with site. Im trying to do SOMETHING with site "just a few hours"... Can you help me with site? Or someone who can? Nah, that isnt the problem... The problem is:
When i click on deposit items or on withdraw items theres nothing doing. No alerts, no sockets.
Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
Is what I'm getting on the 4.4 after trying to launch project6.js
could you explain how to set up the database as well? as on the tutorial it says nothing about how to create or view it in the first place.
Thanks
Just to let you know. The link to the repository (Android guide) is down (404).
Here's the code;
`const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const SteamCommunity = require('steamcommunity');
const TradeOfferManager = require('steam-tradeoffer-manager');
const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager({
steam: client,
community: community,
language: 'en'
});
const logOnOptions = {
accountName: 'MY_LOGIN_HERE',
password: 'MY_PASSWORD_HERE',
twoFactorCode: SteamTotp.generateAuthCode('MY_AUTHCODE_HERE')
};
client.logOn(logOnOptions);
client.on('loggedOn', () => {
console.log('Logged into Steam');
client.setPersona(SteamUser.Steam.EPersonaState.Online);
client.gamesPlayed("Steam Bot");
});
client.on('webSession', (sessionid, cookies) => {
manager.setCookies(cookies);
community.setCookies(cookies);
community.startConfirmationChecker(10000, 'Lu++M3MNzsf3l0FsE/jKN4X6ZkE=');
});
manager.on('newOffer', (offer) => {
if (offer.partner.getSteamID64() === '76561198360548976') {
offer.accept((err, status) => {
if (err) {
console.log(err);
} else {
console.log(Accepted offer. Status: ${status}.
);
}
});
}
});`
It loggs in successfully and status is going ONLINE and everything is fine excepting the bot ignores offers and nothing is written in console. Help please.
I put in my shared secrets but when I ran it with node this error occurred help, please?
I start the bot normally, And when I am giving it a trade nothing happens
Hello thanks to your tutorial first.
And i found in Chapter 1.4-Section How to find your secrets
"...while if you are using an Android you can try
this
tutorial..."
the link of this
_https://github.com/SMVampire/SteamBotDev/wiki/Getting-Shared-Secret-from-Android-(Windows)
in detail_
is an 404 page.
๐ hope you can correct it
BTW i am translating you work in order to improve my English level and the skill of node.js
hope you can give a permission of this.
Thank you!
Title says it all
Can i do the bot without the website ? And how where do i set the price of an item ? I dont think ill need a website for my bot for now.
I'd love to keep working......
I'm not trying to be pushy, sorry if it sounds like I am.
I've been getting a lot of emails wondering how to install dependencies. I'd like to point them to a package.json
for easy installation.
Need help
Title says all :^)
I've followed the tutorial up through Chapter 2, but although I've been able to bring my bot account online and change its status, the trade requests don't trigger the event listener.
Hi,
I am using my shared key which I got by https://github.com/Jessecar96/SteamDesktopAuthenticator. For authorization which uses "steam-totp" all codes generated correct and working fine:
const logOnOptions = {
accountName: config.steam.login,
password: config.steam.password,
twoFactorCode: SteamTotp.generateAuthCode(config.steam.sharedSecret)
};
but when I try to use checkConfirmation with autostart it generates error.
community.startConfirmationChecker(10000, config.steam.sharedSecret);
error is below:
It looks like your Steam Guard Mobile Authenticator is providing incorrect Steam Guard codes. This could be caused by an inaccurate clock or bad timezone settings on your device. If your time settings are correct, it could be that a different device has been set up to provide the Steam Guard codes for your account, which means the authenticator on this device is no longer valid.
Maybe I did mistake here? Thanks for any support :)
Hi i can see any items in the withdraw page i tried to do all the tutorials by myself and i tried with your files but same result maybye an error from mongod ? Best regards
So for some reason, every time I re-run app.js, the list just duplicates its self and adds more to the document as shown here:
I am unsure if this is how it was intended, however clearly duplicates are not something we want around.
My code so far:
const express = require('express');
const handlebars = require('express-handlebars');
const path = require('path');
const mongoose = require('mongoose');
const Item = require('./models/item');
const app = express();
const hbs = handlebars.create();
mongoose.connect('mongodb://127.0.0.1:27017/guide', {useMongoClient: true});
mongoose.Promise = global.Promise;
app.engine('hbs', hbs.engine);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'hbs');
// Item Table?
const awpAsiimov = new Item({
name: 'AWP | Asiimov (Field-Tested)',
price: 27.75
});
const akRedline = new Item({
name: 'AK-47 | Redline (Field-Tested)',
price: 5.52
});
awpAsiimov.save((err, item) => {
if (err) {
console.log(err);
} else {
console.log(item);
}
});
akRedline.save((err, item) => {
if (err) {
console.log(err);
} else {
console.log(item);
}
});
app.get('/', (req, res) => {
Item.find({}, (err, items) => {
if (err) {
console.log(err);
}
res.render('main', { items });
});
});
app.listen(3037);
ignore the useMongClient and mongoose.promise, those were for getting rid of the errors.
It would be very helpful if you add more details to "Chapter 4.4 - Databases" & go over basic usage.
Some things to cover:
mongod
command;mongod
service.How can I confirm the phone number on my account? What method?
To use the enableTwoFactor method in steam-user package.
I tried project 10 on vps server and the page did not load in time. I checked the console and it said that the app was listening (i made the connection on port 5000 instead of 3037) , the bot was working , i had all the modules necessary. I cant see why the page is timing out. Do i need to write the domain name instead of localhost:5000 or am i missing something?
Edit: I checked and saw that it was the socket taking too long to connect with the user. Its probably because im using NGINX to reverse proxy requests (to setup https sertificate). Any suggestions how to fix it ?
I can't see to figure out how to link the CSS file to the HBS file, even though I use the same linking method as I would in any ordinary HTML file.
I tried sending it a tf2 item and it didnt accept it...
When I add twoFactorCode: SteamTotp.generateAuthCode('my shared secret key') he was crashing the console ! He was working when i add this steam-totp :(
Andrewda please help
i installed the thing four times and it keeps saying the same thing
module.js:338
throw err;
^
Error: Cannot find module 'C:\Users\NAME\Documents\node-steam-guide-master\project1.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
/home/bot/node_modules/steam-totp/index.js:28
let code = exports.generateAuthCode(secret, offset);
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/bot/bot.js:5:17)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
root@csgowoob:/home/bot# /home/bot/node_modules/steam-totp/index.js:28
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/bot/bot.js:5:17)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
It's been a long time...
Why is my newOffer not firing?
manager.on('newOffer', (offer) => {
if (offer.partner.getSteamID64() === '76561198368818576') {
offer.accept((err, status) => {
if (err) {
console.log(err);
} else {
console.log(`Accepted offer. Status: ${status}.`);
}
});
} else {
offer.decline((err) => {
if (err) {
console.log(err);
} else {
console.log('Canceled offer from scammer.');
}
});
}
});
!test hello
if argument is hello send message. How can do it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.