Весенняя уборка Steam 2020

жаль что походу арчи плагин делать не будет :derpwhy: он типа игнарирует такие ивенты. В группе советуют заплатить чтобы сделали плаин под ивент. Ну шо будем ручками через скрипты :okay:
 
жаль что походу арчи плагин делать не будет :derpwhy: он типа игнарирует такие ивенты. В группе советуют заплатить чтобы сделали плаин под ивент. Ну шо будем ручками через скрипты :okay:
500+ руками
1.0
 
  • Like
Реакции: mwv
Кстати, а ивент на этих 500 опыта кончился или ещё что будет? (8 дней все же)
 
Кстати, а ивент на этих 500 опыта кончился или ещё что будет? (8 дней все же)
Они ж не думали о том, что ушлые ребята выполнят скриптами все задания за пять минут. Там было семь заданий, по одной игре в день, видимо рассчет был таков, когда ивент пилили.
 
На реддите уже запостили гайд для ботов:

1. Переходите по ссылке https://store.steampowered.com/springcleaning/
2. Нажимаете на кнопку https://imgur.com/a/D6BPfOH, страница перезагрузится
3. Открываете консоль браузера CTRL+Shift+I и вставляете код:
Код:
var gamelist=""; for (i=0;i<document.getElementsByClassName("task_app_completed").length;i++){gamelist=gamelist+document.getElementsByClassName("task_app_completed")[i].getAttribute("data-sg-appid")+",";} gamelist = gamelist.slice(0, -1);
4. Через ASF используете команду !play <botname> <ID list>
не работает для всех аккаунтов а только для одного на котором нажал кнопку.
 
  • Like
Реакции: creative36rus и 1134hell
Глючный плагин для ASF

Код:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Composition;
using System.Linq;
using System.Threading.Tasks;
using AngleSharp.Dom;
using ArchiSteamFarm;
using ArchiSteamFarm.Plugins;
using JetBrains.Annotations;
using Newtonsoft.Json.Linq;
using SteamKit2;

namespace m4d0ne.SpringClean2020
{
   class BotGuts : ClientMsgHandler {

     public Bot BotInstance;

     public SteamFriends BotFriends;
     public SteamUser BotUser;
     public SteamApps BotApps;

     public BotGuts(Bot bot)
     {
       BotInstance = bot;
     }

     public void Init()
     {
       BotFriends = Client.GetHandler<SteamFriends>();
       BotUser = Client.GetHandler<SteamUser>();
       BotApps = Client.GetHandler<SteamApps>();
     }

     public override void HandleMsg(IPacketMsg packetMsg)
     {
     }

     void HandleLogonResponse(IPacketMsg packetMsg)
     {
     }
   }

   [Export(typeof(IPlugin))]
  internal sealed class SpringClean : IASF, IBot, IBotCommand, IBotSteamClient
   {
     private ConcurrentDictionary<Bot, BotGuts> BotEx = new ConcurrentDictionary<Bot, BotGuts>();

  public string Name => nameof(SpringClean);

  public Version Version => typeof(SpringClean).Assembly.GetName().Version;

  public void OnASFInit(IReadOnlyDictionary<string, JToken> additionalConfigProperties = null)
  {
  }

  private async Task<bool> JoinEvent(Bot bot)
  {
  return await bot.ArchiWebHandler.UrlPostWithSession("https://store.steampowered.com", "/springcleaning/ajaxoptintoevent");
  }

