Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sp0ok3r committed Nov 21, 2024
1 parent 879fd08 commit 7215c51
Show file tree
Hide file tree
Showing 15 changed files with 399 additions and 427 deletions.
8 changes: 3 additions & 5 deletions MercuryBOT.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mercury", "MercuryBOT\Mercury.csproj", "{95A62B66-12F4-410E-8F8C-AF538DE7853D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MercuryProject", "MercuryBOT\MercuryProject.csproj", "{95A62B66-12F4-410E-8F8C-AF538DE7853D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -16,12 +16,10 @@ Global
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|x86.ActiveCfg = Debug|x86
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|x86.Build.0 = Debug|x86
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|x86.ActiveCfg = Debug|Any CPU
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Release|Any CPU.Build.0 = Release|Any CPU
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Release|x86.ActiveCfg = Release|x86
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Release|x86.Build.0 = Release|x86
{95A62B66-12F4-410E-8F8C-AF538DE7853D}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
484 changes: 226 additions & 258 deletions MercuryBOT/Main.Designer.cs

Large diffs are not rendered by default.

93 changes: 38 additions & 55 deletions MercuryBOT/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
using Microsoft.Win32;
using Mercury;
using Mercury.MetroMessageBox;
using Gameloop.Vdf;
using AngleSharp.Io.Dom;
using System.Diagnostics.CodeAnalysis;

namespace MercuryBOT
{
Expand Down Expand Up @@ -401,7 +404,7 @@ private void btn_admincmds_Click(object sender, EventArgs e)
".pchiber - Puts pc on hibernate mode\n" +
".pcrr - Restart PC.\n" +
".pcoff - Shutdown PC.\n" +
".close - Closes MercuryBOT process.\n" +
".close - Closes Mercury process.\n" +
".logoff - Logoff from current account.\n" +
".non customname - Play a non - steam game(change customname to anything)\n" +
".play customname - Play a non steam game and appids.", "Mercury - Admin Commands", MessageBoxButtons.OK, MessageBoxIcon.Question, 270);
Expand Down Expand Up @@ -616,7 +619,7 @@ private void btn_sendMsg2Friends_Click(object sender, EventArgs e) // activate l
string msg = txtBox_msg2Friends.Text;
var friends = steamfriends013.GetFriendCount((int)EFriendFlags.k_EFriendFlagImmediate);

//var ad = HandleLogin.isInMercuryGroup ? "" : "\n MercuryBOT";
//var ad = HandleLogin.isInMercuryGroup ? "" : "\n Mercury";

byte[] msgBytes = Encoding.UTF8.GetBytes(msg);
for (int i = 0; i < friends; i++)
Expand Down Expand Up @@ -799,7 +802,7 @@ public void playNormal()
gameuints.Add(a.Games[i].app_id); // tentar obter lista do json, para nao criar outra???
}

//var ad = HandleLogin.isInMercuryGroup ? "" : " ❤ MercuryBOT";
//var ad = HandleLogin.isInMercuryGroup ? "" : " ❤ Mercury";
if (chck_nonsteamNgames.Checked)
{
if (txtBox_gameNonSteam.Text.Length != 0)
Expand All @@ -813,7 +816,7 @@ public void playNormal()
}
else
{
handleLogin.PlayGames(gameuints, "Idling ⌛ MercuryBOT");
handleLogin.PlayGames(gameuints, "Idling ⌛ Mercury: Steam Tool");
Thread.Sleep(2000);
handleLogin.PlayGames(gameuints, "disable");
}
Expand Down Expand Up @@ -1239,10 +1242,6 @@ private void _MouseUp(object sender, MouseEventArgs e)
#endregion

#region Links
private void Link_steamgroup_Click(object sender, EventArgs e)
{
Process.Start("https://steamcommunity.com/groups/MercuryBOT");
}

private void pictureBox_Discord_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -1303,19 +1302,6 @@ private void link_reportBugFeature_Click(object sender, EventArgs e)
{
Process.Start("https://github.com/sp0ok3r/Mercury/issues");
}

private void pictureBox_Steam_Click(object sender, EventArgs e)
{
string MercuryGroup = "https://steamcommunity.com/groups/MercuryBOT";
if (Program.CurrentProcesses.FirstOrDefault(x => x.ProcessName == "Steam") != null)
{
Process.Start("steam://openurl/" + MercuryGroup);
}
else
{
Process.Start(MercuryGroup);
}
}
#endregion
private void toolStrip_Logout_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -1415,14 +1401,14 @@ private void toggle_startWindows_CheckedChanged(object sender, EventArgs e)
SettingsList.startup = true;

Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
key.SetValue("MercuryBOT", Program.ExecutablePath + @"\MercuryBOT.exe");
key.SetValue("Mercury", Program.ExecutablePath + @"\Mercury.exe");
}
else
{
SettingsList.startup = false;

Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
key.DeleteValue("MercuryBOT", false);
key.DeleteValue("Mercury", false);
}
File.WriteAllText(Program.SettingsJsonFile, JsonConvert.SerializeObject(SettingsList, Formatting.Indented));
}
Expand Down Expand Up @@ -2048,58 +2034,55 @@ public static bool LoginAccountInClient(string user)
{
ClearAutoLoginUserKeyValues();

var AutoLoginUser_Key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Valve\\Steam", true);
var steampath = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Valve\\Steam", true);

/*

if (AutoLoginUser_Key != null)
{
AutoLoginUser_Key.SetValue("AutoLoginUser", user);
AutoLoginUser_Key.SetValue("RememberPassword", 1);
AutoLoginUser_Key.Close();
//if (steampath != null)
//{
// steampath.SetValue("AutoLoginUser", user);
// steampath.SetValue("RememberPassword", 1);
// steampath.Close();


string loginusersPath = steamPath + "config/loginusers.vdf";
// string loginusersPath = steampath + "config/loginusers.vdf";

dynamic loginusers = VdfConvert.Deserialize(File.ReadAllText(loginusersPath));
// dynamic loginusers = VdfConvert.Deserialize(File.ReadAllText(loginusersPath));

dynamic usersObject = loginusers.Value;
dynamic userObject = usersObject[account.SteamId];
// dynamic usersObject = loginusers.Value;
// dynamic userObject = usersObject[account.SteamId];

userObject.RememberPassword = 1;
userObject.AllowAutoLogin = 1;
//userObject.MostRecent = value;
// userObject.RememberPassword = 1;
// userObject.AllowAutoLogin = 1;
// //userObject.MostRecent = value;

usersObject[account.SteamId] = userObject;
loginusers.Value = usersObject;
// usersObject[account.SteamId] = userObject;
// loginusers.Value = usersObject;

string serialized = VdfConvert.Serialize(loginusers);
// string serialized = VdfConvert.Serialize(loginusers);

File.WriteAllText(loginusersPath, serialized);
// File.WriteAllText(loginusersPath, serialized);





var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = Extensions.SteamLocation + "/steam.exe"
// Arguments = "-silent"
}
};
process.Start();
// var process = new Process
// {
// StartInfo = new ProcessStartInfo
// {
// FileName = Extensions.SteamLocation + "/steam.exe"
// // Arguments = "-silent"
// }
// };
// process.Start();

return true;
// return true;

}
else
// }
// else
{
return false;
}
*/
return false;
}
}

Expand Down
9 changes: 6 additions & 3 deletions MercuryBOT/Main.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<metadata name="MongoTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>226, 17</value>
</metadata>
<metadata name="MongoTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>226, 17</value>
</metadata>
<metadata name="HeaderAppName1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand All @@ -144,6 +147,9 @@
<metadata name="contextmenu_gridAccs.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>642, 17</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="HFriendID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand All @@ -153,9 +159,6 @@
<metadata name="FLastLogoff.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Mercury_notifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>335, 17</value>
</metadata>
Expand Down
Loading

0 comments on commit 7215c51

Please sign in to comment.