daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Jun 30th, 2018 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Steam = require('steam')
  2. var SteamUser = require('steam-user');
  3. var SteamTotp = require('steam-totp');
  4. var SteamCommunity = require('steamcommunity');
  5. var TradeOfferManager = require('steam-tradeoffer-manager');
  6. var client = new SteamUser();
  7. var friends = new Steam.SteamFriends(client.client);
  8. var community = new SteamCommunity();
  9. var manager = new TradeOfferManager({
  10.     steam: client,
  11.     community: community,
  12.     language: 'en'
  13. });
  14.  
  15. console.log('[TL7Bot] Estamos a loggar..')
  16. var logOnOptions = {
  17.     accountName: 'és bué gay', //nomedaconta
  18.     password: 'o reis é gay', //password
  19.     twoFactorCode: SteamTotp.generateAuthCode('') //vaiPediroSteamguard
  20. };
  21.  
  22. client.logOn(logOnOptions);
  23.  
  24. client.on('loggedOn', () => {
  25.     console.log('[TL7Bot] Estamos dentro!');
  26.  
  27.     client.setPersona(SteamUser.Steam.EPersonaState.Online, '');
  28.     client.gamesPlayed(["Visita ➜ ptskillss.com", ]);
  29.  
  30.  
  31.     console.log('[TL7Bot] Esta mensagem serve para informar que está tudo OK.');
  32.     console.log('sript realizado por TL7');
  33.  
  34.     client.on('webSession', (sessionid, cookies) => {
  35.     manager.setCookies(cookies);
  36.  
  37.     community.setCookies(cookies);
  38.     community.startConfirmationChecker(10000, ''); //steam identity secret
  39.  
  40.     client.on('friendRelationship', (steamid, relationship) => {
  41.         if (relationship === 2) {
  42.             client.addFriend(steamid);
  43.         client.chatMessage(steamid, '[Mensagem Automática] Obrigado por me adiconares. Antes de tudo utiliza !regras para saberes quais são as regras da minha steam caso não cumpras as regras irei bloquear-te. Podes-me fazer qualquer tipo de pergunta relativa à minha comunidade/canal. Caso querias comprar algum plano usa !cfg. Abraço.'); //1aMensagem
  44.         }
  45. });
  46.  
  47. //Misc
  48.  
  49.  
  50. //Trading stuff
  51.  
  52.     manager.on('newOffer', (offer) => {
  53.     if (offer.partner.getSteamID64() === '76561198315947758') {
  54.         offer.accept((err, status) => {
  55.             if (err) {
  56.                 console.log(err);
  57.             } else {
  58.                 console.log(`Accepted offer. Status: ${status}.`);
  59.             }
  60.         });
  61.     }
  62.  
  63. manager.on('newOffer', (offer) => {
  64.     if (offer.itemsToGive.length === 0) {
  65.         offer.accept((err, status) => {
  66.             if (err) {
  67.                 console.log(err);
  68.             } else {
  69.                 console.log(`Trade Offer. Status: ${status}.`);
  70.             }
  71.         });
  72.     } else {
  73.         offer.decline((err) => {
  74.             if (err) {
  75.                 console.log(err);
  76.             } else {
  77.                 console.log('Trade Offer | Declined (wanted our items).');
  78.             }
  79.         });
  80.     }
  81. });})})})
  82.  
  83. //chat stuff
  84.  
  85. //chat functions
  86. var messageresponse = [
  87.     [['!vip'], 'Toas as informações estão aqui: https://steamcommunity.com/groups/ptskillss/discussions/3/'],
  88.     [['!doador'], 'Toas as informações estão aqui: https://steamcommunity.com/groups/ptskillss/discussions/3/'],
  89.     [['!regras'], 'Vais ter de cumprir estas regras se não serás bloqueado. Podes ver as regras aqui: http://prntscr.com/jqt9nx'],
  90.     [['!bans'], 'https://ptskillss.com/bans/'],
  91.     [['!staff'], 'https://steamcommunity.com/groups/ptskillsstaff'],
  92.     [['!cfg'], 'https://steamcommunity.com/groups/ptskillsconfig'],
  93.     [['!spokis'], 'https://steamcommunity.com/id/spokis/'],
  94.     [['!ptskills'], 'https://steamcommunity.com/groups/ptskillss']
  95. ]
  96. //lower case only. function converts incoming messages to lower case
  97.  
  98.  
  99. function getreplymessage(usermessage) {
  100.     usermessage = usermessage.toLowerCase();
  101.     for (var i_a = 0; i_a < messageresponse.length; i_a++ ) {
  102.         for (var i_b = 0; i_b < messageresponse[i_a][0].length; i_b++ ) {
  103.             if (usermessage == messageresponse[i_a][0][i_b]) {
  104.                 return messageresponse[i_a][1];
  105.             }
  106.         }
  107.     }
  108.     return '';
  109. }
  110.  
  111. friends.on("friendMsg", function(user, msg, type){
  112.   if(type == Steam.EChatEntryType.ChatMsg){
  113.     var reply = getreplymessage(msg);
  114.     if (reply != ''){
  115.         friends.sendMessage(user, getreplymessage(msg));
  116.     }
  117.   }
  118. }
  119. ,);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top