  private async Task<List<uint>> GetGamesToPlay(Bot bot)
  {
  List<uint> tasks = new List<uint>();
  IDocument eventPage = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession("https://store.steampowered.com", "/springcleaning");
  if (eventPage != null)
  {
  var taskNodes = eventPage.GetElementsByClassName("task_app_completed");
  foreach(var node in taskNodes)
  {
  string appID = node.GetAttributeValue("data-sg-appid");
  if(!string.IsNullOrEmpty(appID))
  {
  tasks.Add(uint.Parse(appID));
  }
  }
  }

       List<uint> notOwned = new List<uint>();
       var ownedGames = await bot.ArchiWebHandler.GetMyOwnedGames();
       if (ownedGames != null)
       {
         notOwned = ownedGames.Where(x => !tasks.Contains(x.Key)).ToDictionary(x => x.Key).Keys.ToList();
       }
       else
       {
         notOwned = tasks;
       }

       if(notOwned.Count() > 0)
       {
         var reqResult = await BotEx[bot].BotApps.RequestFreeLicense(notOwned);
         if(reqResult.GrantedApps.Count > 0)
         {
           string reply = string.Format("Got free license for apps: {0}", string.Join(",", reqResult.GrantedApps));
           bot.ArchiLogger.LogGenericInfo(string.Format("Got free license for apps: {0}", string.Join(",", reqResult.GrantedApps)));
         }
       }

  return tasks;
  }

  private async Task<string> DoSpringClean(Bot bot)
  {
  bool joined = await JoinEvent(bot);
  if(joined)
  {
  List<uint> appsToPlay = await GetGamesToPlay(bot);
  if(appsToPlay.Count > 0)
  {
  await bot.Actions.Play(appsToPlay);
  return bot.BotName + ": Ok";
  }
  else
  {
  return bot.BotName + ": No games to play!";
  }
  }

  return bot.BotName + ": Could not join event!";
  }

  public async Task<string> OnBotCommand(Bot bot, ulong steamID, string message, string[] args)
  {
  switch(args[0].ToUpperInvariant())
  {
  case "SPRINGCLEAN" when bot.HasPermission(steamID, BotConfig.EPermission.Operator):
  if(args.Count() > 1)
  {
  List<Bot> activeBots = Bot.GetBots(args[1]).Where(x => x.IsConnectedAndLoggedOn).ToList();
  int delayCnt = activeBots.Count();
  IList<string> result = await Utilities.InParallel(activeBots.Select( async x => { await Task.Delay(TimeSpan.FromSeconds(delayCnt * 30)); --delayCnt; return await DoSpringClean(x); }));
  return result.Count() > 0 ? string.Join(Environment.NewLine, result) : null;
  }
  else
  {
  return await DoSpringClean(bot);
  }
  default:
  return null;
  }
  }

  public void OnLoaded()
  {
  ASF.ArchiLogger.LogGenericInfo("SpringCleanPlugin loaded. Expect weird behaviour and unexpected consequences.");
  }

     public void OnBotDestroy([NotNull] Bot bot) {
       //throw new NotImplementedException();
     }

     public void OnBotInit([NotNull] Bot bot) {
       //throw new NotImplementedException();
     }

     public void OnBotSteamCallbacksInit([NotNull] Bot bot, [NotNull] CallbackManager callbackManager) {
       BotEx[bot].Init();
     }

     public IReadOnlyCollection<ClientMsgHandler> OnBotSteamHandlersInit([NotNull] Bot bot) {
       BotGuts botEx = new BotGuts(bot);
       BotEx.TryAdd(bot, botEx);
       return new List<ClientMsgHandler>() { botEx };
     }
   }
}

Проект и собранный бинарник: https://mega.nz/file/eGBxQQJD#1O0OsjCHPCuzjl-YcdAq2IpiifSlRa37h4VFVPGQS3I

Прохождение эвента не автоматическое и запускается командой
Код:
springclean <bot>
 
Последнее редактирование:
Глючный плагин для ASF

Код:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Composition;
using System.Linq;
using System.Threading.Tasks;
using AngleSharp.Dom;
using ArchiSteamFarm;
using ArchiSteamFarm.Plugins;
using JetBrains.Annotations;
using Newtonsoft.Json.Linq;
using SteamKit2;

namespace m4d0ne.SpringClean2020
{
   class BotGuts : ClientMsgHandler {

     public Bot BotInstance;

     public SteamFriends BotFriends;
     public SteamUser BotUser;
     public SteamApps BotApps;

     public BotGuts(Bot bot)
     {
       BotInstance = bot;
     }

