Skip to content

Commit

Permalink
feat: added a balance check and added a color for the output
Browse files Browse the repository at this point in the history
  • Loading branch information
provincialcxz committed Jul 18, 2024
1 parent 6d64ac7 commit a9c539a
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 16 deletions.
10 changes: 9 additions & 1 deletion BlumAutoBot/BumAutoBot/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
27 changes: 27 additions & 0 deletions BlumAutoBot/BumAutoBot/BumBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<Reference Include="Costura, Version=5.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
<Private>True</Private>
Expand All @@ -56,6 +59,9 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
Expand Down Expand Up @@ -112,6 +118,9 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
Expand All @@ -123,6 +132,9 @@
<Private>True</Private>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Reflection, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll</HintPath>
<Private>True</Private>
Expand All @@ -133,6 +145,9 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -168,11 +183,23 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Json.8.0.4\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Text.RegularExpressions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand Down
6 changes: 3 additions & 3 deletions BlumAutoBot/BumBot.sln → BlumAutoBot/BumAutoBot/BumBot.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34511.84
VisualStudioVersion = 17.8.34322.80
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BumBot", "BumBot\BumBot.csproj", "{56A3F714-D214-4E82-87A7-F919C426E5AE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BumBot", "BumBot.csproj", "{56A3F714-D214-4E82-87A7-F919C426E5AE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -20,6 +20,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9ABD3E4E-5E68-4B12-A8AF-89C802B217D0}
SolutionGuid = {246E96D2-E395-4888-A93E-0D1AC2767E38}
EndGlobalSection
EndGlobal
47 changes: 47 additions & 0 deletions BlumAutoBot/BumAutoBot/Helper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Net;

namespace BlumBot
{
Expand Down Expand Up @@ -36,11 +40,16 @@ private int platform()
Console.WriteLine("2 - Android");
Console.WriteLine("3 - Windows PC");
Console.WriteLine("4 - MacOS");
Console.Write("Ваш выбор: ");
int choice = Int32.Parse(Console.ReadLine());
if (choice >= 1 && choice <= 4)
return choice;
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Вы ввели не правильное значение!");
Console.ResetColor();
}
}
}

Expand All @@ -53,11 +62,19 @@ private int version_iphone()
Console.WriteLine("2 - IOS 16");
Console.WriteLine("3 - IOS 17");
Console.WriteLine("4 - IOS 18");
Console.WriteLine("0 - Назад");
Console.Write("Ваш выбор: ");
int choice = Int32.Parse(Console.ReadLine());
if (choice == 0)
choice_platform();
if (choice >= 1 && choice <= 4)
return choice;
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Вы ввели не правильное значение!");
Console.ResetColor();
}
}
}

Expand All @@ -70,11 +87,19 @@ private int version_android()
Console.WriteLine("2 - Android 13 (Tiramisu)");
Console.WriteLine("3 - Android 14 (Upside Down Cake)");
Console.WriteLine("4 - Android 15 (Vanilla Ice Cream)");
Console.WriteLine("0 - Назад");
Console.Write("Ваш выбор: ");
int choice = Int32.Parse(Console.ReadLine());
if (choice == 0)
choice_platform();
if (choice >= 1 && choice <= 4)
return choice;
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Вы ввели не правильное значение!");
Console.ResetColor();
}
}
}

Expand All @@ -86,11 +111,19 @@ private int version_windows()
Console.WriteLine("1 - Windows 7");
Console.WriteLine("2 - Windows 10");
Console.WriteLine("3 - Windows 11");
Console.WriteLine("0 - Назад");
Console.Write("Ваш выбор: ");
int choice = Int32.Parse(Console.ReadLine());
if (choice == 0)
choice_platform();
if (choice >= 1 && choice <= 3)
return choice;
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Вы ввели не правильное значение!");
Console.ResetColor();
}
}
}

Expand All @@ -104,11 +137,19 @@ private int version_macos()
Console.WriteLine("3 - MacOS 12.7.5 (Monterey)");
Console.WriteLine("4 - MacOS 11.7.10 (Big Sur)");
Console.WriteLine("5 - MacOS 10.15.7 (Catalina)");
Console.WriteLine("0 - Назад");
Console.Write("Ваш выбор: ");
int choice = Int32.Parse(Console.ReadLine());
if (choice == 0)
choice_platform();
if (choice >= 1 && choice <= 5)
return choice;
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Вы ввели не правильное значение!");
Console.ResetColor();
}
}
}

Expand All @@ -121,7 +162,9 @@ public int replay()

if (repetitions < 1 || repetitions > 100)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Недопустимое количество повторений.");
Console.ResetColor();
}
else if (repetitions > 5)
{
Expand Down Expand Up @@ -160,7 +203,9 @@ public int scores()
}
else if (!int.TryParse(pointsInput, out points) || points < 200 || points > 280)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Неверное значение баллов. Пожалуйста, введите число от 200 до 280.");
Console.ResetColor();
continue;
}
else
Expand All @@ -181,7 +226,9 @@ public string GetAuthorizationToken()

if (string.IsNullOrEmpty(token))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Токен не может быть пустым. Пожалуйста, введите действительный токен авторизации.");
Console.ResetColor();
continue;
}

Expand Down
13 changes: 12 additions & 1 deletion BlumAutoBot/BumAutoBot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ static async Task Main(string[] args)
try
{
int choice = help.choice_platform();

await requests.GetBalanceAsync(authorizationToken, choice);

int repetitions = help.replay();
int points = help.scores();

Expand All @@ -32,12 +35,20 @@ static async Task Main(string[] args)

for (int i = 0; i < results.Length; i++)
{
Console.WriteLine($"Результат итерации {i + 1}:\n{results[i]}\n");
if (results[i] == "успех.")
Console.ForegroundColor = ConsoleColor.Green;
else
Console.ForegroundColor = ConsoleColor.Red;

Console.WriteLine($"Результат итерации {i + 1}: {results[i]}\n");
Console.ResetColor();
}
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"Ошибка: {ex.Message}");
Console.ResetColor();
}

Console.WriteLine("Еще разок? (yes/no): ");
Expand Down
4 changes: 2 additions & 2 deletions BlumAutoBot/BumAutoBot/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
Loading

0 comments on commit a9c539a

Please sign in to comment.