-
Notifications
You must be signed in to change notification settings - Fork 0
/
account2.js
161 lines (138 loc) · 4.77 KB
/
account2.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');
const SteamCommunity = require('steamcommunity');
const TradeOfferManager = require('steam-tradeoffer-manager');
const chalk = require('chalk');
const chalkAnimation = require('chalk-animation');
const gradient = require('gradient-string');
const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager({
steam: client,
community: community,
language: 'en'
});
//SexyPrompt
console.log(gradient.pastel('Script Started'))
console.log('');
console.log(gradient.pastel('Made with ♥ by qpeckin'));
console.log(gradient.pastel('https://github.com/qpeckin/steam-trade-farm/'));
//SteamLogin
const logOnOptions = {
accountName: 'LOGIN',
password: 'PASSWORD',
twoFactorCode: SteamTotp.generateAuthCode('SHARED_SECRET_FROM_WINAUTH')
};
client.logOn(logOnOptions);
client.on('loggedOn', () => {
const rainbow = chalkAnimation.neon('Logged Into Steam'); // Animation starts
setTimeout(() => {
rainbow.stop(); // Animation stops
}, 1000);
setTimeout(() => {
rainbow.start(); // Animation resumes
}, 2000);
console.log('');
});
//TokenAutoAccept
client.on('webSession', (sessionid, cookies) => {
manager.setCookies(cookies);
community.setCookies(cookies);
//Identity Secret is being used to "sign" the trade confirmation requests.
//Used to approve trades, if you want to accept the trades on WinAuth add "//" in front of the line 52
community.startConfirmationChecker(10000, 'IDENTITYSECRET_FROM_WINAUTH');
setInterval(function() {
console.log('');
console.log(chalk.yellow('[-]Returning items...'));
sendRandomItem();
}, 150 * 1000); // 150 * 1000 ms = 2.5 min [reduce '150' by a lower number, really depend on how many items you're using]
});
manager.on('newOffer', (offer) => {
if (offer.partner.getSteamID64() === 'Account1_STEAMID64') { //ID64 Of Account1
offer.accept((err, status) => {
if (err) {
console.log(err);
process.exit();
} else {
console.log(chalk.green(`[+]Accepted trade from farm partner - Status: ${status}.`));
}
});
} /*else {
offer.decline((err) => {
if (err) {
console.log(err);
process.exit();
} else {
console.log('[*]Canceled offer from scammer.');
}
});
}*/
});
/*manager.on('newOffer', (offer) => {
if (offer.itemsToGive.length === 0) {
offer.accept((err, status) => {
if (err) {
console.log(err);
process.exit();
} else {
console.log(`Donation accepted - Status: ${status}.`);
}
});
} else {
offer.decline((err) => {
if (err) {
console.log(err);
} else {
console.log('Trade declined (wanted our items).');
}
});
}
});*/
//SendingTrades
function sendRandomItem() {
manager.loadInventory(753, 6, true, (err, inventory) => {
if (err) {
console.log(err);
process.exit();
} else {
const offer = manager.createOffer('https://steamcommunity.com/tradeoffer/new/?partner=XXXXXXXXX&token=XXXXXXXX'); //TradeLink Of Account1
//const item = inventory[Math.floor(Math.random() * inventory.length - 1)];
let accessAllowed;
//const quantity = [Math.floor(inventory.length)];
//console.log(iloscitemowweq);
/*if (quantity > 4) {
//const item1 = inventory[Math.floor(inventory.length - 1)];
//offer.addMyItem(item1);
offer.addMyItem({"appid": 753,"contextid": 6,"assetid": "6229351376","amount": "69"});
} else {*/
//PassivBot = Transfer whole inventory every x min back to Account1
inventory.forEach(function(element) {
offer.addMyItem(element);
//console.log(element);
//console.log("NEXT:");
});
/*
const item1 = inventory[Math.floor(Math.random() * inventory.length - 1)];
offer.addMyItem(item1);*/
//}
//console.log(item);
//const item2 = inventory[Math.floor(inventory.length - 2)];
//offer.addMyItem(item);
//offer.addMyItem(item2);
//offer.addMyItem({"appid": 753,"contextid": 6,"assetid": "6229351376","amount": "69"}); //Default Items: Steam
//offer.setMessage(`Wow! You get a ${item1.name}!`); //Donation Variant
offer.setMessage(`qpeckin's technologies`);
offer.send((err, status) => {
if (err) {
console.log(err);
process.exit();
} else {
console.log(chalk.yellow(`[-]Sent offer - Status: ${status}.`));
console.log(chalk.magentaBright('[!]Remember to leave a star in github'));
console.log('');
//console.log(item1);
}
});
}
});
}