     public void Init()
     {
       BotFriends = Client.GetHandler<SteamFriends>();
       BotUser = Client.GetHandler<SteamUser>();
       BotApps = Client.GetHandler<SteamApps>();
     }

     public override void HandleMsg(IPacketMsg packetMsg)
     {
     }

     void HandleLogonResponse(IPacketMsg packetMsg)
     {
     }
   }

   [Export(typeof(IPlugin))]
  internal sealed class SpringClean : IASF, IBot, IBotCommand, IBotSteamClient
   {
     private ConcurrentDictionary<Bot, BotGuts> BotEx = new ConcurrentDictionary<Bot, BotGuts>();

  public string Name => nameof(SpringClean);

  public Version Version => typeof(SpringClean).Assembly.GetName().Version;

  public void OnASFInit(IReadOnlyDictionary<string, JToken> additionalConfigProperties = null)
  {
  }

  private async Task<bool> JoinEvent(Bot bot)
  {
  return await bot.ArchiWebHandler.UrlPostWithSession("https://store.steampowered.com", "/springcleaning/ajaxoptintoevent");
  }

  private async Task<List<uint>> GetGamesToPlay(Bot bot)
  {
  List<uint> tasks = new List<uint>();
  IDocument eventPage = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession("https://store.steampowered.com", "/springcleaning");
  if (eventPage != null)
  {
  var taskNodes = eventPage.GetElementsByClassName("task_app_completed");
  foreach(var node in taskNodes)
  {
  string appID = node.GetAttributeValue("data-sg-appid");
  if(!string.IsNullOrEmpty(appID))
  {
  tasks.Add(uint.Parse(appID));
  }
  }
  }

       List<uint> notOwned = new List<uint>();
       var ownedGames = await bot.ArchiWebHandler.GetMyOwnedGames();
       if (ownedGames != null)
       {
         notOwned = ownedGames.Where(x => !tasks.Contains(x.Key)).ToDictionary(x => x.Key).Keys.ToList();
       }
       else
       {
         notOwned = tasks;
       }

       if(notOwned.Count() > 0)
       {
         var reqResult = await BotEx[bot].BotApps.RequestFreeLicense(notOwned);
         if(reqResult.GrantedApps.Count > 0)
         {
           string reply = string.Format("Got free license for apps: {0}", string.Join(",", reqResult.GrantedApps));
           bot.ArchiLogger.LogGenericInfo(string.Format("Got free license for apps: {0}", string.Join(",", reqResult.GrantedApps)));
         }
       }

  return tasks;
  }

  private async Task<string> DoSpringClean(Bot bot)
  {
  bool joined = await JoinEvent(bot);
  if(joined)
  {
  List<uint> appsToPlay = await GetGamesToPlay(bot);
  if(appsToPlay.Count > 0)
  {
  await bot.Actions.Play(appsToPlay);
  return bot.BotName + ": Ok";
  }
  else
  {
  return bot.BotName + ": No games to play!";
  }
  }

  return bot.BotName + ": Could not join event!";
  }

  public async Task<string> OnBotCommand(Bot bot, ulong steamID, string message, string[] args)
  {
  switch(args[0].ToUpperInvariant())
  {
  case "SPRINGCLEAN" when bot.HasPermission(steamID, BotConfig.EPermission.Operator):
  if(args.Count() > 1)
  {
  List<Bot> activeBots = Bot.GetBots(args[1]).Where(x => x.IsConnectedAndLoggedOn).ToList();
  int delayCnt = activeBots.Count();
  IList<string> result = await Utilities.InParallel(activeBots.Select( async x => { await Task.Delay(TimeSpan.FromSeconds(delayCnt * 30)); --delayCnt; return await DoSpringClean(x); }));
  return result.Count() > 0 ? string.Join(Environment.NewLine, result) : null;
  }
  else
  {
  return await DoSpringClean(bot);
  }
  default:
  return null;
  }
  }

  public void OnLoaded()
  {
  ASF.ArchiLogger.LogGenericInfo("SpringCleanPlugin loaded. Expect weird behaviour and unexpected consequences.");
  }

     public void OnBotDestroy([NotNull] Bot bot) {
       //throw new NotImplementedException();
     }

     public void OnBotInit([NotNull] Bot bot) {
       //throw new NotImplementedException();
     }

     public void OnBotSteamCallbacksInit([NotNull] Bot bot, [NotNull] CallbackManager callbackManager) {
       BotEx[bot].Init();
     }

     public IReadOnlyCollection<ClientMsgHandler> OnBotSteamHandlersInit([NotNull] Bot bot) {
       BotGuts botEx = new BotGuts(bot);
       BotEx.TryAdd(bot, botEx);
       return new List<ClientMsgHandler>() { botEx };
     }
   }
}
плагин к ASF?
 
Глючный плагин для ASF

Код:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Composition;
using System.Linq;
using System.Threading.Tasks;
using AngleSharp.Dom;
using ArchiSteamFarm;
using ArchiSteamFarm.Plugins;
using JetBrains.Annotations;
using Newtonsoft.Json.Linq;
using SteamKit2;

namespace m4d0ne.SpringClean2020
{
   class BotGuts : ClientMsgHandler {

     public Bot BotInstance;

     public SteamFriends BotFriends;
     public SteamUser BotUser;
     public SteamApps BotApps;

     public BotGuts(Bot bot)
     {
       BotInstance = bot;
     }

     public void Init()
     {
       BotFriends = Client.GetHandler<SteamFriends>();
       BotUser = Client.GetHandler<SteamUser>();
       BotApps = Client.GetHandler<SteamApps>();
     }

     public override void HandleMsg(IPacketMsg packetMsg)
     {
     }

     void HandleLogonResponse(IPacketMsg packetMsg)
     {
     }
   }

   [Export(typeof(IPlugin))]
  internal sealed class SpringClean : IASF, IBot, IBotCommand, IBotSteamClient
   {
     private ConcurrentDictionary<Bot, BotGuts> BotEx = new ConcurrentDictionary<Bot, BotGuts>();

  public string Name => nameof(SpringClean);

  public Version Version => typeof(SpringClean).Assembly.GetName().Version;

  public void OnASFInit(IReadOnlyDictionary<string, JToken> additionalConfigProperties = null)
  {
  }

  private async Task<bool> JoinEvent(Bot bot)
  {
  return await bot.ArchiWebHandler.UrlPostWithSession("https://store.steampowered.com", "/springcleaning/ajaxoptintoevent");
  }

  private async Task<List<uint>> GetGamesToPlay(Bot bot)
  {
  List<uint> tasks = new List<uint>();
  IDocument eventPage = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession("https://store.steampowered.com", "/springcleaning");
  if (eventPage != null)
  {
  var taskNodes = eventPage.GetElementsByClassName("task_app_completed");
  foreach(var node in taskNodes)
  {
  string appID = node.GetAttributeValue("data-sg-appid");
  if(!string.IsNullOrEmpty(appID))
  {
  tasks.Add(uint.Parse(appID));
  }
  }
  }

       List<uint> notOwned = new List<uint>();
       var ownedGames = await bot.ArchiWebHandler.GetMyOwnedGames();
       if (ownedGames != null)
       {
         notOwned = ownedGames.Where(x => !tasks.Contains(x.Key)).ToDictionary(x => x.Key).Keys.ToList();
       }
       else
       {
         notOwned = tasks;
       }

       if(notOwned.Count() > 0)
       {
         var reqResult = await BotEx[bot].BotApps.RequestFreeLicense(notOwned);
         if(reqResult.GrantedApps.Count > 0)
         {
           string reply = string.Format("Got free license for apps: {0}", string.Join(",", reqResult.GrantedApps));
           bot.ArchiLogger.LogGenericInfo(string.Format("Got free license for apps: {0}", string.Join(",", reqResult.GrantedApps)));
         }
       }

  return tasks;
  }

  private async Task<string> DoSpringClean(Bot bot)
  {
  bool joined = await JoinEvent(bot);
  if(joined)
  {
  List<uint> appsToPlay = await GetGamesToPlay(bot);
  if(appsToPlay.Count > 0)
  {
  await bot.Actions.Play(appsToPlay);
  return bot.BotName + ": Ok";
  }
  else
  {
  return bot.BotName + ": No games to play!";
  }
  }

  return bot.BotName + ": Could not join event!";
  }

  public async Task<string> OnBotCommand(Bot bot, ulong steamID, string message, string[] args)
  {
  switch(args[0].ToUpperInvariant())
  {
  case "SPRINGCLEAN" when bot.HasPermission(steamID, BotConfig.EPermission.Operator):
  if(args.Count() > 1)
  {
  List<Bot> activeBots = Bot.GetBots(args[1]).Where(x => x.IsConnectedAndLoggedOn).ToList();
  int delayCnt = activeBots.Count();
  IList<string> result = await Utilities.InParallel(activeBots.Select( async x => { await Task.Delay(TimeSpan.FromSeconds(delayCnt * 30)); --delayCnt; return await DoSpringClean(x); }));
  return result.Count() > 0 ? string.Join(Environment.NewLine, result) : null;
  }
  else
  {
  return await DoSpringClean(bot);
  }
  default:
  return null;
  }
  }

  public void OnLoaded()
  {
  ASF.ArchiLogger.LogGenericInfo("SpringCleanPlugin loaded. Expect weird behaviour and unexpected consequences.");
  }

     public void OnBotDestroy([NotNull] Bot bot) {
       //throw new NotImplementedException();
     }

     public void OnBotInit([NotNull] Bot bot) {
       //throw new NotImplementedException();
     }

     public void OnBotSteamCallbacksInit([NotNull] Bot bot, [NotNull] CallbackManager callbackManager) {
       BotEx[bot].Init();
     }

     public IReadOnlyCollection<ClientMsgHandler> OnBotSteamHandlersInit([NotNull] Bot bot) {
       BotGuts botEx = new BotGuts(bot);
       BotEx.TryAdd(bot, botEx);
       return new List<ClientMsgHandler>() { botEx };
     }
   }
}

Проект и собранный бинарник: https://mega.nz/file/eGBxQQJD#1O0OsjCHPCuzjl-YcdAq2IpiifSlRa37h4VFVPGQS3I
пробовал кто то?
 
Глючный плагин для ASF

Код:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Composition;
using System.Linq;
using System.Threading.Tasks;
using AngleSharp.Dom;
using ArchiSteamFarm;
using ArchiSteamFarm.Plugins;
using JetBrains.Annotations;
using Newtonsoft.Json.Linq;
using SteamKit2;

namespace m4d0ne.SpringClean2020
{
   class BotGuts : ClientMsgHandler {

     public Bot BotInstance;

     public SteamFriends BotFriends;
     public SteamUser BotUser;
     public SteamApps BotApps;

     public BotGuts(Bot bot)
     {
       BotInstance = bot;
     }

     public void Init()
     {
       BotFriends = Client.GetHandler<SteamFriends>();
       BotUser = Client.GetHandler<SteamUser>();
       BotApps = Client.GetHandler<SteamApps>();
     }

     public override void HandleMsg(IPacketMsg packetMsg)
     {
     }

     void HandleLogonResponse(IPacketMsg packetMsg)
     {
     }
   }

   [Export(typeof(IPlugin))]
  internal sealed class SpringClean : IASF, IBot, IBotCommand, IBotSteamClient
   {
     private ConcurrentDictionary<Bot, BotGuts> BotEx = new ConcurrentDictionary<Bot, BotGuts>();

  public string Name => nameof(SpringClean);

  public Version Version => typeof(SpringClean).Assembly.GetName().Version;

  public void OnASFInit(IReadOnlyDictionary<string, JToken> additionalConfigProperties = null)
  {
  }

  private async Task<bool> JoinEvent(Bot bot)
  {
  return await bot.ArchiWebHandler.UrlPostWithSession("https://store.steampowered.com", "/springcleaning/ajaxoptintoevent");
  }

