Advertisement
Guest User

Steam Swapper

a guest
Oct 6th, 2018
2,547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. var SteamCommunity = require('steamcommunity');
  2. var ReadLine = require('readline');
  3. var fs = require('fs');
  4.  
  5.  
  6.  
  7.  
  8. var community = new SteamCommunity();
  9. var community2 = new SteamCommunity();
  10.  
  11. var targetUser = ""; // account's username you want the id on
  12. var targetPass = ""; // account's password you want the id on
  13.  
  14. var currentUser = ""; // username of account holding the id
  15. var currentPass = ""; // password of account currently holding id
  16.  
  17. var customURLToSwap = ""; // id you are currently swapping
  18.  
  19. var rl = ReadLine.createInterface({
  20. "input": process.stdin,
  21. "output": process.stdout
  22. });
  23.  
  24. doLogin2(targetUser, targetPass);
  25.  
  26. function doLogin2(accountName, password, authCode, twoFactorCode, captcha) {
  27. community2.login({
  28. "accountName": accountName,
  29. "password": password,
  30. "authCode": authCode,
  31. "twoFactorCode": twoFactorCode,
  32. "captcha": captcha
  33. }, function(err, sessionID, cookies, steamguard) {
  34. if(err) {
  35. if(err.message == 'SteamGuard') {
  36. console.log("An email has been sent to target email adress " + err.emaildomain);
  37. rl.question("Steam Guard Code: ", function(code) {
  38. doLogin2(accountName, password, code);
  39. });
  40.  
  41. return;
  42. }
  43. if(err.message == 'SteamGuardMobile') {
  44.  
  45. rl.question("Steam Guard Code Target: ", function(code) {
  46. doLogin2(accountName, password, null, code);
  47. });
  48.  
  49. return;
  50. }
  51. if(err.message == 'CAPTCHA') {
  52. console.log(err.captchaurl);
  53. rl.question("CAPTCHA: ", function(captchaInput) {
  54. doLogin2(accountName, password, null, captchaInput);
  55. });
  56.  
  57. return;
  58. }
  59.  
  60. console.log(err);
  61. process.exit();
  62. return;
  63. }
  64.  
  65. console.log("Logged into target account");
  66. doLogin1(currentUser, currentPass);
  67. });
  68.  
  69. }
  70. function doLogin1(accountName, password, authCode, twoFactorCode, captcha) {
  71. community.login({
  72. "accountName": accountName,
  73. "password": password,
  74. "authCode": authCode,
  75. "twoFactorCode": twoFactorCode,
  76. "captcha": captcha
  77. }, function(err, sessionID, cookies, steamguard) {
  78. if(err) {
  79. if(err.message == 'SteamGuard') {
  80. console.log("An email has been sent to current email adress " + err.emaildomain);
  81. rl.question("Steam Guard Code: ", function(code) {
  82. doLogin1(accountName, password, code);
  83. });
  84.  
  85. return;
  86. }
  87. if(err.message == 'SteamGuardMobile') {
  88.  
  89. rl.question("Steam Guard Code: ", function(code) {
  90. doLogin1(accountName, password, null, code);
  91. });
  92.  
  93. return;
  94. }
  95. if(err.message == 'CAPTCHA') {
  96. console.log(err.captchaurl);
  97. rl.question("CAPTCHA: ", function(captchaInput) {
  98. doLogin1(accountName, password, null, captchaInput);
  99. });
  100.  
  101. return;
  102. }
  103.  
  104. console.log(err);
  105. process.exit();
  106. return;
  107. }
  108.  
  109. console.log("Moving " + customURLToSwap + " onto " + targetUser);
  110. swapURL();
  111. });
  112.  
  113. }
  114.  
  115. function swapURL() {
  116. community.editProfile({
  117. "customURL": "",
  118. }, function(err){
  119. if (err) {
  120. community2.editProfile({
  121. "customURL": customURLToSwap,
  122. }, function(err){
  123. if (err) {
  124. console.log("Transfer Complete");
  125.  
  126. }
  127. else {
  128. console.log("Transfer Complete");
  129. }
  130. });
  131. }
  132. else {
  133.  
  134. }
  135. });
  136.  
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement