mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-20 16:28:38 +00:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44b3a518bd | ||
|
|
1fe60e7037 | ||
|
|
27ad98492f | ||
|
|
e3386c5b29 | ||
|
|
021ac470d3 | ||
|
|
b4fb0bf9a6 | ||
|
|
b63dd1035c | ||
|
|
f577e1a6cb | ||
|
|
34ffb975b6 | ||
|
|
5a3b132d5e | ||
|
|
ef29b6f33d | ||
|
|
e8335ac183 | ||
|
|
90339fb276 | ||
|
|
88759303dd | ||
|
|
befe01ca59 | ||
|
|
c9cc728da3 | ||
|
|
a81a59396d | ||
|
|
df3fcfb1df | ||
|
|
e097b33d89 | ||
|
|
db6e775b10 | ||
|
|
b53c41a0f9 | ||
|
|
fec4873843 | ||
|
|
1e2efe38f1 | ||
|
|
3e0dfac091 | ||
|
|
36d745aece | ||
|
|
7896e7924e | ||
|
|
5b3c730d51 | ||
|
|
f3aee0c34f | ||
|
|
47389f67b8 | ||
|
|
19e72c93c1 | ||
|
|
164240641b | ||
|
|
337c397505 |
@@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
using SteamKit2;
|
using SteamKit2;
|
||||||
using SteamKit2.Internal;
|
using SteamKit2.Internal;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal sealed class ArchiHandler : ClientMsgHandler {
|
internal sealed class ArchiHandler : ClientMsgHandler {
|
||||||
@@ -33,6 +35,7 @@ namespace ArchiSteamFarm {
|
|||||||
Unknown = -1,
|
Unknown = -1,
|
||||||
OK = 0,
|
OK = 0,
|
||||||
AlreadyOwned = 9,
|
AlreadyOwned = 9,
|
||||||
|
RegionLockedKey = 13,
|
||||||
InvalidKey = 14,
|
InvalidKey = 14,
|
||||||
DuplicatedKey = 15,
|
DuplicatedKey = 15,
|
||||||
BaseGameRequired = 24,
|
BaseGameRequired = 24,
|
||||||
@@ -41,14 +44,20 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
internal EResult Result { get; private set; }
|
internal EResult Result { get; private set; }
|
||||||
internal EPurchaseResult PurchaseResult { get; private set; }
|
internal EPurchaseResult PurchaseResult { get; private set; }
|
||||||
internal int ErrorCode { get; private set; }
|
internal KeyValue ReceiptInfo { get; private set; } = new KeyValue();
|
||||||
internal byte[] ReceiptInfo { get; private set; }
|
internal Dictionary<uint, string> Items { get; private set; } = new Dictionary<uint, string>();
|
||||||
|
|
||||||
internal PurchaseResponseCallback(CMsgClientPurchaseResponse body) {
|
internal PurchaseResponseCallback(CMsgClientPurchaseResponse body) {
|
||||||
Result = (EResult) body.eresult;
|
Result = (EResult) body.eresult;
|
||||||
ErrorCode = body.purchase_result_details;
|
PurchaseResult = (EPurchaseResult) body.purchase_result_details;
|
||||||
ReceiptInfo = body.purchase_receipt_info;
|
|
||||||
PurchaseResult = (EPurchaseResult) ErrorCode;
|
using (MemoryStream ms = new MemoryStream(body.purchase_receipt_info)) {
|
||||||
|
if (ReceiptInfo.TryReadAsBinary(ms)) {
|
||||||
|
foreach (KeyValue lineItem in ReceiptInfo["lineitems"].Children) {
|
||||||
|
Items.Add((uint) lineItem["PackageID"].AsUnsignedLong(), lineItem["ItemDescription"].AsString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,9 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>cirno.ico</ApplicationIcon>
|
<ApplicationIcon>cirno.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
|
<Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
<HintPath>..\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||||
@@ -113,22 +116,23 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="cirno.ico" />
|
<Content Include="cirno.ico" />
|
||||||
|
<Content Include="config\example.xml">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent Condition=" '$(OS)' != 'Unix' ">(robocopy $(ProjectDir)config $(TargetDir)config /S /E) ^& IF %25ERRORLEVEL%25 GEQ 2 exit 0
|
<PreBuildEvent>
|
||||||
|
</PreBuildEvent>
|
||||||
if $(ConfigurationName) == Release (
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<PostBuildEvent Condition=" '$(OS)' != 'Unix' ">if $(ConfigurationName) == Release (
|
||||||
mkdir "$(TargetDir)out" "$(TargetDir)out\config"
|
mkdir "$(TargetDir)out" "$(TargetDir)out\config"
|
||||||
copy "$(TargetDir)config\example.xml" "$(TargetDir)out\config"
|
copy "$(TargetDir)config\example.xml" "$(TargetDir)out\config"
|
||||||
"$(SolutionDir)tools\ILMerge.exe" /out:"$(TargetDir)out\ASF.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" /target:exe /targetplatform:v4,C:\Windows\Microsoft.NET\Framework64\v4.0.30319 /wildcards
|
"$(SolutionDir)tools\ILMerge.exe" /out:"$(TargetDir)out\ASF.exe" "$(TargetDir)$(TargetName).exe" "$(TargetDir)*.dll" /target:exe /targetplatform:v4,C:\Windows\Microsoft.NET\Framework64\v4.0.30319 /wildcards
|
||||||
del "$(TargetDir)out\ASF.pdb"
|
del "$(TargetDir)out\ASF.pdb"
|
||||||
)</PostBuildEvent>
|
)</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
|
||||||
<PreBuildEvent>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
||||||
@@ -35,7 +34,7 @@ namespace ArchiSteamFarm {
|
|||||||
internal class Bot {
|
internal class Bot {
|
||||||
private const ushort CallbackSleep = 500; // In miliseconds
|
private const ushort CallbackSleep = 500; // In miliseconds
|
||||||
|
|
||||||
private static readonly HashSet<Bot> Bots = new HashSet<Bot>();
|
private static readonly Dictionary<string, Bot> Bots = new Dictionary<string, Bot>();
|
||||||
|
|
||||||
private readonly string ConfigFile;
|
private readonly string ConfigFile;
|
||||||
private readonly string SentryFile;
|
private readonly string SentryFile;
|
||||||
@@ -55,16 +54,16 @@ namespace ArchiSteamFarm {
|
|||||||
internal Trading Trading { get; private set; }
|
internal Trading Trading { get; private set; }
|
||||||
|
|
||||||
// Config variables
|
// Config variables
|
||||||
internal bool Enabled { get; private set; } = true;
|
internal bool Enabled { get; private set; } = false;
|
||||||
internal string SteamLogin { get; private set; } = "null";
|
internal string SteamLogin { get; private set; } = "null";
|
||||||
internal string SteamPassword { get; private set; } = "null";
|
internal string SteamPassword { get; private set; } = "null";
|
||||||
internal string SteamNickname { get; private set; } = "null";
|
internal string SteamNickname { get; private set; } = "null";
|
||||||
internal string SteamApiKey { get; private set; } = "null";
|
internal string SteamApiKey { get; private set; } = "null";
|
||||||
internal string SteamParentalPIN { get; private set; } = "0";
|
internal string SteamParentalPIN { get; private set; } = "0";
|
||||||
internal ulong SteamMasterID { get; private set; } = 76561198006963719;
|
internal ulong SteamMasterID { get; private set; } = 0;
|
||||||
internal ulong SteamMasterClanID { get; private set; } = 0;
|
internal ulong SteamMasterClanID { get; private set; } = 0;
|
||||||
internal bool ShutdownOnFarmingFinished { get; private set; } = false;
|
internal bool ShutdownOnFarmingFinished { get; private set; } = false;
|
||||||
internal HashSet<uint> Blacklist { get; private set; } = new HashSet<uint> { 368020 };
|
internal HashSet<uint> Blacklist { get; private set; } = new HashSet<uint> { 303700, 335590, 368020 };
|
||||||
internal bool Statistics { get; private set; } = true;
|
internal bool Statistics { get; private set; } = true;
|
||||||
|
|
||||||
internal static int GetRunningBotsCount() {
|
internal static int GetRunningBotsCount() {
|
||||||
@@ -78,7 +77,7 @@ namespace ArchiSteamFarm {
|
|||||||
internal static async Task ShutdownAllBots() {
|
internal static async Task ShutdownAllBots() {
|
||||||
List<Task> tasks = new List<Task>();
|
List<Task> tasks = new List<Task>();
|
||||||
lock (Bots) {
|
lock (Bots) {
|
||||||
foreach (Bot bot in Bots) {
|
foreach (Bot bot in Bots.Values) {
|
||||||
tasks.Add(Task.Run(async () => await bot.Shutdown().ConfigureAwait(false)));
|
tasks.Add(Task.Run(async () => await bot.Shutdown().ConfigureAwait(false)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,19 +85,25 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal Bot(string botName) {
|
internal Bot(string botName) {
|
||||||
|
if (Bots.ContainsKey(botName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
BotName = botName;
|
BotName = botName;
|
||||||
|
|
||||||
ConfigFile = Path.Combine(Program.ConfigDirectoryPath, BotName + ".xml");
|
ConfigFile = Path.Combine(Program.ConfigDirectoryPath, BotName + ".xml");
|
||||||
SentryFile = Path.Combine(Program.ConfigDirectoryPath, BotName + ".bin");
|
SentryFile = Path.Combine(Program.ConfigDirectoryPath, BotName + ".bin");
|
||||||
|
|
||||||
ReadConfig();
|
if (!ReadConfig()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Enabled) {
|
if (!Enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (Bots) {
|
lock (Bots) {
|
||||||
Bots.Add(this);
|
Bots.Add(BotName, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
@@ -130,79 +135,95 @@ namespace ArchiSteamFarm {
|
|||||||
Trading = new Trading(this);
|
Trading = new Trading(this);
|
||||||
|
|
||||||
// Start
|
// Start
|
||||||
Start();
|
var fireAndForget = Task.Run(async () => await Start().ConfigureAwait(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadConfig() {
|
private bool ReadConfig() {
|
||||||
using (XmlReader reader = XmlReader.Create(ConfigFile)) {
|
if (!File.Exists(ConfigFile)) {
|
||||||
while (reader.Read()) {
|
return false;
|
||||||
if (reader.NodeType != XmlNodeType.Element) {
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
string key = reader.Name;
|
try {
|
||||||
if (string.IsNullOrEmpty(key)) {
|
using (XmlReader reader = XmlReader.Create(ConfigFile)) {
|
||||||
continue;
|
while (reader.Read()) {
|
||||||
}
|
if (reader.NodeType != XmlNodeType.Element) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
string value = reader.GetAttribute("value");
|
string key = reader.Name;
|
||||||
if (string.IsNullOrEmpty(value)) {
|
if (string.IsNullOrEmpty(key)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (key) {
|
string value = reader.GetAttribute("value");
|
||||||
case "Enabled":
|
if (string.IsNullOrEmpty(value)) {
|
||||||
Enabled = bool.Parse(value);
|
continue;
|
||||||
break;
|
}
|
||||||
case "SteamLogin":
|
|
||||||
SteamLogin = value;
|
switch (key) {
|
||||||
break;
|
case "Enabled":
|
||||||
case "SteamPassword":
|
Enabled = bool.Parse(value);
|
||||||
SteamPassword = value;
|
break;
|
||||||
break;
|
case "SteamLogin":
|
||||||
case "SteamNickname":
|
SteamLogin = value;
|
||||||
SteamNickname = value;
|
break;
|
||||||
break;
|
case "SteamPassword":
|
||||||
case "SteamApiKey":
|
SteamPassword = value;
|
||||||
SteamApiKey = value;
|
break;
|
||||||
break;
|
case "SteamNickname":
|
||||||
case "SteamParentalPIN":
|
SteamNickname = value;
|
||||||
SteamParentalPIN = value;
|
break;
|
||||||
break;
|
case "SteamApiKey":
|
||||||
case "SteamMasterID":
|
SteamApiKey = value;
|
||||||
SteamMasterID = ulong.Parse(value);
|
break;
|
||||||
break;
|
case "SteamParentalPIN":
|
||||||
case "SteamMasterClanID":
|
SteamParentalPIN = value;
|
||||||
SteamMasterClanID = ulong.Parse(value);
|
break;
|
||||||
break;
|
case "SteamMasterID":
|
||||||
case "ShutdownOnFarmingFinished":
|
SteamMasterID = ulong.Parse(value);
|
||||||
ShutdownOnFarmingFinished = bool.Parse(value);
|
break;
|
||||||
break;
|
case "SteamMasterClanID":
|
||||||
case "Blacklist":
|
SteamMasterClanID = ulong.Parse(value);
|
||||||
foreach (string appID in value.Split(',')) {
|
break;
|
||||||
Blacklist.Add(uint.Parse(appID));
|
case "ShutdownOnFarmingFinished":
|
||||||
}
|
ShutdownOnFarmingFinished = bool.Parse(value);
|
||||||
break;
|
break;
|
||||||
case "Statistics":
|
case "Blacklist":
|
||||||
Statistics = bool.Parse(value);
|
Blacklist.Clear();
|
||||||
break;
|
foreach (string appID in value.Split(',')) {
|
||||||
default:
|
Blacklist.Add(uint.Parse(appID));
|
||||||
Logging.LogGenericWarning(BotName, "Unrecognized config value: " + key + "=" + value);
|
}
|
||||||
break;
|
break;
|
||||||
|
case "Statistics":
|
||||||
|
Statistics = bool.Parse(value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logging.LogGenericWarning(BotName, "Unrecognized config value: " + key + "=" + value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (XmlException e) {
|
||||||
|
Logging.LogGenericException(BotName, e);
|
||||||
|
Logging.LogGenericError(BotName, "Your config for this bot instance is invalid, it won't run!");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void Start() {
|
internal async Task Start() {
|
||||||
if (IsRunning) {
|
if (IsRunning) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SteamClient.Connect();
|
|
||||||
IsRunning = true;
|
IsRunning = true;
|
||||||
|
|
||||||
Task.Run(() => HandleCallbacks());
|
Logging.LogGenericInfo(BotName, "Starting...");
|
||||||
|
await Program.LimitSteamRequestsAsync().ConfigureAwait(false);
|
||||||
|
SteamClient.Connect();
|
||||||
|
|
||||||
|
var fireAndForget = Task.Run(() => HandleCallbacks());
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async Task Stop() {
|
internal async Task Stop() {
|
||||||
@@ -211,16 +232,27 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await CardsFarmer.StopFarming().ConfigureAwait(false);
|
await CardsFarmer.StopFarming().ConfigureAwait(false);
|
||||||
SteamClient.Disconnect();
|
|
||||||
IsRunning = false;
|
IsRunning = false;
|
||||||
|
SteamClient.Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async Task Shutdown() {
|
private async Task<bool> Shutdown(string botNameToShutdown) {
|
||||||
await Stop().ConfigureAwait(false);
|
Bot botToShutdown;
|
||||||
lock (Bots) {
|
if (!Bots.TryGetValue(botNameToShutdown, out botToShutdown)) {
|
||||||
Bots.Remove(this);
|
return false;
|
||||||
}
|
}
|
||||||
Program.OnBotShutdown(this);
|
|
||||||
|
await botToShutdown.Stop().ConfigureAwait(false);
|
||||||
|
lock (Bots) {
|
||||||
|
Bots.Remove(botNameToShutdown);
|
||||||
|
}
|
||||||
|
|
||||||
|
Program.OnBotShutdown(botToShutdown);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal async Task<bool> Shutdown() {
|
||||||
|
return await Shutdown(BotName).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async Task OnFarmingFinished() {
|
internal async Task OnFarmingFinished() {
|
||||||
@@ -240,6 +272,63 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SendMessageToUser(ulong steamID, string message) {
|
||||||
|
if (steamID == 0 || string.IsNullOrEmpty(message)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SteamFriends.SendChatMessage(steamID, EChatEntryType.ChatMsg, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void ResponseStatus(ulong steamID) {
|
||||||
|
if (steamID == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SendMessageToUser(steamID, "Currently " + Bots.Count + " bots are running");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResponseStart(ulong steamID, string botNameToStart) {
|
||||||
|
if (steamID == 0 || string.IsNullOrEmpty(botNameToStart)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Bots.ContainsKey(botNameToStart)) {
|
||||||
|
SendMessageToUser(steamID, "That bot instance is already running!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
new Bot(botNameToStart);
|
||||||
|
if (Bots.ContainsKey(botNameToStart)) {
|
||||||
|
SendMessageToUser(steamID, "Done!");
|
||||||
|
} else {
|
||||||
|
SendMessageToUser(steamID, "That bot instance failed to start, make sure that " + botNameToStart + ".xml config exists and bot is active!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ResponseStop(ulong steamID, string botNameToShutdown) {
|
||||||
|
if (steamID == 0 || string.IsNullOrEmpty(botNameToShutdown)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Bots.ContainsKey(botNameToShutdown)) {
|
||||||
|
SendMessageToUser(steamID, "That bot instance is already inactive!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (await Shutdown(botNameToShutdown).ConfigureAwait(false)) {
|
||||||
|
SendMessageToUser(steamID, "Done!");
|
||||||
|
} else {
|
||||||
|
SendMessageToUser(steamID, "That bot instance failed to shutdown!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void OnConnected(SteamClient.ConnectedCallback callback) {
|
private void OnConnected(SteamClient.ConnectedCallback callback) {
|
||||||
if (callback == null) {
|
if (callback == null) {
|
||||||
return;
|
return;
|
||||||
@@ -275,17 +364,21 @@ namespace ArchiSteamFarm {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDisconnected(SteamClient.DisconnectedCallback callback) {
|
private async void OnDisconnected(SteamClient.DisconnectedCallback callback) {
|
||||||
if (callback == null) {
|
if (callback == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!IsRunning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (SteamClient == null) {
|
if (SteamClient == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logging.LogGenericWarning(BotName, "Disconnected from Steam, reconnecting...");
|
Logging.LogGenericWarning(BotName, "Disconnected from Steam, reconnecting...");
|
||||||
Thread.Sleep(TimeSpan.FromMilliseconds(CallbackSleep));
|
await Program.LimitSteamRequestsAsync().ConfigureAwait(false);
|
||||||
SteamClient.Connect();
|
SteamClient.Connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,15 +429,42 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
if (message.Length == 17 && message[5] == '-' && message[11] == '-') {
|
if (message.Length == 17 && message[5] == '-' && message[11] == '-') {
|
||||||
ArchiHandler.RedeemKey(message);
|
ArchiHandler.RedeemKey(message);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (message) {
|
if (!message.StartsWith("!")) {
|
||||||
case "!farm":
|
return;
|
||||||
await CardsFarmer.StartFarming().ConfigureAwait(false);
|
}
|
||||||
break;
|
|
||||||
case "!exit":
|
if (!message.Contains(" ")) {
|
||||||
await Shutdown().ConfigureAwait(false);
|
switch (message) {
|
||||||
break;
|
case "!exit":
|
||||||
|
await ShutdownAllBots().ConfigureAwait(false);
|
||||||
|
break;
|
||||||
|
case "!farm":
|
||||||
|
await CardsFarmer.StartFarming().ConfigureAwait(false);
|
||||||
|
SendMessageToUser(steamID, "Done!");
|
||||||
|
break;
|
||||||
|
case "!restart":
|
||||||
|
await Program.Restart().ConfigureAwait(false);
|
||||||
|
break;
|
||||||
|
case "!status":
|
||||||
|
ResponseStatus(steamID);
|
||||||
|
break;
|
||||||
|
case "!stop":
|
||||||
|
await Shutdown().ConfigureAwait(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
string[] args = message.Split(' ');
|
||||||
|
switch (args[0]) {
|
||||||
|
case "!start":
|
||||||
|
ResponseStart(steamID, args[1]);
|
||||||
|
break;
|
||||||
|
case "!stop":
|
||||||
|
await ResponseStop(steamID, args[1]).ConfigureAwait(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,8 +538,7 @@ namespace ArchiSteamFarm {
|
|||||||
case EResult.TryAnotherCM:
|
case EResult.TryAnotherCM:
|
||||||
Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + callback.Result + " / " + callback.ExtendedResult + ", retrying...");
|
Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + callback.Result + " / " + callback.ExtendedResult + ", retrying...");
|
||||||
await Stop().ConfigureAwait(false);
|
await Stop().ConfigureAwait(false);
|
||||||
Thread.Sleep(5000);
|
await Start().ConfigureAwait(false);
|
||||||
Start();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + callback.Result + " / " + callback.ExtendedResult);
|
Logging.LogGenericWarning(BotName, "Unable to login to Steam: " + callback.Result + " / " + callback.ExtendedResult);
|
||||||
@@ -484,7 +603,8 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var purchaseResult = callback.PurchaseResult;
|
var purchaseResult = callback.PurchaseResult;
|
||||||
SteamFriends.SendChatMessage(SteamMasterID, EChatEntryType.ChatMsg, "Status: " + purchaseResult);
|
var items = callback.Items;
|
||||||
|
SendMessageToUser(SteamMasterID, "Status: " + purchaseResult + " | Items: " + string.Join("", items));
|
||||||
|
|
||||||
if (purchaseResult == ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OK) {
|
if (purchaseResult == ArchiHandler.PurchaseResponseCallback.EPurchaseResult.OK) {
|
||||||
await CardsFarmer.StartFarming().ConfigureAwait(false);
|
await CardsFarmer.StartFarming().ConfigureAwait(false);
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ namespace ArchiSteamFarm {
|
|||||||
FarmResetEvent.Set();
|
FarmResetEvent.Set();
|
||||||
while (NowFarming) {
|
while (NowFarming) {
|
||||||
Logging.LogGenericInfo(Bot.BotName, "Waiting for reaction...");
|
Logging.LogGenericInfo(Bot.BotName, "Waiting for reaction...");
|
||||||
Thread.Sleep(1000);
|
await Utilities.SleepAsync(1000).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
FarmResetEvent.Reset();
|
FarmResetEvent.Reset();
|
||||||
Logging.LogGenericInfo(Bot.BotName, "Farming stopped!");
|
Logging.LogGenericInfo(Bot.BotName, "Farming stopped!");
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ using System.Diagnostics;
|
|||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal static class Debugging {
|
internal static class Debugging {
|
||||||
internal static bool IsReleaseBuild { get; private set; } = true;
|
internal static bool IsDebugBuild { get; private set; } = false;
|
||||||
|
internal static bool IsReleaseBuild { get { return !IsDebugBuild; } }
|
||||||
|
|
||||||
static Debugging() {
|
static Debugging() {
|
||||||
MarkIfDebug();
|
MarkIfDebug();
|
||||||
@@ -34,7 +35,7 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
[Conditional("DEBUG")]
|
[Conditional("DEBUG")]
|
||||||
private static void MarkIfDebug() {
|
private static void MarkIfDebug() {
|
||||||
IsReleaseBuild = false;
|
IsDebugBuild = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,11 @@ namespace ArchiSteamFarm {
|
|||||||
private const string LatestGithubReleaseURL = "https://api.github.com/repos/JustArchi/ArchiSteamFarm/releases/latest";
|
private const string LatestGithubReleaseURL = "https://api.github.com/repos/JustArchi/ArchiSteamFarm/releases/latest";
|
||||||
|
|
||||||
internal static readonly object ConsoleLock = new object();
|
internal static readonly object ConsoleLock = new object();
|
||||||
|
private static readonly SemaphoreSlim SteamSemaphore = new SemaphoreSlim(1);
|
||||||
private static readonly ManualResetEvent ShutdownResetEvent = new ManualResetEvent(false);
|
private static readonly ManualResetEvent ShutdownResetEvent = new ManualResetEvent(false);
|
||||||
private static readonly AssemblyName AssemblyName = Assembly.GetExecutingAssembly().GetName();
|
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
|
||||||
|
private static readonly string ExecutablePath = Assembly.Location;
|
||||||
|
private static readonly AssemblyName AssemblyName = Assembly.GetName();
|
||||||
private static readonly string ExeName = AssemblyName.Name + ".exe";
|
private static readonly string ExeName = AssemblyName.Name + ".exe";
|
||||||
private static readonly string Version = AssemblyName.Version.ToString();
|
private static readonly string Version = AssemblyName.Version.ToString();
|
||||||
|
|
||||||
@@ -69,7 +72,7 @@ namespace ArchiSteamFarm {
|
|||||||
if (localVersion.CompareTo(remoteVersion) < 0) {
|
if (localVersion.CompareTo(remoteVersion) < 0) {
|
||||||
Logging.LogGenericNotice("", "New version is available!");
|
Logging.LogGenericNotice("", "New version is available!");
|
||||||
Logging.LogGenericNotice("", "Consider updating yourself!");
|
Logging.LogGenericNotice("", "Consider updating yourself!");
|
||||||
Thread.Sleep(5000);
|
await Utilities.SleepAsync(5000).ConfigureAwait(false);
|
||||||
} else if (localVersion.CompareTo(remoteVersion) > 0) {
|
} else if (localVersion.CompareTo(remoteVersion) > 0) {
|
||||||
Logging.LogGenericNotice("", "You're currently using pre-release version!");
|
Logging.LogGenericNotice("", "You're currently using pre-release version!");
|
||||||
Logging.LogGenericNotice("", "Be careful!");
|
Logging.LogGenericNotice("", "Be careful!");
|
||||||
@@ -81,6 +84,18 @@ namespace ArchiSteamFarm {
|
|||||||
Environment.Exit(exitCode);
|
Environment.Exit(exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static async Task Restart() {
|
||||||
|
await Bot.ShutdownAllBots().ConfigureAwait(false);
|
||||||
|
System.Diagnostics.Process.Start(ExecutablePath);
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static async Task LimitSteamRequestsAsync() {
|
||||||
|
await SteamSemaphore.WaitAsync().ConfigureAwait(false);
|
||||||
|
await Utilities.SleepAsync(5 * 1000).ConfigureAwait(false); // We must add some delay to not get caught by Steam anty-DoS
|
||||||
|
SteamSemaphore.Release();
|
||||||
|
}
|
||||||
|
|
||||||
internal static string GetUserInput(string botLogin, EUserInputType userInputType) {
|
internal static string GetUserInput(string botLogin, EUserInputType userInputType) {
|
||||||
string result;
|
string result;
|
||||||
lock (ConsoleLock) {
|
lock (ConsoleLock) {
|
||||||
@@ -104,13 +119,14 @@ namespace ArchiSteamFarm {
|
|||||||
result = Console.ReadLine();
|
result = Console.ReadLine();
|
||||||
Console.Clear(); // For security purposes
|
Console.Clear(); // For security purposes
|
||||||
}
|
}
|
||||||
|
result = result.Trim(); // Get rid of all whitespace characters
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void OnBotShutdown(Bot bot) {
|
internal static async void OnBotShutdown(Bot bot) {
|
||||||
if (Bot.GetRunningBotsCount() == 0) {
|
if (Bot.GetRunningBotsCount() == 0) {
|
||||||
Logging.LogGenericInfo("Main", "No bots are running, exiting");
|
Logging.LogGenericInfo("Main", "No bots are running, exiting");
|
||||||
Thread.Sleep(5000); // This might be the only message user gets, consider giving him some time
|
await Utilities.SleepAsync(5000).ConfigureAwait(false); // This might be the only message user gets, consider giving him some time
|
||||||
ShutdownResetEvent.Set();
|
ShutdownResetEvent.Set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,6 +136,16 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
Task.Run(async () => await CheckForUpdate().ConfigureAwait(false)).Wait();
|
Task.Run(async () => await CheckForUpdate().ConfigureAwait(false)).Wait();
|
||||||
|
|
||||||
|
// Allow loading configs from source tree if it's a debug build
|
||||||
|
if (Debugging.IsDebugBuild) {
|
||||||
|
for (var i = 0; i < 4; i++) {
|
||||||
|
Directory.SetCurrentDirectory("..");
|
||||||
|
if (Directory.Exists(ConfigDirectoryPath)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!Directory.Exists(ConfigDirectoryPath)) {
|
if (!Directory.Exists(ConfigDirectoryPath)) {
|
||||||
Logging.LogGenericError("Main", "Config directory doesn't exist!");
|
Logging.LogGenericError("Main", "Config directory doesn't exist!");
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
|
|||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.5.0.0")]
|
[assembly: AssemblyVersion("0.6.0.0")]
|
||||||
[assembly: AssemblyFileVersion("0.5.0.0")]
|
[assembly: AssemblyFileVersion("0.6.0.0")]
|
||||||
|
|||||||
@@ -36,33 +36,32 @@ namespace ArchiSteamFarm {
|
|||||||
Bot = bot;
|
Bot = bot;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void CheckTrades() {
|
internal async void CheckTrades() {
|
||||||
if (ParsingTasks < 2) {
|
if (ParsingTasks < 2) {
|
||||||
ParsingTasks++;
|
ParsingTasks++;
|
||||||
Task.Run(() => ParseActiveTrades());
|
|
||||||
|
await Semaphore.WaitAsync().ConfigureAwait(false);
|
||||||
|
await ParseActiveTrades().ConfigureAwait(false);
|
||||||
|
Semaphore.Release();
|
||||||
|
|
||||||
|
ParsingTasks--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ParseActiveTrades() {
|
private async Task ParseActiveTrades() {
|
||||||
await Semaphore.WaitAsync().ConfigureAwait(false);
|
|
||||||
|
|
||||||
List<SteamTradeOffer> tradeOffers = Bot.ArchiWebHandler.GetTradeOffers();
|
List<SteamTradeOffer> tradeOffers = Bot.ArchiWebHandler.GetTradeOffers();
|
||||||
if (tradeOffers != null) {
|
if (tradeOffers == null) {
|
||||||
List<Task> tasks = new List<Task>();
|
return;
|
||||||
foreach (SteamTradeOffer tradeOffer in tradeOffers) {
|
|
||||||
if (tradeOffer.trade_offer_state == SteamTradeOffer.ETradeOfferState.Active) {
|
|
||||||
Task task = Task.Run(async () => {
|
|
||||||
await ParseTrade(tradeOffer).ConfigureAwait(false);
|
|
||||||
});
|
|
||||||
tasks.Add(task);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await Task.WhenAll(tasks).ConfigureAwait(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ParsingTasks--;
|
List<Task> tasks = new List<Task>();
|
||||||
Semaphore.Release();
|
foreach (SteamTradeOffer tradeOffer in tradeOffers) {
|
||||||
|
if (tradeOffer.trade_offer_state == SteamTradeOffer.ETradeOfferState.Active) {
|
||||||
|
tasks.Add(Task.Run(async () => await ParseTrade(tradeOffer).ConfigureAwait(false)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ParseTrade(SteamTradeOffer tradeOffer) {
|
private async Task ParseTrade(SteamTradeOffer tradeOffer) {
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal static class Utilities {
|
internal static class Utilities {
|
||||||
|
private static readonly Random Random = new Random();
|
||||||
|
|
||||||
|
internal static async Task SleepAsync(int miliseconds) {
|
||||||
|
await Task.Delay(miliseconds).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
internal static ulong OnlyNumbers(string inputString) {
|
internal static ulong OnlyNumbers(string inputString) {
|
||||||
if (string.IsNullOrEmpty(inputString)) {
|
if (string.IsNullOrEmpty(inputString)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1,53 +1,62 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
||||||
<!-- Every bot should have it's own unique .xml configuration file, this is example on which you can base on -->
|
<!-- Every bot should have it's own unique .xml configuration file, this is example on which you can base on -->
|
||||||
|
|
||||||
<!-- Master switch to turn account on and off, set to "true" after you're done -->
|
<!-- Notice, if you use special characters reserved for XML, you should escape them -->
|
||||||
<!-- TIP: This bot instance won't run unless below switch is set to "true" -->
|
<!-- Escape table: [& - &] | [" - "] | [' - '] | [< - <] | [> - >] -->
|
||||||
<Enabled type="bool" value="false"/>
|
<!-- So e.g. if your SteamPassword is "foo&" you should write value="foo&" -->
|
||||||
|
|
||||||
<!-- This is your steam login, the one you use for logging in to steam -->
|
<!-- Master switch to turn account on and off, set to "true" after you're done -->
|
||||||
<!-- TIP: You can use "null" if you wish to enter login on every startup -->
|
<!-- TIP: This bot instance won't run unless below switch is set to "true" -->
|
||||||
<SteamLogin type="string" value="null"/>
|
<Enabled type="bool" value="false"/>
|
||||||
|
|
||||||
<!-- This is your steam password, the one you use for logging in to steam -->
|
<!-- This is your steam login, the one you use for logging in to steam -->
|
||||||
<!-- TIP: You can use "null" if you wish to enter password on every startup -->
|
<!-- TIP: You can use "null" if you wish to enter login on every startup -->
|
||||||
<SteamPassword type="string" value="null"/>
|
<SteamLogin type="string" value="null"/>
|
||||||
|
|
||||||
<!-- This is steam nickname, the one you want to use for bot. Can be anything up to 32 characters -->
|
<!-- This is your steam password, the one you use for logging in to steam -->
|
||||||
<!-- TIP: You can use "null" if you wish to preserve your actual nickname -->
|
<!-- TIP: You can use "null" if you wish to enter password on every startup -->
|
||||||
<SteamNickname type="string" value="null"/>
|
<SteamPassword type="string" value="null"/>
|
||||||
|
|
||||||
<!-- This is your bot's API key, get one at https://steamcommunity.com/dev/apikey while logged in as bot, domain doesn't matter -->
|
<!-- This is steam nickname, the one you want to use for bot. Can be anything up to 32 characters -->
|
||||||
<!-- TIP: You can use "null", but it will disable all API-based functionalities such as trading -->
|
<!-- TIP: You can use "null" if you wish to preserve your actual nickname -->
|
||||||
<SteamApiKey type="string" value="null"/>
|
<SteamNickname type="string" value="null"/>
|
||||||
|
|
||||||
<!-- This is your parental PIN if you use steam parental functionality -->
|
<!-- This is your bot's API key, get one at https://steamcommunity.com/dev/apikey while logged in as bot, domain doesn't matter -->
|
||||||
<!-- TIP: Most likely you don't want to change it. You can use "null" if you wish to enter PIN on every startup, 0 means there is no PIN -->
|
<!-- TIP: You can use "null", but it will disable all API-based functionalities such as trading -->
|
||||||
<SteamParentalPIN type="string" value="0"/>
|
<SteamApiKey type="string" value="null"/>
|
||||||
|
|
||||||
<!-- This is steamID of the bot-master - you, in steamID64 format -->
|
<!-- This is your parental PIN if you use steam parental functionality -->
|
||||||
<!-- TIP: You can use "0", but bot won't accept steam cd-keys or trades from anybody" -->
|
<!-- TIP: Most likely you don't want to change it. You can use "null" if you wish to enter PIN on every startup, 0 means there is no PIN -->
|
||||||
<SteamMasterID type="ulong" value="76561198006963719"/>
|
<SteamParentalPIN type="string" value="0"/>
|
||||||
|
|
||||||
<!-- This defines clan of the master, bot will join chatroom of that clan automatically after logging in -->
|
<!-- This is steamID64 of the bot-master - you, [Example: 76561198006963719] -->
|
||||||
<!-- TIP: Most likely you don't want to change it -->
|
<!-- TIP: You can use "0", but bot won't accept steam cd-keys or trades from anybody" -->
|
||||||
<SteamMasterClanID type="ulong" value="0"/>
|
<SteamMasterID type="ulong" value="0"/>
|
||||||
|
|
||||||
<!-- This switch defines if bot should disconnect once farming is finished -->
|
<!-- This defines clan of the master, bot will join chatroom of that clan automatically after logging in if set -->
|
||||||
<!-- When no bots are active, ASF will shutdown as well -->
|
<!-- SteamMasterClanID could be found by visiting your group-page -->
|
||||||
<!-- Some people may want to keep their bots 24/7, other disconnect them after job is done -->
|
<!-- [Example: http://steamcommunity.com/groups/hellokitty/] -->
|
||||||
<!-- Choose yourself what you prefer -->
|
<!-- Adding "memberslistxml/?xml=1" to the end of this url so it looks like -->
|
||||||
<ShutdownOnFarmingFinished type="bool" value="false"/>
|
<!-- [Example: http://steamcommunity.com/groups/hellokitty/memberslistxml/?xml=1] -->
|
||||||
|
<!-- Finally replace the SteamMasterClanID value with groupID64 you got from your groups xml-file -->
|
||||||
|
<!-- TIP: Most likely you don't want to change it -->
|
||||||
|
<SteamMasterClanID type="ulong" value="0"/>
|
||||||
|
|
||||||
<!-- Comma-separated list of IDs that should not be considered for farming -->
|
<!-- This switch defines if bot should disconnect once farming is finished -->
|
||||||
<!-- TIP: Most likely you don't want to change it -->
|
<!-- When no bots are active, ASF will shutdown as well -->
|
||||||
<Blacklist type="HashSet(uint)" value="368020"/>
|
<!-- Some people may want to keep their bots 24/7, other disconnect them after job is done -->
|
||||||
|
<!-- Choose yourself what you prefer -->
|
||||||
|
<ShutdownOnFarmingFinished type="bool" value="false"/>
|
||||||
|
|
||||||
<!-- This enables statistics for me - bot will join Archi's SC Farm group and chat -->
|
<!-- Comma-separated list of IDs that should not be considered for farming -->
|
||||||
<!-- Consider leaving it at "true", this way I can check how many running bots are active -->
|
<!-- TIP: Most likely you don't want to change it -->
|
||||||
<!-- TIP: Group link is http://steamcommunity.com/groups/ascfarm -->
|
<Blacklist type="HashSet(uint)" value="303700,335590,368020"/>
|
||||||
<Statistics type="bool" value="true"/>
|
|
||||||
|
<!-- This enables statistics for me - bot will join Archi's SC Farm group and chat -->
|
||||||
|
<!-- Consider leaving it at "true", this way I can check how many running bots are active -->
|
||||||
|
<!-- TIP: Group link is http://steamcommunity.com/groups/ascfarm -->
|
||||||
|
<Statistics type="bool" value="true"/>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
49
README.md
49
README.md
@@ -1,26 +1,39 @@
|
|||||||
# ArchiSteamFarm
|
ArchiSteamFarm
|
||||||
|
===================
|
||||||
|
|
||||||
Big work-in-progress
|
Big work-in-progress. This bot allows you to farm steam cards using multiple accounts simultaneously. Each account is defined by it's own XML config in `config` directory and you don´t need any steam-client running in the background.
|
||||||
|
|
||||||
Allows you to farm steam cards using multiple accounts simultaneously.
|
**Current functions:**
|
||||||
|
|
||||||
Each account is defined by it's own XML config in "config" directory.
|
- Automatically farm steam cards using any number of active accounts
|
||||||
|
- Automatically accept friend requests sent from master
|
||||||
|
- Automatically accept all trades coming from master
|
||||||
|
- Automatically accept all steam cd-keys sent via chat from master
|
||||||
|
- SteamGuard / 2-factor-authentication support
|
||||||
|
- Full Mono support, tested on Debian "9.0" Stretch (testing)
|
||||||
|
|
||||||
Current functions:
|
**Current Commands:**
|
||||||
- Does not need Steam client running, or even a GUI. Fully based on SteamKit2 and reverse-engineered Steam protocol.
|
|
||||||
- Automatically farm steam cards using any number of active accounts
|
|
||||||
- Automatically accept friend requests sent from master
|
|
||||||
- Automatically accept all trades coming from master
|
|
||||||
- Automatically accept all steam cd-keys sent via chat from master
|
|
||||||
- SteamGuard / 2-factor-authentication support
|
|
||||||
- Full Mono support, tested on Debian "9.0" Stretch (testing)
|
|
||||||
|
|
||||||
TODO:
|
- `!farm` Restarts the bot and starts card-farming (again)
|
||||||
- Smart multi-games farming till every game reaches 2 hours, then one-by-one (similar to Idle Master) - Backend code is already here, just missing the logic and tests.
|
- `!exit` Stops the bot
|
||||||
- Possible integration with SteamTradeMatcher, bot can detect dupes and trade them automatically. Again, backend code is already here, just missing actual implementation.
|
|
||||||
- Automatic sending of steam trades to master, after game is fully farmed.
|
> You can use chat-commands in group-chat or private-chat with your bot.
|
||||||
|
> The MasterID has to be set for this specific bot / config-file.
|
||||||
|
|
||||||
|
**Supported / Tested Operating-Systems:**
|
||||||
|
|
||||||
|
- Windows 10 Enterprise Edition
|
||||||
|
- Debian 9.0 Stretch (Mono)
|
||||||
|
- Debian 8.1 Jessie (Mono)
|
||||||
|
|
||||||
|
**TODO**:
|
||||||
|
|
||||||
|
- Smart Multi-Game-Farming
|
||||||
|
- Possible integration with SteamTradeMatcher, bot can detect dupes and trade them automatically. Backend-code is already here, just missing actual implementation.
|
||||||
|
- Automatic sending of steamtrades to master(after game is fully farmed)
|
||||||
- Probably much more
|
- Probably much more
|
||||||
|
|
||||||
This is big WIP, so feel free to send pull requests if you wish.
|
|
||||||
|
|
||||||
I'll release some releases later, when everything is tested and code cleaned up.
|
> This is big WIP, so feel free to send pull requests if you wish. I'll
|
||||||
|
> release some releases later, when everything is tested and code
|
||||||
|
> cleaned up.
|
||||||
|
|||||||
Reference in New Issue
Block a user