  private async Task<List<uint>> GetGamesToPlay(Bot bot)
  {
  List<uint> tasks = new List<uint>();
  IDocument eventPage = await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession("https://store.steampowered.com", "/springcleaning");
  if (eventPage != null)
  {
  var taskNodes = eventPage.GetElementsByClassName("task_app_completed");
  foreach(var node in taskNodes)
  {
  string appID = node.GetAttributeValue("data-sg-appid");
  if(!string.IsNullOrEmpty(appID))
  {
  tasks.Add(uint.Parse(appID));
  }
  }
  }

       List<uint> notOwned = new List<uint>();
       var ownedGames = await bot.ArchiWebHandler.GetMyOwnedGames();
       if (ownedGames != null)
       {
         notOwned = ownedGames.Where(x => !tasks.Contains(x.Key)).ToDictionary(x => x.Key).Keys.ToList();
       }
       else
       {
         notOwned = tasks;
       }

       if(notOwned.Count() > 0)
       {
         var reqResult = await BotEx[bot].BotApps.RequestFreeLicense(notOwned);
         if(reqResult.GrantedApps.Count > 0)
         {
           string reply = string.Format("Got free license for apps: {0}", string.Join(",", reqResult.GrantedApps));
           bot.ArchiLogger.LogGenericInfo(string.Format("Got free license for apps: {0}", string.Join(",", reqResult.GrantedApps)));
         }
       }

  return tasks;
  }

  private async Task<string> DoSpringClean(Bot bot)
  {
  bool joined = await JoinEvent(bot);
  if(joined)
  {
  List<uint> appsToPlay = await GetGamesToPlay(bot);
  if(appsToPlay.Count > 0)
  {
  await bot.Actions.Play(appsToPlay);
  return bot.BotName + ": Ok";
  }
  else
  {
  return bot.BotName + ": No games to play!";
  }
  }

  return bot.BotName + ": Could not join event!";
  }

  public async Task<string> OnBotCommand(Bot bot, ulong steamID, string message, string[] args)
  {
  switch(args[0].ToUpperInvariant())
  {
  case "SPRINGCLEAN" when bot.HasPermission(steamID, BotConfig.EPermission.Operator):
  if(args.Count() > 1)
  {
  List<Bot> activeBots = Bot.GetBots(args[1]).Where(x => x.IsConnectedAndLoggedOn).ToList();
  int delayCnt = activeBots.Count();
  IList<string> result = await Utilities.InParallel(activeBots.Select( async x => { await Task.Delay(TimeSpan.FromSeconds(delayCnt * 30)); --delayCnt; return await DoSpringClean(x); }));
  return result.Count() > 0 ? string.Join(Environment.NewLine, result) : null;
  }
  else
  {
  return await DoSpringClean(bot);
  }
  default:
  return null;
  }
  }

  public void OnLoaded()
  {
  ASF.ArchiLogger.LogGenericInfo("SpringCleanPlugin loaded. Expect weird behaviour and unexpected consequences.");
  }

     public void OnBotDestroy([NotNull] Bot bot) {
       //throw new NotImplementedException();
     }

     public void OnBotInit([NotNull] Bot bot) {
       //throw new NotImplementedException();
     }

     public void OnBotSteamCallbacksInit([NotNull] Bot bot, [NotNull] CallbackManager callbackManager) {
       BotEx[bot].Init();
     }

     public IReadOnlyCollection<ClientMsgHandler> OnBotSteamHandlersInit([NotNull] Bot bot) {
       BotGuts botEx = new BotGuts(bot);
       BotEx.TryAdd(bot, botEx);
       return new List<ClientMsgHandler>() { botEx };
     }
   }
}

Проект и собранный бинарник: https://mega.nz/file/eGBxQQJD#1O0OsjCHPCuzjl-YcdAq2IpiifSlRa37h4VFVPGQS3I
Он должен сыпать ошибки?
1.0
 
Последнее редактирование:
  • Like
Реакции: Tysha
Нужен фреймворк 4.8 или неткор 3.1. Собирал с последней версией арчи.
 
  • Like
Реакции: Tysha