├── .gitattributes ├── .gitignore ├── LICENSE ├── MercuryBOT.sln ├── MercuryBOT ├── .refsignored ├── AccSettings │ ├── AccSettingsForm.Designer.cs │ ├── AccSettingsForm.cs │ ├── AccSettingsForm.resx │ ├── AddAcc.Designer.cs │ ├── AddAcc.cs │ ├── AddAcc.resx │ ├── EditAcc.Designer.cs │ ├── EditAcc.cs │ ├── EditAcc.resx │ ├── ProfilePrivacy.Designer.cs │ ├── ProfilePrivacy.cs │ └── ProfilePrivacy.resx ├── AccountLoginOFF.cs ├── CallbackMessages │ └── PurchaseResponseCallback.cs ├── Comments │ ├── CommentsGather.Designer.cs │ ├── CommentsGather.cs │ └── CommentsGather.resx ├── CustomAFKMessage │ ├── CustomAFKMessages.Designer.cs │ ├── CustomAFKMessages.cs │ └── CustomAFKMessages.resx ├── CustomHandlers │ └── GamesHandler.cs ├── DeviceAuth.cs ├── FriendsList │ ├── Chat.Designer.cs │ ├── Chat.cs │ ├── Chat.resx │ ├── FriendsRequests.cs │ ├── ListFriends.cs │ ├── MsgRecipients.Designer.cs │ ├── MsgRecipients.cs │ └── MsgRecipients.resx ├── Games │ ├── IdleSettings.Designer.cs │ ├── IdleSettings.cs │ ├── IdleSettings.resx │ ├── SelectGames.Designer.cs │ ├── SelectGames.cs │ └── SelectGames.resx ├── HandleLogin.cs ├── Helpers │ ├── CookieAwareWebClient.cs │ ├── Emojis.cs │ ├── Extensions.cs │ ├── HtmlTable.cs │ ├── SessionData.cs │ ├── SteamWeb.cs │ └── WebHelper.cs ├── InfoForm │ ├── Info.Designer.cs │ ├── Info.cs │ ├── Info.resx │ └── InfoHelper.cs ├── Main.Designer.cs ├── Main.cs ├── Main.resx ├── MercuryProject.csproj ├── MetroMessageBox │ ├── CustomMetroMessageBox.cs │ ├── CustomMetroMessageBoxControl.cs │ └── CustomMetroMessageBoxProperties.cs ├── Notification │ ├── NotifHelper.cs │ ├── NotificationForm.Designer.cs │ ├── NotificationForm.cs │ └── NotificationForm.resx ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── ChatLogger_Alert.wav │ ├── Images │ │ ├── DiscordLogo.png │ │ ├── MercuryIconLogo.ico │ │ ├── MercuryIconLogo.png │ │ ├── MercuryLogoWhite2.png │ │ ├── Restart_MouseHover.png │ │ ├── Restart_Normal.png │ │ ├── SteamLogo.png │ │ ├── github_logo.png │ │ ├── mapWhite.png │ │ ├── mercuryIMGNotFound.png │ │ └── sparkles.gif │ ├── Sounds │ │ ├── mercury_alert.wav │ │ ├── mercury_success.wav │ │ └── mercury_update.wav │ └── mercury6.png ├── Splash │ ├── SplashScreen.Designer.cs │ ├── SplashScreen.cs │ └── SplashScreen.resx ├── SteamCommunity │ ├── SteamWebold.cs │ └── Utils.cs ├── SteamGroups │ ├── GatherSteamGroups.Designer.cs │ ├── GatherSteamGroups.cs │ └── GatherSteamGroups.resx ├── SteamGuard │ ├── SteamGuard.Designer.cs │ ├── SteamGuard.cs │ └── SteamGuard.resx ├── SteamLocally │ └── LocalSteamConnect.cs ├── SteamProfileBackground │ ├── ProfileBackground.Designer.cs │ ├── ProfileBackground.cs │ └── ProfileBackground.resx ├── SteamRep │ ├── SteamRepCheck.Designer.cs │ ├── SteamRepCheck.cs │ └── SteamRepCheck.resx ├── UpdateManager │ ├── Updater.Designer.cs │ ├── Updater.cs │ └── Updater.resx ├── User2Json │ ├── Comments.cs │ ├── MercurySettings.cs │ ├── SteamComments.cs │ ├── SteamLoginUsers.cs │ ├── SteamPlayerLevel.cs │ ├── SteamProfilePrivacy.cs │ ├── SteamRepApi.cs │ └── UserSettings.cs ├── app.config ├── app.manifest └── packages.config ├── README.md ├── _config.yml └── img ├── MercuryIconLogo.png ├── MercuryLogoWhite.png └── mercury_login64.gif /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | [Xx]64/ 19 | [Xx]86/ 20 | [Bb]uild/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | 143 | # TODO: Un-comment the next line if you do not want to checkin 144 | # your web deploy settings because they may include unencrypted 145 | # passwords 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nupkg 151 | # The packages folder can be ignored because of Package Restore 152 | **/packages/* 153 | # except build/, which is used as an MSBuild target. 154 | !**/packages/build/ 155 | # Uncomment if necessary however generally it will be regenerated when needed 156 | #!**/packages/repositories.config 157 | # NuGet v3's project.json files produces more ignoreable files 158 | *.nuget.props 159 | *.nuget.targets 160 | 161 | # Microsoft Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Microsoft Azure Emulator 166 | ecf/ 167 | rcf/ 168 | 169 | # Windows Store app package directory 170 | AppPackages/ 171 | BundleArtifacts/ 172 | 173 | # Visual Studio cache files 174 | # files ending in .cache can be ignored 175 | *.[Cc]ache 176 | # but keep track of directories ending in .cache 177 | !*.[Cc]ache/ 178 | 179 | # Others 180 | ClientBin/ 181 | [Ss]tyle[Cc]op.* 182 | ~$* 183 | *~ 184 | *.dbmdl 185 | *.dbproj.schemaview 186 | *.pfx 187 | *.publishsettings 188 | node_modules/ 189 | orleans.codegen.cs 190 | 191 | # RIA/Silverlight projects 192 | Generated_Code/ 193 | 194 | # Backup & report files from converting an old project file 195 | # to a newer Visual Studio version. Backup files are not needed, 196 | # because we have git ;-) 197 | _UpgradeReport_Files/ 198 | Backup*/ 199 | UpgradeLog*.XML 200 | UpgradeLog*.htm 201 | 202 | # SQL Server files 203 | *.mdf 204 | *.ldf 205 | 206 | # Business Intelligence projects 207 | *.rdl.data 208 | *.bim.layout 209 | *.bim_*.settings 210 | 211 | # Microsoft Fakes 212 | FakesAssemblies/ 213 | 214 | # GhostDoc plugin setting file 215 | *.GhostDoc.xml 216 | 217 | # Node.js Tools for Visual Studio 218 | .ntvs_analysis.dat 219 | 220 | # Visual Studio 6 build log 221 | *.plg 222 | 223 | # Visual Studio 6 workspace options file 224 | *.opt 225 | 226 | # Visual Studio LightSwitch build output 227 | **/*.HTMLClient/GeneratedArtifacts 228 | **/*.DesktopClient/GeneratedArtifacts 229 | **/*.DesktopClient/ModelManifest.xml 230 | **/*.Server/GeneratedArtifacts 231 | **/*.Server/ModelManifest.xml 232 | _Pvt_Extensions 233 | 234 | # LightSwitch generated files 235 | GeneratedArtifacts/ 236 | ModelManifest.xml 237 | 238 | # Paket dependency manager 239 | .paket/paket.exe 240 | 241 | # FAKE - F# Make 242 | .fake/ 243 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MercuryBOT.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.11.35327.3 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MercuryProject", "MercuryBOT\MercuryProject.csproj", "{95A62B66-12F4-410E-8F8C-AF538DE7853D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x86 = Debug|x86 12 | Release|Any CPU = Release|Any CPU 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 19 | {95A62B66-12F4-410E-8F8C-AF538DE7853D}.Debug|x86.ActiveCfg = Debug|Any CPU 20 | {95A62B66-12F4-410E-8F8C-AF538DE7853D}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {95A62B66-12F4-410E-8F8C-AF538DE7853D}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {95A62B66-12F4-410E-8F8C-AF538DE7853D}.Release|x86.ActiveCfg = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | GlobalSection(ExtensibilityGlobals) = postSolution 28 | SolutionGuid = {9799065C-F81A-4A83-B694-8E8A56AAE293} 29 | EndGlobalSection 30 | EndGlobal 31 | -------------------------------------------------------------------------------- /MercuryBOT/.refsignored: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/.refsignored -------------------------------------------------------------------------------- /MercuryBOT/AccSettings/AccSettingsForm.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.Helpers; 11 | using System; 12 | using System.Linq; 13 | using Win32Interop.Methods; 14 | using System.Drawing; 15 | using MercuryBOT.SteamCommunity; 16 | using Mercury; 17 | 18 | namespace MercuryBOT.AccSettings 19 | { 20 | public partial class AccSettingsForm : MetroFramework.Forms.MetroForm 21 | { 22 | public AccSettingsForm() 23 | { 24 | InitializeComponent(); 25 | this.components.SetStyle(this); 26 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 27 | foreach (var button in this.Controls.OfType()) 28 | { 29 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, button.Width, button.Height, 5, 5); 30 | button.Region = Region.FromHrgn(ptr); 31 | Gdi32.DeleteObject(ptr); 32 | } 33 | } 34 | 35 | private void btn_setName_Click(object sender, EventArgs e) 36 | { 37 | HandleLogin.ChangeCurrentName(txtBox_nameChange.Text); 38 | txtBox_nameChange.Clear(); 39 | } 40 | 41 | private void btn_clearuserAliases_Click(object sender, EventArgs e) 42 | { 43 | if (HandleLogin.IsLoggedIn == true) 44 | { 45 | Utils.ClearAliasesAsync(); 46 | } 47 | else 48 | { 49 | InfoForm.InfoHelper.CustomMessageBox.Show("Error", "Not logged."); 50 | } 51 | } 52 | 53 | private void combox_states_SelectedIndexChanged(object sender, EventArgs e) 54 | { 55 | 56 | } 57 | 58 | private void combox_uimodes_SelectedIndexChanged(object sender, EventArgs e) 59 | { 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /MercuryBOT/AccSettings/AddAcc.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.Helpers; 11 | using MercuryBOT.UserSettings; 12 | using Newtonsoft.Json; 13 | using System; 14 | using System.Collections.Generic; 15 | using System.Diagnostics; 16 | using System.IO; 17 | using System.Windows.Forms; 18 | using Win32Interop.Methods; 19 | using System.Drawing; 20 | 21 | namespace MercuryBOT 22 | { 23 | public partial class AddAcc : MetroFramework.Forms.MetroForm 24 | { 25 | public AddAcc() 26 | { 27 | InitializeComponent(); this.Activate(); 28 | this.components.SetStyle(this); 29 | this.FormBorderStyle = FormBorderStyle.None; 30 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 31 | 32 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, btn_addAcc.Width, btn_addAcc.Height, 5, 5); 33 | btn_addAcc.Region = Region.FromHrgn(ptr); 34 | Gdi32.DeleteObject(ptr); 35 | 36 | 37 | } 38 | private void btn_addAcc_Click(object sender, EventArgs e) 39 | { 40 | AddAccJson(txtBox_adminID.Text, txtBox_AccUser.Text, txtBox_AccPW.Text); 41 | } 42 | 43 | public void AddAccJson(string Admin, string user, string password) 44 | { 45 | try 46 | { 47 | var list = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 48 | foreach (var a in list.Accounts) 49 | { 50 | if (a.username == user) 51 | { 52 | InfoForm.InfoHelper.CustomMessageBox.Show("Alert", "Duplicate username found!"); 53 | return; 54 | } 55 | } 56 | 57 | ulong UserSteamID = 0; 58 | ulong AdminConverted = 0; 59 | //if (Admin == "") 60 | if (string.IsNullOrEmpty(Admin)) 61 | { 62 | AdminConverted = 0; 63 | } 64 | else 65 | { 66 | AdminConverted = Convert.ToUInt64(Admin); 67 | } 68 | 69 | list.Accounts.Add(new UserAccounts 70 | { 71 | AdminID = AdminConverted, 72 | LoginState = 1, 73 | username = user, 74 | password = password, 75 | APIWebKey = "",//0 76 | SteamID = UserSteamID, 77 | ChatLogger = false, 78 | Games = new List(), 79 | AFKMessages = new List(), 80 | MsgRecipients = new List() 81 | 82 | }); 83 | 84 | var convertedJson = JsonConvert.SerializeObject(list, new JsonSerializerSettings 85 | { 86 | DefaultValueHandling = DefaultValueHandling.Populate, 87 | Formatting = Formatting.Indented 88 | }); 89 | 90 | File.WriteAllText(Program.AccountsJsonFile, convertedJson); 91 | Close(); 92 | } 93 | catch 94 | { 95 | // log error 96 | } 97 | } 98 | 99 | #region link2json 100 | private void metroLink_AccountsJSONPath_Click(object sender, EventArgs e) 101 | { 102 | Process.Start(Program.AccountsJsonFile); 103 | } 104 | #endregion 105 | 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /MercuryBOT/AccSettings/EditAcc.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.Helpers; 11 | using MercuryBOT.User2Json; 12 | using MercuryBOT.UserSettings; 13 | using Newtonsoft.Json; 14 | using System; 15 | using System.Diagnostics; 16 | using System.IO; 17 | using System.Windows.Forms; 18 | using Win32Interop.Methods; 19 | using System.Drawing; 20 | using System.Linq; 21 | 22 | namespace MercuryBOT 23 | { 24 | public partial class EditAcc : MetroFramework.Forms.MetroForm 25 | { 26 | public EditAcc() 27 | { 28 | InitializeComponent(); 29 | this.Activate(); 30 | this.components.SetStyle(this); 31 | this.FormBorderStyle = FormBorderStyle.None; 32 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 33 | 34 | foreach (var button in this.Controls.OfType()) 35 | { 36 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, button.Width, button.Height, 5, 5); 37 | button.Region = Region.FromHrgn(ptr); 38 | Gdi32.DeleteObject(ptr); 39 | } 40 | } 41 | 42 | private void EditAcc_Load(object sender, EventArgs e) 43 | { 44 | EditSelected(Main.SelectedUser); 45 | //combox_defaultState.SelectedIndex = 1; ver se tem numero antes 46 | } 47 | private ulong selectedSteamID = 0; 48 | public void EditSelected(string user) 49 | { 50 | var list = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 51 | foreach (var a in list.Accounts) 52 | { 53 | if (a.username == user) 54 | { 55 | txtBox_adminID.Text = (a.AdminID).ToString(); 56 | combox_defaultState.SelectedIndex = a.LoginState; 57 | txtBox_user.Text = a.username; 58 | txtBox_pw.Text = a.password; 59 | txtBox_webapi.Text = a.APIWebKey; 60 | selectedSteamID = a.SteamID; 61 | toggle_chatLogger.Checked = a.ChatLogger; 62 | } 63 | } 64 | 65 | var SettingsList = JsonConvert.DeserializeObject(File.ReadAllText(Program.SettingsJsonFile)); 66 | 67 | 68 | if (SettingsList.startupAcc == selectedSteamID && SettingsList.startupAcc.ToString().Length > 0) 69 | { 70 | toggle_autoLogin.Enabled = true; 71 | toggle_autoLogin.Checked = true; 72 | 73 | } 74 | if (SettingsList.startupAcc != 0 && SettingsList.startupAcc != selectedSteamID) 75 | { 76 | toggle_autoLogin.Enabled = false; 77 | } 78 | 79 | if (selectedSteamID == 0) 80 | { 81 | toggle_autoLogin.Enabled = false; 82 | toggle_autoLogin.Checked = false; // added 83 | } 84 | 85 | } 86 | 87 | private void BTN_SUBMIT_Click(object sender, EventArgs e) 88 | { 89 | ulong IDConverted; 90 | switch (txtBox_adminID.Text) 91 | { 92 | case "": 93 | IDConverted = 0; 94 | break; 95 | default: 96 | IDConverted = Convert.ToUInt64(txtBox_adminID.Text); 97 | break; 98 | } 99 | 100 | var list = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 101 | foreach (var a in list.Accounts) 102 | { 103 | if (a.username == txtBox_user.Text) 104 | { 105 | a.AdminID = IDConverted; 106 | a.LoginState = combox_defaultState.SelectedIndex; 107 | a.password = txtBox_pw.Text; 108 | a.APIWebKey = txtBox_webapi.Text; 109 | a.ChatLogger = toggle_chatLogger.Checked; 110 | } 111 | } 112 | File.WriteAllText(Program.AccountsJsonFile, JsonConvert.SerializeObject(list, Formatting.Indented)); 113 | 114 | var SettingsList = JsonConvert.DeserializeObject(File.ReadAllText(Program.SettingsJsonFile)); 115 | 116 | if (!toggle_autoLogin.Checked){ 117 | SettingsList.startupAcc = 0; 118 | }else{ 119 | SettingsList.startupAcc = selectedSteamID; 120 | } 121 | File.WriteAllText(Program.SettingsJsonFile, JsonConvert.SerializeObject(SettingsList, Formatting.Indented)); 122 | Close(); 123 | } 124 | 125 | private void MetroLink_AccountsJSONPath_Click(object sender, EventArgs e) 126 | { 127 | Process.Start(Program.AccountsJsonFile); 128 | } 129 | 130 | private void btn_deleteAcc_Click(object sender, EventArgs e) 131 | { 132 | var list = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 133 | 134 | list.Accounts.RemoveAll(x => x.username == Main.SelectedUser); 135 | File.Delete(Program.SentryFolder + @"\" + Main.SelectedUser +".bin"); 136 | 137 | File.WriteAllText(Program.AccountsJsonFile, JsonConvert.SerializeObject(list, Formatting.Indented)); 138 | Close(); 139 | Notification.NotifHelper.MessageBox.Show("Info", " Removed " + Main.SelectedUser + " from file."); 140 | } 141 | 142 | private void link_webapi_Click(object sender, EventArgs e) 143 | { 144 | Process.Start("https://steamcommunity.com/dev/apikey"); 145 | } 146 | } 147 | } -------------------------------------------------------------------------------- /MercuryBOT/CallbackMessages/PurchaseResponseCallback.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using SteamKit2; 11 | using SteamKit2.Internal; 12 | using System.Collections.Generic; 13 | using System.IO; 14 | using System.Net; 15 | 16 | namespace MercuryBOT.CallbackMessages 17 | { 18 | //Thanks to Paul "Xetas" Abramov 19 | public class PurchaseResponseCallback : CallbackMsg 20 | { 21 | public Dictionary m_Items = new Dictionary(); 22 | 23 | 24 | public EPurchaseResultDetail m_PurchaseResultDetail; 25 | public EResult m_Result; 26 | 27 | public PurchaseResponseCallback(JobID _jobID, CMsgClientPurchaseResponse _clientPurchaseMessage) 28 | { 29 | JobID = _jobID; 30 | m_PurchaseResultDetail = (EPurchaseResultDetail)_clientPurchaseMessage.purchase_result_details; 31 | m_Result = (EResult)_clientPurchaseMessage.eresult; 32 | 33 | KeyValue receiptInfo = new KeyValue(); 34 | using (MemoryStream memoryStream = new MemoryStream(_clientPurchaseMessage.purchase_receipt_info)) 35 | { 36 | if (!receiptInfo.TryReadAsBinary(memoryStream)) 37 | { 38 | return; 39 | } 40 | } 41 | 42 | List lineItems = receiptInfo["lineitems"].Children; 43 | 44 | foreach (KeyValue lineItem in lineItems) 45 | { 46 | uint packageID = lineItem["PackageID"].AsUnsignedInteger(); 47 | if (packageID == 0) 48 | { 49 | packageID = lineItem["ItemAppID"].AsUnsignedInteger(); 50 | if (packageID == 0) 51 | { 52 | return; 53 | } 54 | } 55 | 56 | string gameName = lineItem["ItemDescription"].Value; 57 | if (string.IsNullOrEmpty(gameName)) 58 | { 59 | return; 60 | } 61 | 62 | gameName = WebUtility.HtmlDecode(gameName); 63 | m_Items[packageID] = gameName; 64 | } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /MercuryBOT/CustomAFKMessage/CustomAFKMessages.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using Mercury; 11 | using MercuryBOT.Helpers; 12 | using MercuryBOT.UserSettings; 13 | using MetroFramework.Controls; 14 | using Newtonsoft.Json; 15 | using System; 16 | using System.Drawing; 17 | using System.IO; 18 | using System.Linq; 19 | using System.Windows.Forms; 20 | using Win32Interop.Methods; 21 | 22 | namespace MercuryBOT.CustomMessages 23 | { 24 | public partial class AFKMessages : MetroFramework.Forms.MetroForm 25 | { 26 | public static string SelectedMsg = ""; 27 | 28 | 29 | public AFKMessages() 30 | { 31 | InitializeComponent(); 32 | this.components.SetStyle(this); 33 | this.FormBorderStyle = FormBorderStyle.None; 34 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 35 | foreach (var button in this.Controls.OfType()) 36 | { 37 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, button.Width, button.Height, 5, 5); 38 | button.Region = Region.FromHrgn(ptr); 39 | Gdi32.DeleteObject(ptr); 40 | } 41 | } 42 | 43 | 44 | public void AddMessage2File() 45 | { 46 | if (HandleLogin.IsLoggedIn == true && txtBox_customMSG.Text.Length != 0) 47 | { 48 | 49 | var ListsMessages = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 50 | foreach (var UserList in ListsMessages.Accounts) 51 | { 52 | if (UserList.username == HandleLogin.CurrentUsername) 53 | { 54 | for (int i = 0; i < UserList.AFKMessages.Count; i++) 55 | { 56 | if (UserList.AFKMessages[i].Message == txtBox_customMSG.Text) 57 | { 58 | InfoForm.InfoHelper.CustomMessageBox.Show("Error", "Dont duplicate, Mercury dont like it :c"); 59 | txtBox_customMSG.Clear(); 60 | return; 61 | } 62 | } 63 | UserSettings.CustomMessages NewMessage = new UserSettings.CustomMessages { Message = txtBox_customMSG.Text }; 64 | UserList.AFKMessages.Add(NewMessage); 65 | 66 | } 67 | } 68 | 69 | File.WriteAllText(Program.AccountsJsonFile, JsonConvert.SerializeObject(ListsMessages, Formatting.Indented)); 70 | 71 | // listview_customMsgs.Items.Add(txtBox_customMSG.Text); 72 | SavedMsgs_Grid.Rows.Add(txtBox_customMSG.Text); 73 | txtBox_customMSG.Clear(); 74 | 75 | } 76 | else 77 | { 78 | InfoForm.InfoHelper.CustomMessageBox.Show("Error", "Not logged! or Message too short"); 79 | } 80 | } 81 | public void RemoveMessage4romFile() 82 | { 83 | if (SelectedMsg != "") 84 | { 85 | var ListsMessages = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 86 | foreach (var UserList in ListsMessages.Accounts) 87 | { 88 | if (UserList.username == HandleLogin.CurrentUsername) 89 | { 90 | for (int i = 0; i < UserList.AFKMessages.Count; i++) 91 | { 92 | if (UserList.AFKMessages[i] == UserList.AFKMessages[SavedMsgs_Grid.SelectedRows[0].Cells[0].RowIndex]) 93 | { 94 | UserList.AFKMessages.Remove(UserList.AFKMessages[i]); 95 | SavedMsgs_Grid.Rows.RemoveAt(SavedMsgs_Grid.SelectedRows[0].Cells[0].RowIndex); 96 | } 97 | } 98 | } 99 | } 100 | File.WriteAllText(Program.AccountsJsonFile, JsonConvert.SerializeObject(ListsMessages, Formatting.Indented)); 101 | } 102 | else 103 | { 104 | InfoForm.InfoHelper.CustomMessageBox.Show("Error", "No message selected!"); 105 | } 106 | } 107 | 108 | 109 | private void Btn_addMessage2json_Click(object sender, EventArgs e) 110 | { 111 | AddMessage2File(); 112 | } 113 | 114 | private void AFKMessages_Load(object sender, EventArgs e) 115 | { 116 | if (HandleLogin.IsLoggedIn == true) 117 | { 118 | var ListsMessages = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 119 | foreach (var UserList in ListsMessages.Accounts) 120 | { 121 | if (UserList.username == HandleLogin.CurrentUsername) 122 | { 123 | for (int i = 0; i < UserList.AFKMessages.Count; i++) 124 | { 125 | SavedMsgs_Grid.Rows.Add(UserList.AFKMessages[i].Message); 126 | } 127 | } 128 | } 129 | SavedMsgs_Grid.ClearSelection(); 130 | } 131 | else 132 | { 133 | InfoForm.InfoHelper.CustomMessageBox.Show("Error", "Not logged!"); 134 | } 135 | } 136 | 137 | private void Btn_deleteSelected_Click(object sender, EventArgs e) 138 | { 139 | RemoveMessage4romFile(); 140 | } 141 | 142 | private void SavedMsgs_ScrollBar_Scroll(object sender, ScrollEventArgs e) 143 | { 144 | if (e.NewValue >= SavedMsgs_Grid.Rows.Count) 145 | { 146 | return; 147 | } 148 | SavedMsgs_Grid.FirstDisplayedScrollingRowIndex = e.NewValue; 149 | } 150 | 151 | private void SavedMsgs_Grid_CellClick(object sender, DataGridViewCellEventArgs e) 152 | { 153 | SelectedMsg = SavedMsgs_Grid.SelectedRows[0].Cells[0].Value.ToString(); 154 | lbl_selectedMessage.Text = "Selected: " + SelectedMsg; 155 | } 156 | 157 | private void txtBox_customMSG_KeyDown(object sender, KeyEventArgs e) 158 | { 159 | if (Keys.Enter == e.KeyCode) 160 | { 161 | AddMessage2File(); 162 | } 163 | if (Keys.Delete == e.KeyCode) 164 | { 165 | RemoveMessage4romFile(); 166 | } 167 | 168 | } 169 | } 170 | } -------------------------------------------------------------------------------- /MercuryBOT/CustomHandlers/GamesHandler.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.CallbackMessages; 11 | using SteamKit2; 12 | using SteamKit2.Internal; 13 | using System; 14 | using System.Linq; 15 | using System.Threading.Tasks; 16 | 17 | namespace MercuryBOT.CustomHandlers 18 | { 19 | //Thanks to Paul "Xetas" Abramov 20 | public class GamesHandler : ClientMsgHandler 21 | { 22 | public override void HandleMsg(IPacketMsg _packetMsg) 23 | { 24 | switch (_packetMsg.MsgType) 25 | { 26 | case EMsg.ClientPurchaseResponse: 27 | HandlePurchaseResponse(_packetMsg); 28 | break; 29 | } 30 | } 31 | 32 | #region PlayGames 33 | 34 | public void SetGamePlayingNormal2(uint _gameID, string _game)//ver 35 | { 36 | ClientMsgProtobuf gamePlaying = new ClientMsgProtobuf(EMsg.ClientGamesPlayed); 37 | 38 | CMsgClientGamesPlayed.GamePlayed teste = new CMsgClientGamesPlayed.GamePlayed(); 39 | GameID game_id = new GameID(_gameID); 40 | 41 | if (_game.Length < 1)//nao 42 | { 43 | // gamePlaying.Body.games_played.Add(); 44 | gamePlaying.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = new GameID(_gameID) }); 45 | }else{ 46 | gamePlaying.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = 12350489788975939584, game_extra_info = _game }); 47 | } 48 | 49 | 50 | Client.Send(gamePlaying); 51 | } 52 | 53 | 54 | public void SetGamePlayingNormal(uint _gameID) 55 | { 56 | ClientMsgProtobuf gamePlaying = new ClientMsgProtobuf(EMsg.ClientGamesPlayed); 57 | 58 | gamePlaying.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = new GameID(_gameID) }); 59 | 60 | Client.Send(gamePlaying); 61 | } 62 | 63 | public void SetGamePlayingNONSteam(string _game) 64 | { 65 | ClientMsgProtobuf gamePlaying = new ClientMsgProtobuf(EMsg.ClientGamesPlayedWithDataBlob);// EMsg.ClientGamesPlayed 66 | gamePlaying.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = 12350489788975939584, game_extra_info = _game }); 67 | Client.Send(gamePlaying); 68 | 69 | } 70 | 71 | public void StopPlayingGames() 72 | { 73 | ClientMsgProtobuf request = new ClientMsgProtobuf(EMsg.ClientGamesPlayed); 74 | request.Body.games_played.Add(new CMsgClientGamesPlayed.GamePlayed { game_id = new GameID(0) }); 75 | Client.Send(request); 76 | } 77 | #endregion 78 | 79 | public async Task RedeemKey(string _keyToActivate) 80 | { 81 | ClientMsgProtobuf registerKey = new ClientMsgProtobuf(EMsg.ClientRegisterKey) 82 | { 83 | SourceJobID = Client.GetNextJobID() 84 | }; 85 | 86 | registerKey.Body.key = _keyToActivate; 87 | 88 | Client.Send(registerKey); 89 | 90 | try 91 | { 92 | return await new AsyncJob(Client, registerKey.SourceJobID); 93 | } 94 | catch (Exception e) 95 | { 96 | Console.WriteLine(e); 97 | return null; 98 | } 99 | } 100 | 101 | 102 | public async Task RedeemKeyResponse(string _keyToActivate) 103 | { 104 | PurchaseResponseCallback activatedResponse = await RedeemKey(_keyToActivate).ConfigureAwait(false); 105 | 106 | return $"Status: {activatedResponse.m_Result}/{activatedResponse.m_PurchaseResultDetail}, {string.Join(",", activatedResponse.m_Items.Select(_key => $"Key: [ {_keyToActivate} ] Game: [ {_key.Key}/{_key.Value} ]").ToArray())}"; 107 | } 108 | 109 | 110 | private void HandlePurchaseResponse(IPacketMsg _packetMsg) 111 | { 112 | if (_packetMsg == null) 113 | { 114 | return; 115 | } 116 | 117 | ClientMsgProtobuf response = new ClientMsgProtobuf(_packetMsg); 118 | Client.PostCallback(new PurchaseResponseCallback(_packetMsg.TargetJobID, response.Body)); 119 | } 120 | } 121 | } -------------------------------------------------------------------------------- /MercuryBOT/DeviceAuth.cs: -------------------------------------------------------------------------------- 1 | using SteamKit2.Authentication; 2 | using SteamKit2.Internal; 3 | using System.Threading.Tasks; 4 | 5 | 6 | namespace Mercury 7 | { 8 | public class DeviceAuth : IAuthenticator 9 | { 10 | 11 | public Task GetDeviceCodeAsync(bool previousCodeWasIncorrect) 12 | { 13 | MercuryBOT.SteamGuard SteamGuard = new MercuryBOT.SteamGuard("Phone", HandleLogin.CurrentUsername, previousCodeWasIncorrect); 14 | SteamGuard.ShowDialog(); 15 | 16 | bool UserInputCode = true; 17 | while (UserInputCode) 18 | { 19 | if (MercuryBOT.SteamGuard.AuthCode.Length == 5) 20 | { 21 | UserInputCode = false; 22 | } 23 | } 24 | 25 | 26 | return Task.FromResult(MercuryBOT.SteamGuard.AuthCode.Trim()); 27 | } 28 | 29 | public Task GetEmailCodeAsync(string email, bool previousCodeWasIncorrect) 30 | { 31 | MercuryBOT.SteamGuard SteamGuard = new MercuryBOT.SteamGuard("Email", HandleLogin.CurrentUsername, previousCodeWasIncorrect);// add user name 32 | SteamGuard.ShowDialog(); 33 | 34 | bool UserInputCode = true; 35 | while (UserInputCode) 36 | { 37 | if (MercuryBOT.SteamGuard.AuthCode.Length == 5) // Wait for user input 38 | { 39 | UserInputCode = false; 40 | } 41 | } 42 | 43 | return Task.FromResult(MercuryBOT.SteamGuard.AuthCode); 44 | } 45 | 46 | public Task AcceptDeviceConfirmationAsync() 47 | { 48 | //InfoForm.InfoHelper.CustomMessageBox.Show("🔒 Steam Guard", "Please accept the device confirmation request on Steam Mobile App."); 49 | 50 | return Task.FromResult(false);//false to force 2fa code 51 | } 52 | 53 | public EAuthSessionGuardType NeedGuardType() 54 | { 55 | return EAuthSessionGuardType.k_EAuthSessionGuardType_DeviceConfirmation; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /MercuryBOT/FriendsList/Chat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace MercuryBOT.FriendsList 12 | { 13 | public partial class Chat : MetroFramework.Forms.MetroForm 14 | { 15 | 16 | 17 | public Chat() 18 | { 19 | InitializeComponent(); 20 | 21 | 22 | } 23 | 24 | private void Chat_Load(object sender, EventArgs e) 25 | { 26 | //chat_friendAvatar.Background 27 | 28 | //chat_Messages.Text 29 | //chat_UserMessage.Text 30 | //btn_chatSendMessage 31 | //chat_ScrollBar 32 | 33 | } 34 | private void chat_ScrollBar_Scroll(object sender, ScrollEventArgs e) 35 | { 36 | if (e.NewValue >= chat_Messages.Lines.Count()) 37 | { 38 | return; 39 | } 40 | chat_Messages.TabIndex = e.NewValue; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /MercuryBOT/FriendsList/Chat.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /MercuryBOT/FriendsList/FriendsRequests.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Linq; 13 | 14 | namespace MercuryBOT.FriendsList 15 | { 16 | //Thanks to https://github.com/waylaidwanderer/Mist 17 | internal class ListFriendRequests 18 | { 19 | private static List list = new List(); 20 | private string name; 21 | private ulong sid; 22 | private string status; 23 | 24 | 25 | public ListFriendRequests(string name, ulong sid, string status = "Offline") 26 | { 27 | this.name = name; 28 | this.sid = sid; 29 | this.status = status; 30 | } 31 | 32 | public string Name 33 | { 34 | get 35 | { 36 | return this.name; 37 | } 38 | set 39 | { 40 | this.name = value; 41 | } 42 | } 43 | 44 | public ulong SteamID 45 | { 46 | get 47 | { 48 | return this.sid; 49 | } 50 | set 51 | { 52 | this.sid = value; 53 | } 54 | } 55 | 56 | public string Status 57 | { 58 | get 59 | { 60 | return this.status; 61 | } 62 | set 63 | { 64 | this.status = value; 65 | } 66 | } 67 | 68 | public static void Add(string name, ulong sid, string status = "Offline") 69 | { 70 | ListFriendRequests listFriendRequests = new ListFriendRequests(name, sid, status); 71 | ListFriendRequests.list.Add(listFriendRequests); 72 | } 73 | 74 | public static void Remove(ulong sid) 75 | { 76 | ListFriendRequests listFriendRequests = ListFriendRequests.list.Find((Predicate)(x => (long)x.sid == (long)sid)); 77 | ListFriendRequests.list.Remove(listFriendRequests); 78 | } 79 | 80 | public static void Clear() 81 | { 82 | ListFriendRequests.list.Clear(); 83 | } 84 | 85 | public static void UpdateStatus(ulong sid, string status) 86 | { 87 | try 88 | { 89 | ListFriendRequests.list.Find((Predicate)(x => (long)x.SteamID == (long)sid)).Status = status; 90 | } 91 | catch 92 | { 93 | } 94 | } 95 | 96 | public static bool Find(ulong sid) 97 | { 98 | return ListFriendRequests.list.Any((Func)(x => (long)x.SteamID == (long)sid)); 99 | } 100 | 101 | public static ulong GetSID(string name) 102 | { 103 | try 104 | { 105 | return ListFriendRequests.list.Find((Predicate)(x => x.name == name)).sid; 106 | } 107 | catch 108 | { 109 | } 110 | return 0; 111 | } 112 | 113 | internal static List Get() 114 | { 115 | List listFriendRequestsList = new List(); 116 | foreach (ListFriendRequests listFriendRequests in ListFriendRequests.list) 117 | { 118 | if (listFriendRequests.status.ToString() == "Online") 119 | listFriendRequestsList.Add(listFriendRequests); 120 | } 121 | foreach (ListFriendRequests listFriendRequests in ListFriendRequests.list) 122 | { 123 | if (listFriendRequests.status.ToString() == "LookingToTrade") 124 | listFriendRequestsList.Add(listFriendRequests); 125 | } 126 | foreach (ListFriendRequests listFriendRequests in ListFriendRequests.list) 127 | { 128 | if (listFriendRequests.status.ToString() == "LookingToPlay") 129 | listFriendRequestsList.Add(listFriendRequests); 130 | } 131 | foreach (ListFriendRequests listFriendRequests in ListFriendRequests.list) 132 | { 133 | if (listFriendRequests.status.ToString() == "Busy") 134 | listFriendRequestsList.Add(listFriendRequests); 135 | } 136 | foreach (ListFriendRequests listFriendRequests in ListFriendRequests.list) 137 | { 138 | if (listFriendRequests.status.ToString() == "Away") 139 | listFriendRequestsList.Add(listFriendRequests); 140 | } 141 | foreach (ListFriendRequests listFriendRequests in ListFriendRequests.list) 142 | { 143 | if (listFriendRequests.status.ToString() == "Snooze") 144 | listFriendRequestsList.Add(listFriendRequests); 145 | } 146 | foreach (ListFriendRequests listFriendRequests in ListFriendRequests.list) 147 | { 148 | if (listFriendRequests.status.ToString() == "Offline") 149 | listFriendRequestsList.Add(listFriendRequests); 150 | } 151 | return listFriendRequestsList; 152 | } 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /MercuryBOT/FriendsList/MsgRecipients.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.UserSettings; 11 | using Newtonsoft.Json; 12 | using System; 13 | using System.Drawing; 14 | using System.Linq; 15 | using System.IO; 16 | using System.Windows.Forms; 17 | using MercuryBOT.Helpers; 18 | using Win32Interop.Methods; 19 | using Mercury; 20 | 21 | namespace MercuryBOT.FriendsList 22 | { 23 | public partial class MsgRecipients : MetroFramework.Forms.MetroForm 24 | { 25 | public MsgRecipients() 26 | { 27 | InitializeComponent(); 28 | this.components.SetStyle(this); 29 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 30 | foreach (var button in this.Controls.OfType()) 31 | { 32 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, button.Width, button.Height, 5, 5); 33 | button.Region = Region.FromHrgn(ptr); 34 | Gdi32.DeleteObject(ptr); 35 | } 36 | } 37 | private void FriendsMsgReceiver_Load(object sender, EventArgs e) 38 | { 39 | RefreshRecipients(); 40 | } 41 | private void btn_saveFriends_Click(object sender, EventArgs e) 42 | { 43 | var list = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 44 | 45 | foreach (var a in list.Accounts) 46 | { 47 | if (a.username == HandleLogin.CurrentUsername) 48 | { 49 | foreach (DataGridViewRow row in FriendsList_Grid.Rows) 50 | { 51 | if (Convert.ToBoolean(row.Cells[2].Value) == true && a.MsgRecipients.Any(s => s.Contains(row.Cells[0].Value.ToString())) == false) 52 | { 53 | a.MsgRecipients.Add(row.Cells[0].Value.ToString()); 54 | } 55 | 56 | if (Convert.ToBoolean(row.Cells[2].Value) == false) 57 | { 58 | a.MsgRecipients.Remove(row.Cells[0].Value.ToString()); 59 | 60 | } 61 | } 62 | } 63 | } 64 | File.WriteAllText(Program.AccountsJsonFile, JsonConvert.SerializeObject(list, Formatting.Indented)); 65 | InfoForm.InfoHelper.CustomMessageBox.Show("Info", "Saved"); 66 | Close(); 67 | } 68 | 69 | public void RefreshRecipients() 70 | { 71 | FriendsList_Grid.Rows.Clear(); 72 | foreach (var f in HandleLogin.Friends) 73 | { 74 | var Name = HandleLogin.steamFriends.GetFriendPersonaName(f.ConvertToUInt64()); 75 | 76 | var list = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 77 | bool ui = false; 78 | foreach (var a in list.Accounts) 79 | { 80 | if (a.username == HandleLogin.CurrentUsername) 81 | { 82 | if(a.MsgRecipients == null) 83 | { 84 | 85 | } 86 | if (a.MsgRecipients.Any(s => s.Contains(f.ConvertToUInt64().ToString()))) 87 | { 88 | ui = true; 89 | } 90 | } 91 | } 92 | 93 | string[] row = { f.ConvertToUInt64().ToString(), Name, ui.ToString() }; 94 | FriendsList_Grid.Rows.Add(row); 95 | } 96 | } 97 | 98 | private void FriendsList_ScrollBar_Scroll(object sender, ScrollEventArgs e) 99 | { 100 | if (e.NewValue >= FriendsList_Grid.Rows.Count) 101 | { 102 | return; 103 | } 104 | FriendsList_Grid.FirstDisplayedScrollingRowIndex = e.NewValue; 105 | } 106 | } 107 | } -------------------------------------------------------------------------------- /MercuryBOT/Games/IdleSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MercuryBOT.Games 4 | { 5 | public partial class IdleSettings : MetroFramework.Forms.MetroForm 6 | { 7 | public IdleSettings() 8 | { 9 | InitializeComponent(); 10 | } 11 | 12 | private void IdleSettings_Load(object sender, EventArgs e) 13 | { 14 | 15 | } 16 | 17 | private void metroLabel6_Click(object sender, EventArgs e) 18 | { 19 | 20 | } 21 | 22 | private void metroTextBox2_Click(object sender, EventArgs e) 23 | { 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MercuryBOT/Games/IdleSettings.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /MercuryBOT/Helpers/CookieAwareWebClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Mercury.Helpers 9 | { 10 | public class CookieAwareWebClient : WebClient 11 | { 12 | public CookieContainer CookieContainer { get; set; } = new CookieContainer(); 13 | public CookieCollection ResponseCookies { get; set; } = new CookieCollection(); 14 | 15 | protected override WebRequest GetWebRequest(Uri address) 16 | { 17 | var request = (HttpWebRequest)base.GetWebRequest(address); 18 | request.CookieContainer = CookieContainer; 19 | return request; 20 | } 21 | 22 | protected override WebResponse GetWebResponse(WebRequest request) 23 | { 24 | var response = (HttpWebResponse)base.GetWebResponse(request); 25 | this.ResponseCookies = response.Cookies; 26 | return response; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /MercuryBOT/Helpers/HtmlTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace MercuryBOT.Helpers 5 | { 6 | public static class Html 7 | { 8 | public class Table : HtmlBase, IDisposable 9 | { 10 | public Table(StringBuilder sb, string classAttributes = "", string id = "") : base(sb) 11 | { 12 | Append(""); 13 | } 14 | 15 | public void StartHead(string classAttributes = "", string id = "") 16 | { 17 | Append(""); 18 | } 19 | 20 | public void EndHead() 21 | { 22 | Append(""); 23 | } 24 | 25 | public void StartFoot(string classAttributes = "", string id = "") 26 | { 27 | Append(""); 28 | } 29 | 30 | public void EndFoot() 31 | { 32 | Append(""); 33 | } 34 | 35 | public void StartBody(string classAttributes = "", string id = "") 36 | { 37 | Append(""); 38 | } 39 | 40 | public void EndBody() 41 | { 42 | Append(""); 43 | } 44 | 45 | public void Dispose() 46 | { 47 | Append("
"); 48 | } 49 | 50 | public Row AddRow(string classAttributes = "", string id = "") 51 | { 52 | return new Row(GetBuilder(), classAttributes, id); 53 | } 54 | } 55 | 56 | public class Row : HtmlBase, IDisposable 57 | { 58 | public Row(StringBuilder sb, string classAttributes = "", string id = "") : base(sb) 59 | { 60 | Append(""); 61 | } 62 | public void Dispose() 63 | { 64 | Append(""); 65 | } 66 | public void AddCell(string innerText, string classAttributes = "", string id = "", string colSpan = "") 67 | { 68 | Append(""); 69 | Append(innerText); 70 | Append(""); 71 | } 72 | } 73 | 74 | public abstract class HtmlBase 75 | { 76 | private StringBuilder _sb; 77 | 78 | protected HtmlBase(StringBuilder sb) 79 | { 80 | _sb = sb; 81 | } 82 | 83 | public StringBuilder GetBuilder() 84 | { 85 | return _sb; 86 | } 87 | 88 | protected void Append(string toAppend) 89 | { 90 | _sb.Append(toAppend); 91 | } 92 | } 93 | } 94 | } -------------------------------------------------------------------------------- /MercuryBOT/Helpers/SessionData.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Specialized; 4 | using System.Linq; 5 | using System.Net; 6 | using System.Threading.Tasks; 7 | 8 | namespace Mercury.Helpers 9 | { 10 | public class SessionData 11 | { 12 | public static ulong SteamID { get; set; } 13 | 14 | public static string AccessToken { get; set; } 15 | 16 | public static string RefreshToken { get; set; } 17 | 18 | public static string SessionID { get; set; } 19 | 20 | public static async Task RefreshAccessToken() 21 | { 22 | if (string.IsNullOrEmpty(RefreshToken)) 23 | throw new Exception("Refresh token is empty"); 24 | 25 | if (IsTokenExpired(RefreshToken)) 26 | throw new Exception("Refresh token is expired"); 27 | 28 | string responseStr; 29 | try 30 | { 31 | var postData = new NameValueCollection(); 32 | postData.Add("refresh_token", RefreshToken); 33 | postData.Add("steamid", SteamID.ToString()); 34 | responseStr = await SteamWeb.POSTRequest("https://api.steampowered.com/IAuthenticationService/GenerateAccessTokenForApp/v1/", null, postData); 35 | } 36 | catch (Exception ex) 37 | { 38 | throw new Exception("Failed to refresh token: " + ex.Message); 39 | } 40 | 41 | var response = JsonConvert.DeserializeObject(responseStr); 42 | AccessToken = response.Response.AccessToken; 43 | } 44 | 45 | public static bool IsAccessTokenExpired() 46 | { 47 | if (string.IsNullOrEmpty(AccessToken)) 48 | return true; 49 | 50 | return IsTokenExpired(AccessToken); 51 | } 52 | 53 | public static bool IsRefreshTokenExpired() 54 | { 55 | if (string.IsNullOrEmpty(RefreshToken)) 56 | return true; 57 | 58 | return IsTokenExpired(RefreshToken); 59 | } 60 | 61 | private static bool IsTokenExpired(string token) 62 | { 63 | var tokenComponents = token.Split('.'); 64 | // Fix up base64url to normal base64 65 | var base64 = tokenComponents[1].Replace('-', '+').Replace('_', '/'); 66 | 67 | if (base64.Length % 4 != 0) 68 | { 69 | base64 += new string('=', 4 - base64.Length % 4); 70 | } 71 | 72 | var payloadBytes = Convert.FromBase64String(base64); 73 | var jwt = JsonConvert.DeserializeObject(System.Text.Encoding.UTF8.GetString(payloadBytes)); 74 | 75 | // Compare expire time of the token to the current time 76 | return DateTimeOffset.UtcNow.ToUnixTimeSeconds() > jwt.exp; 77 | } 78 | 79 | public static CookieContainer GetCookies() 80 | { 81 | if (SessionID == null) 82 | SessionID = GenerateSessionID(); 83 | 84 | var cookies = new CookieContainer(); 85 | foreach (string domain in new string[] { "steamcommunity.com" , "store.steampowered.com", "help.steampowered.com" }) 86 | { 87 | cookies.Add(new Cookie("steamLoginSecure", GetSteamLoginSecure(), "/", domain)); 88 | cookies.Add(new Cookie("sessionid", SessionID, "/", domain)); 89 | // cookies.Add(new Cookie("Steam_Language", "english", "/", domain)); 90 | } 91 | return cookies; 92 | } 93 | 94 | public static string GetSteamLoginSecure() 95 | { 96 | if (AccessToken.Length > 0) 97 | { 98 | return SteamID.ToString() + "%7C%7C" + AccessToken; 99 | } 100 | else 101 | { 102 | return null; 103 | } 104 | } 105 | 106 | private static string GenerateSessionID() 107 | { 108 | return GetRandomHexNumber(24); 109 | } 110 | 111 | private static string GetRandomHexNumber(int digits) 112 | { 113 | Random random = new Random(); 114 | byte[] buffer = new byte[digits / 2]; 115 | random.NextBytes(buffer); 116 | string result = String.Concat(buffer.Select(x => x.ToString("X2")).ToArray()); 117 | if (digits % 2 == 0) 118 | return result; 119 | return result + random.Next(16).ToString("X"); 120 | } 121 | 122 | private class SteamAccessToken 123 | { 124 | public long exp { get; set; } 125 | } 126 | 127 | private class GenerateAccessTokenForAppResponse 128 | { 129 | [JsonProperty("response")] 130 | public GenerateAccessTokenForAppResponseResponse Response; 131 | } 132 | 133 | private class GenerateAccessTokenForAppResponseResponse 134 | { 135 | [JsonProperty("access_token")] 136 | public string AccessToken { get; set; } 137 | } 138 | } 139 | } -------------------------------------------------------------------------------- /MercuryBOT/Helpers/SteamWeb.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Specialized; 3 | using System.Net; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mercury.Helpers 8 | { 9 | public class SteamWeb 10 | { 11 | public static string MOBILE_APP_USER_AGENT = "Dalvik/2.1.0 (Linux; U; Android 9; Valve Steam App Version/3)"; 12 | public static string BROWSER_APP_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"; 13 | public static string http_agent = "okhttp/3.12.12"; 14 | 15 | public static async Task GETRequest(string url, CookieContainer cookies) 16 | { 17 | string response; 18 | using (CookieAwareWebClient wc = new CookieAwareWebClient()) 19 | { 20 | wc.Encoding = Encoding.UTF8; 21 | wc.CookieContainer = cookies; 22 | wc.Headers[HttpRequestHeader.UserAgent] = SteamWeb.http_agent; 23 | response = await wc.DownloadStringTaskAsync(url); 24 | } 25 | return response; 26 | } 27 | 28 | public static async Task POSTRequest(string url, CookieContainer cookies, NameValueCollection body) 29 | { 30 | if (body == null) 31 | body = new NameValueCollection(); 32 | 33 | string response; 34 | using (CookieAwareWebClient wc = new CookieAwareWebClient()) 35 | { 36 | wc.Encoding = Encoding.UTF8; 37 | wc.CookieContainer = cookies; 38 | wc.Headers[HttpRequestHeader.UserAgent] = SteamWeb.http_agent; 39 | byte[] result = await wc.UploadValuesTaskAsync(new Uri(url), "POST", body); 40 | response = Encoding.UTF8.GetString(result); 41 | } 42 | return response; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /MercuryBOT/Helpers/WebHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Specialized; 3 | using System.IO; 4 | using System.Net; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Web; 8 | 9 | namespace MercuryBOT.Helpers 10 | { 11 | class WebHelper 12 | { 13 | public CookieContainer m_CookieContainer; 14 | 15 | /// 16 | /// Get the response for the given url and data 17 | /// Using a stream and a streamreader we want to convert the response to a string so we can work with the response 18 | /// 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | public async Task GetStringFromRequest(string _url, NameValueCollection _data = null, bool _isGetMethod = true, string _referer = null) 25 | { 26 | using (HttpWebResponse response = await SendWebRequest(_url, _data, _isGetMethod, _referer).ConfigureAwait(false)) 27 | { 28 | if (response == null) 29 | { 30 | return ""; 31 | } 32 | 33 | using (Stream responseStream = response.GetResponseStream()) 34 | { 35 | if (responseStream == null) 36 | { 37 | return ""; 38 | } 39 | else 40 | { 41 | using (StreamReader reader = new StreamReader(responseStream)) 42 | { 43 | return reader.ReadToEnd(); 44 | } 45 | } 46 | } 47 | } 48 | } 49 | 50 | /// 51 | /// Parse the NameValueCollection we have passed into a string with a "&" between the data, this is the way steam wants it 52 | /// If it is a GET-Request and the datastring is not null, set a "?" between the passed url and the created datastring 53 | /// Create the request to the given URL 54 | /// Set the needed informations for the request 55 | /// If the request is a GET-Request or a POST-Request without data, start it instantly 56 | /// If the request is a POST-Request AND has data, convert the data into a stream so we can send the information via the request 57 | /// 58 | /// 59 | /// 60 | /// 61 | /// 62 | /// 63 | public async Task SendWebRequest(string _url, NameValueCollection _data = null, bool _isGetMethod = true, string _referer = null) 64 | { 65 | string dataString = _data == null ? null : string.Join("&", Array.ConvertAll(_data.AllKeys, _key => $"{HttpUtility.UrlEncode(_key)}={HttpUtility.UrlEncode(_data[_key])}")); 66 | 67 | if (_isGetMethod && !string.IsNullOrEmpty(dataString)) 68 | { 69 | _url += "?" + dataString; 70 | } 71 | 72 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(_url); 73 | 74 | request.Method = _isGetMethod ? "get" : "post"; 75 | 76 | // The Data has to be encoded, here we set the type which has to be used so we match the steam ones 77 | request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"; 78 | 79 | // Set the timeout to 50 seconds, so we do not stuck in the request 80 | request.Timeout = 50000; 81 | 82 | // Set the referer thi will be needed if we are going to accept/decline tradeoffers 83 | request.Referer = string.IsNullOrEmpty(_referer) ? "http://steamcommunity/trade/1" : _referer; 84 | 85 | // Set the cookieContainer, which holds our sessionID, steamLogin and steamLoginSecure, so steam knows we have a active session 86 | request.CookieContainer = m_CookieContainer; 87 | 88 | if (_isGetMethod || string.IsNullOrEmpty(dataString)) 89 | { 90 | return await TrySendRequest(request).ConfigureAwait(false); 91 | } 92 | else 93 | { 94 | byte[] dataBytes = Encoding.UTF8.GetBytes(dataString); 95 | request.ContentLength = dataBytes.Length; 96 | 97 | using (Stream requestStream = await request.GetRequestStreamAsync().ConfigureAwait(false)) 98 | { 99 | requestStream.Write(dataBytes, 0, dataBytes.Length); 100 | } 101 | 102 | return await TrySendRequest(request).ConfigureAwait(false); 103 | } 104 | } 105 | 106 | /// 107 | /// Beautify code 108 | /// 109 | /// Try to get a response from the request we created 110 | /// Catch any error and return it as a webresponse 111 | /// 112 | /// 113 | /// 114 | private async Task TrySendRequest(HttpWebRequest _webRequest) 115 | { 116 | try 117 | { 118 | return await _webRequest.GetResponseAsync().ConfigureAwait(false) as HttpWebResponse; 119 | } 120 | catch (WebException exception) 121 | { 122 | HttpWebResponse response = exception.Response as HttpWebResponse; 123 | if (response != null) 124 | { 125 | return response; 126 | } 127 | 128 | throw; 129 | } 130 | } 131 | } 132 | } -------------------------------------------------------------------------------- /MercuryBOT/InfoForm/Info.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MercuryBOT.InfoForm 2 | { 3 | partial class Info 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Info)); 32 | this.txtBox_info = new System.Windows.Forms.TextBox(); 33 | this.btn_okinfo = new MetroFramework.Controls.MetroButton(); 34 | this.panel1 = new System.Windows.Forms.Panel(); 35 | this.lbl_title = new MetroFramework.Controls.MetroLabel(); 36 | this.panel2 = new System.Windows.Forms.Panel(); 37 | this.SuspendLayout(); 38 | // 39 | // txtBox_info 40 | // 41 | this.txtBox_info.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); 42 | this.txtBox_info.BorderStyle = System.Windows.Forms.BorderStyle.None; 43 | this.txtBox_info.Cursor = System.Windows.Forms.Cursors.Help; 44 | this.txtBox_info.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 45 | this.txtBox_info.ForeColor = System.Drawing.Color.White; 46 | this.txtBox_info.HideSelection = false; 47 | this.txtBox_info.Location = new System.Drawing.Point(23, 54); 48 | this.txtBox_info.Multiline = true; 49 | this.txtBox_info.Name = "txtBox_info"; 50 | this.txtBox_info.ReadOnly = true; 51 | this.txtBox_info.Size = new System.Drawing.Size(275, 97); 52 | this.txtBox_info.TabIndex = 7; 53 | this.txtBox_info.TabStop = false; 54 | // 55 | // btn_okinfo 56 | // 57 | this.btn_okinfo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25))))); 58 | this.btn_okinfo.ForeColor = System.Drawing.Color.White; 59 | this.btn_okinfo.Location = new System.Drawing.Point(231, 157); 60 | this.btn_okinfo.Name = "btn_okinfo"; 61 | this.btn_okinfo.Size = new System.Drawing.Size(80, 23); 62 | this.btn_okinfo.TabIndex = 8; 63 | this.btn_okinfo.TabStop = false; 64 | this.btn_okinfo.Text = "k"; 65 | this.btn_okinfo.Theme = MetroFramework.MetroThemeStyle.Dark; 66 | this.btn_okinfo.UseCustomBackColor = true; 67 | this.btn_okinfo.UseCustomForeColor = true; 68 | this.btn_okinfo.UseSelectable = true; 69 | this.btn_okinfo.UseStyleColors = true; 70 | this.btn_okinfo.Click += new System.EventHandler(this.Btn_okinfo_Click); 71 | // 72 | // panel1 73 | // 74 | this.panel1.Location = new System.Drawing.Point(23, 25); 75 | this.panel1.Name = "panel1"; 76 | this.panel1.Size = new System.Drawing.Size(119, 23); 77 | this.panel1.TabIndex = 10; 78 | // 79 | // lbl_title 80 | // 81 | this.lbl_title.AutoSize = true; 82 | this.lbl_title.FontSize = MetroFramework.MetroLabelSize.Tall; 83 | this.lbl_title.Location = new System.Drawing.Point(23, 23); 84 | this.lbl_title.Name = "lbl_title"; 85 | this.lbl_title.Size = new System.Drawing.Size(41, 25); 86 | this.lbl_title.TabIndex = 12; 87 | this.lbl_title.Text = "Info"; 88 | this.lbl_title.UseCustomBackColor = true; 89 | this.lbl_title.UseStyleColors = true; 90 | // 91 | // panel2 92 | // 93 | this.panel2.Location = new System.Drawing.Point(273, 6); 94 | this.panel2.Name = "panel2"; 95 | this.panel2.Size = new System.Drawing.Size(49, 23); 96 | this.panel2.TabIndex = 11; 97 | // 98 | // Info 99 | // 100 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; 101 | this.ClientSize = new System.Drawing.Size(321, 184); 102 | this.Controls.Add(this.panel2); 103 | this.Controls.Add(this.lbl_title); 104 | this.Controls.Add(this.panel1); 105 | this.Controls.Add(this.btn_okinfo); 106 | this.Controls.Add(this.txtBox_info); 107 | this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 108 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 109 | this.MaximizeBox = false; 110 | this.MinimizeBox = false; 111 | this.Name = "Info"; 112 | this.Resizable = false; 113 | this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; 114 | this.Style = MetroFramework.MetroColorStyle.Default; 115 | this.Text = "Notification"; 116 | this.Theme = MetroFramework.MetroThemeStyle.Dark; 117 | this.TopMost = true; 118 | this.Load += new System.EventHandler(this.Info_Load); 119 | this.Shown += new System.EventHandler(this.Info_Shown); 120 | this.ResumeLayout(false); 121 | this.PerformLayout(); 122 | 123 | } 124 | 125 | #endregion 126 | private System.Windows.Forms.TextBox txtBox_info; 127 | private MetroFramework.Controls.MetroButton btn_okinfo; 128 | private System.Windows.Forms.Panel panel1; 129 | private MetroFramework.Controls.MetroLabel lbl_title; 130 | private System.Windows.Forms.Panel panel2; 131 | } 132 | } -------------------------------------------------------------------------------- /MercuryBOT/InfoForm/Info.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.Helpers; 11 | using MetroFramework.Controls; 12 | using System; 13 | using System.IO; 14 | using System.Linq; 15 | using System.Media; 16 | using System.Windows.Forms; 17 | using Win32Interop.Methods; 18 | using System.Drawing; 19 | 20 | namespace MercuryBOT.InfoForm 21 | { 22 | public partial class Info : MetroFramework.Forms.MetroForm 23 | { 24 | /// 25 | /// https://stackoverflow.com/questions/6932792/how-to-create-a-custom-messagebox 26 | /// 27 | /// 28 | public Info(string title, string description) 29 | { 30 | InitializeComponent(); 31 | this.components.SetStyle(this); 32 | this.lbl_title.Text = title; 33 | this.txtBox_info.Text = description; 34 | this.FormBorderStyle = FormBorderStyle.None; 35 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 36 | 37 | foreach (Button control in this.Controls.OfType()) 38 | { 39 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, control.Width, control.Height, 5, 5); 40 | control.Region = Region.FromHrgn(ptr); 41 | Gdi32.DeleteObject(ptr); 42 | } 43 | } 44 | 45 | private void Info_Load(object sender, EventArgs e) 46 | { 47 | 48 | } 49 | 50 | private void Btn_okinfo_Click(object sender, EventArgs e) 51 | { 52 | Close(); 53 | } 54 | 55 | private void Info_Shown(object sender, EventArgs e) 56 | { 57 | new SoundPlayer(Mercury.Properties.Resources.mercury_alert).Play(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /MercuryBOT/InfoForm/InfoHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | namespace MercuryBOT.InfoForm 11 | { 12 | class InfoHelper 13 | { 14 | //https://stackoverflow.com/questions/8622937/how-to-send-text-to-textbox-through-a-different-class 15 | // message to other form 16 | 17 | /// 18 | /// https://stackoverflow.com/questions/6932792/how-to-create-a-custom-messagebox 19 | /// Your custom message box helper. 20 | /// 21 | public static class CustomMessageBox 22 | { 23 | public static void Show(string title, string description) 24 | { 25 | // using construct ensures the resources are freed when form is closed 26 | using (var form = new Info(title, description)) 27 | { 28 | form.ShowDialog(); 29 | } 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /MercuryBOT/MetroMessageBox/CustomMetroMessageBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.IO; 4 | using System.Media; 5 | using System.Windows.Forms; 6 | 7 | namespace Mercury.MetroMessageBox 8 | { 9 | public static class CustomMetroMessageBox 10 | { 11 | public static DialogResult Show(IWin32Window owner, string message) 12 | { 13 | return Show(owner, message, "Notification", 211); 14 | } 15 | 16 | public static DialogResult Show(IWin32Window owner, string message, int height) 17 | { 18 | return Show(owner, message, "Notification", height); 19 | } 20 | 21 | public static DialogResult Show(IWin32Window owner, string message, string title) 22 | { 23 | return Show(owner, message, title, MessageBoxButtons.OK, 211); 24 | } 25 | 26 | public static DialogResult Show( 27 | IWin32Window owner, 28 | string message, 29 | string title, 30 | int height) 31 | { 32 | return Show(owner, message, title, MessageBoxButtons.OK, height); 33 | } 34 | 35 | public static DialogResult Show( 36 | IWin32Window owner, 37 | string message, 38 | string title, 39 | MessageBoxButtons buttons) 40 | { 41 | return Show(owner, message, title, buttons, MessageBoxIcon.None, 211); 42 | } 43 | 44 | public static DialogResult Show( 45 | IWin32Window owner, 46 | string message, 47 | string title, 48 | MessageBoxButtons buttons, 49 | int height) 50 | { 51 | return Show(owner, message, title, buttons, MessageBoxIcon.None, height); 52 | } 53 | 54 | public static DialogResult Show( 55 | IWin32Window owner, 56 | string message, 57 | string title, 58 | MessageBoxButtons buttons, 59 | MessageBoxIcon icon) 60 | { 61 | return Show(owner, message, title, buttons, icon, MessageBoxDefaultButton.Button1, 211); 62 | } 63 | 64 | public static DialogResult Show( 65 | IWin32Window owner, 66 | string message, 67 | string title, 68 | MessageBoxButtons buttons, 69 | MessageBoxIcon icon, 70 | int height) 71 | { 72 | return Show(owner, message, title, buttons, icon, MessageBoxDefaultButton.Button1, height); 73 | } 74 | 75 | public static DialogResult Show( 76 | IWin32Window owner, 77 | string message, 78 | string title, 79 | MessageBoxButtons buttons, 80 | MessageBoxIcon icon, 81 | MessageBoxDefaultButton defaultbutton) 82 | { 83 | return Show(owner, message, title, buttons, icon, defaultbutton, 211); 84 | } 85 | 86 | public static DialogResult Show( 87 | IWin32Window owner, 88 | string message, 89 | string title, 90 | MessageBoxButtons buttons, 91 | MessageBoxIcon icon, 92 | MessageBoxDefaultButton defaultbutton, 93 | int height) 94 | { 95 | 96 | var dialogResult = DialogResult.None; 97 | if (owner != null) 98 | { 99 | var form = !(owner is Form) ? ((ContainerControl)owner).ParentForm : (Form)owner; 100 | switch (icon) 101 | { 102 | case MessageBoxIcon.Hand: 103 | SystemSounds.Hand.Play(); 104 | break; 105 | case MessageBoxIcon.Question: 106 | SystemSounds.Beep.Play(); 107 | break; 108 | case MessageBoxIcon.Exclamation: 109 | SystemSounds.Exclamation.Play(); 110 | break; 111 | default: 112 | SystemSounds.Asterisk.Play(); 113 | break; 114 | } 115 | 116 | var messageBoxControl = new CustomMetroMessageBoxControl(); 117 | messageBoxControl.ForeColor = Color.FromArgb(45, 51, 59); 118 | messageBoxControl.BackColor = Color.Orange; 119 | messageBoxControl.Properties.Buttons = buttons; 120 | messageBoxControl.Properties.DefaultButton = defaultbutton; 121 | messageBoxControl.Properties.Icon = icon; 122 | messageBoxControl.Properties.Message = message; 123 | messageBoxControl.Properties.Title = title; 124 | messageBoxControl.Padding = new Padding(0, 0, 0, 0); 125 | messageBoxControl.ControlBox = false; 126 | messageBoxControl.ShowInTaskbar = false; 127 | messageBoxControl.TopMost = true; 128 | messageBoxControl.Size = new Size(form.Size.Width, height); 129 | messageBoxControl.Location = new Point(form.Location.X, 130 | form.Location.Y + (form.Height - messageBoxControl.Height) / 2); 131 | messageBoxControl.ArrangeApperance(); 132 | Convert.ToInt32(Math.Floor(messageBoxControl.Size.Height * 0.28)); 133 | var num = (int)messageBoxControl.ShowDialog(); 134 | messageBoxControl.BringToFront(); 135 | messageBoxControl.SetDefaultButton(); 136 | dialogResult = messageBoxControl.Result; 137 | messageBoxControl.Dispose(); 138 | } 139 | 140 | return dialogResult; 141 | } 142 | 143 | private static void ModalState(CustomMetroMessageBoxControl control) 144 | { 145 | do 146 | { 147 | ; 148 | } while (control.Visible); 149 | } 150 | } 151 | } -------------------------------------------------------------------------------- /MercuryBOT/MetroMessageBox/CustomMetroMessageBoxProperties.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace Mercury.MetroMessageBox 4 | { 5 | public class CustomMetroMessageBoxProperties 6 | { 7 | public CustomMetroMessageBoxProperties(CustomMetroMessageBoxControl owner) 8 | { 9 | Owner = owner; 10 | } 11 | 12 | public MessageBoxButtons Buttons { get; set; } 13 | 14 | public MessageBoxDefaultButton DefaultButton { get; set; } 15 | 16 | public MessageBoxIcon Icon { get; set; } 17 | 18 | public string Message { get; set; } 19 | 20 | public CustomMetroMessageBoxControl Owner { get; } 21 | 22 | public string Title { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /MercuryBOT/Notification/NotifHelper.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using System; 11 | 12 | namespace MercuryBOT.Notification 13 | { 14 | class NotifHelper 15 | { 16 | public static class MessageBox 17 | { 18 | public static void Show(string title, string description) 19 | { 20 | using (var form = new NotificationForm(title, description)) 21 | { 22 | form.ShowDialog(); 23 | } 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /MercuryBOT/Notification/NotificationForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MercuryBOT.Notification 2 | { 3 | partial class NotificationForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NotificationForm)); 33 | this.lbl_time = new MetroFramework.Controls.MetroLabel(); 34 | this.timer1 = new System.Windows.Forms.Timer(this.components); 35 | this.txtBox_desc = new System.Windows.Forms.TextBox(); 36 | this.SuspendLayout(); 37 | // 38 | // lbl_time 39 | // 40 | this.lbl_time.AutoSize = true; 41 | this.lbl_time.Location = new System.Drawing.Point(203, 54); 42 | this.lbl_time.Name = "lbl_time"; 43 | this.lbl_time.Size = new System.Drawing.Size(38, 19); 44 | this.lbl_time.TabIndex = 0; 45 | this.lbl_time.Text = "13:37"; 46 | this.lbl_time.Theme = MetroFramework.MetroThemeStyle.Dark; 47 | // 48 | // timer1 49 | // 50 | this.timer1.Enabled = true; 51 | this.timer1.Interval = 3000; 52 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick); 53 | // 54 | // txtBox_desc 55 | // 56 | this.txtBox_desc.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); 57 | this.txtBox_desc.BorderStyle = System.Windows.Forms.BorderStyle.None; 58 | this.txtBox_desc.Cursor = System.Windows.Forms.Cursors.Default; 59 | this.txtBox_desc.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 60 | this.txtBox_desc.ForeColor = System.Drawing.Color.White; 61 | this.txtBox_desc.ImeMode = System.Windows.Forms.ImeMode.On; 62 | this.txtBox_desc.Location = new System.Drawing.Point(7, 7); 63 | this.txtBox_desc.MaxLength = 100; 64 | this.txtBox_desc.Multiline = true; 65 | this.txtBox_desc.Name = "txtBox_desc"; 66 | this.txtBox_desc.ReadOnly = true; 67 | this.txtBox_desc.Size = new System.Drawing.Size(199, 66); 68 | this.txtBox_desc.TabIndex = 0; 69 | this.txtBox_desc.TabStop = false; 70 | // 71 | // NotificationForm 72 | // 73 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; 74 | this.AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange; 75 | this.ClientSize = new System.Drawing.Size(240, 73); 76 | this.Controls.Add(this.txtBox_desc); 77 | this.Controls.Add(this.lbl_time); 78 | this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 79 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 80 | this.MaximizeBox = false; 81 | this.MinimizeBox = false; 82 | this.Movable = false; 83 | this.Name = "NotificationForm"; 84 | this.Resizable = false; 85 | this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; 86 | this.ShowInTaskbar = false; 87 | this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; 88 | this.Style = MetroFramework.MetroColorStyle.Default; 89 | this.Theme = MetroFramework.MetroThemeStyle.Dark; 90 | this.ResumeLayout(false); 91 | this.PerformLayout(); 92 | 93 | } 94 | 95 | #endregion 96 | 97 | private MetroFramework.Controls.MetroLabel lbl_time; 98 | private System.Windows.Forms.Timer timer1; 99 | private System.Windows.Forms.TextBox txtBox_desc; 100 | } 101 | } -------------------------------------------------------------------------------- /MercuryBOT/Notification/NotificationForm.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.Helpers; 11 | using System; 12 | using System.Drawing; 13 | using System.Runtime.InteropServices; 14 | using System.Windows.Forms; 15 | using Win32Interop.Methods; 16 | 17 | namespace MercuryBOT.Notification 18 | { 19 | public partial class NotificationForm : MetroFramework.Forms.MetroForm 20 | { 21 | //protected override void WndProc(ref Message m) 22 | //{ 23 | // // Ignore all messages that try to set the focus. 24 | // if (m.Msg != 0x7) 25 | // { 26 | // base.WndProc(ref m); 27 | // } 28 | //} 29 | 30 | protected override void WndProc(ref Message m) 31 | { 32 | if (m.Msg == (int)0x84) 33 | m.Result = (IntPtr)(-1); 34 | else 35 | base.WndProc(ref m); 36 | } 37 | 38 | 39 | private int posStart; 40 | private bool openNotify = false; 41 | 42 | //Thanks to Kirtan Patel 43 | //Constants 44 | // Animates the window from left to right. This flag can be used with roll or slide animation. 45 | public const int AW_HOR_POSITIVE = 0X1; 46 | 47 | // Animates the window from right to left. This flag can be used with roll or slide animation. 48 | public const int AW_HOR_NEGATIVE = 0X2; 49 | 50 | // Animates the window from top to bottom. This flag can be used with roll or slide animation. 51 | public const int AW_VER_POSITIVE = 0X4; 52 | 53 | // Animates the window from bottom to top. This flag can be used with roll or slide animation. 54 | public const int AW_VER_NEGATIVE = 0X8; 55 | 56 | // Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used. 57 | public const int AW_CENTER = 0X10; 58 | // Hides the window. By default, the window is shown. 59 | public const int AW_HIDE = 0x10000; 60 | // Activates the window. 61 | public const int AW_ACTIVATE = 0X20000; 62 | // Uses slide animation. By default, roll animation is used. 63 | public const int AW_SLIDE = 0X40000; 64 | // Uses a fade effect. This flag can be used only if hwnd is a top-level window. 65 | public const int AW_BLEND = 0X80000; 66 | 67 | [DllImport("user32")] 68 | static extern bool AnimateWindow(IntPtr hwnd, int time, int flags); 69 | 70 | public NotificationForm(string title, string desc) 71 | { 72 | InitializeComponent(); 73 | this.components.SetStyle(this); 74 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 0, 0)); 75 | 76 | // this.lbl_title.Text = title; 77 | this.txtBox_desc.Text = desc; 78 | 79 | lbl_time.Text = DateTime.Now.ToString("HH:mm"); 80 | } 81 | 82 | private enum TaskBarLocation { TOP, BOTTOM, LEFT, RIGHT } 83 | 84 | private TaskBarLocation GetTaskBarLocation() 85 | { 86 | TaskBarLocation taskBarLocation = TaskBarLocation.BOTTOM; 87 | bool taskBarOnTopOrBottom = (Screen.PrimaryScreen.WorkingArea.Width == Screen.PrimaryScreen.Bounds.Width); 88 | if (taskBarOnTopOrBottom) 89 | { 90 | if (Screen.PrimaryScreen.WorkingArea.Top > 0) taskBarLocation = TaskBarLocation.TOP; 91 | } 92 | else 93 | { 94 | if (Screen.PrimaryScreen.WorkingArea.Left > 0) 95 | { 96 | taskBarLocation = TaskBarLocation.LEFT; 97 | } 98 | else 99 | { 100 | taskBarLocation = TaskBarLocation.RIGHT; 101 | } 102 | } 103 | return taskBarLocation; 104 | } 105 | 106 | 107 | protected override void OnLoad(EventArgs e) 108 | { 109 | txtBox_desc.Select(0, -1); 110 | posStart = Screen.PrimaryScreen.WorkingArea.Bottom - (this.Height); 111 | this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Right - this.Size.Width - 1, posStart); 112 | 113 | //Animate form 114 | Notify(); 115 | 116 | 117 | } 118 | private void Notify() 119 | { 120 | if (openNotify == false) 121 | { 122 | //json read 123 | AnimateWindow(this.Handle, 500, AW_SLIDE | AW_VER_NEGATIVE); 124 | openNotify = true; 125 | } 126 | } 127 | 128 | private void timer1_Tick(object sender, EventArgs e) 129 | { 130 | openNotify = false; 131 | Close(); 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /MercuryBOT/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | 11 | using System; 12 | using System.Windows.Forms; 13 | using System.IO; 14 | using MercuryBOT.Splash; 15 | using System.Net; 16 | using System.Diagnostics; 17 | 18 | namespace MercuryBOT 19 | { 20 | static class Program 21 | { 22 | public static readonly WebClient Web = new WebClient(); 23 | public static readonly Process[] CurrentProcesses = Process.GetProcesses(); 24 | 25 | public static readonly string TOOLNAME = "Mercury: Ultimate Steam Tool"; 26 | public static readonly string Version = "5.0.0"; 27 | 28 | public static readonly string spkDomain = "http://sp0ok3r.duckdns.org/Mercury/"; 29 | 30 | public static readonly string ExecutablePath = Path.GetDirectoryName(Application.ExecutablePath); 31 | public static readonly string AccountsJsonFile = ExecutablePath + @"\Accounts.json"; 32 | public static readonly string SettingsJsonFile = ExecutablePath + @"\Settings.json"; 33 | public static readonly string SentryFolder = ExecutablePath + @"\Sentry\"; 34 | public static readonly string ChatLogsFolder = ExecutablePath + @"\ChatLogs\"; 35 | public static readonly string keysFolder = ExecutablePath + @"\Keys\"; 36 | 37 | [STAThread] 38 | static void Main() 39 | { 40 | Application.EnableVisualStyles(); 41 | Application.SetCompatibleTextRenderingDefault(false); 42 | Application.Run(new SplashScreen()); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /MercuryBOT/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mercury")] 9 | [assembly: AssemblyDescription("Ultimate Steam Tool")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("sp0ok3r Toolz")] 12 | [assembly: AssemblyProduct("Mercury")] 13 | [assembly: AssemblyCopyright("Copyright (C) 2024 sp0ok3r Toolz")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("95a62b66-12f4-410e-8f8c-af538de7853d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("5.0.0.0")] 36 | [assembly: AssemblyFileVersion("5.0.0.0")] 37 | 38 | -------------------------------------------------------------------------------- /MercuryBOT/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Mercury.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Mercury.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap DiscordLogo { 67 | get { 68 | object obj = ResourceManager.GetObject("DiscordLogo", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap github_logo { 77 | get { 78 | object obj = ResourceManager.GetObject("github_logo", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. 85 | /// 86 | internal static System.IO.UnmanagedMemoryStream mercury_alert { 87 | get { 88 | return ResourceManager.GetStream("mercury_alert", resourceCulture); 89 | } 90 | } 91 | 92 | /// 93 | /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. 94 | /// 95 | internal static System.IO.UnmanagedMemoryStream mercury_success { 96 | get { 97 | return ResourceManager.GetStream("mercury_success", resourceCulture); 98 | } 99 | } 100 | 101 | /// 102 | /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. 103 | /// 104 | internal static System.IO.UnmanagedMemoryStream mercury_update { 105 | get { 106 | return ResourceManager.GetStream("mercury_update", resourceCulture); 107 | } 108 | } 109 | 110 | /// 111 | /// Looks up a localized resource of type System.Drawing.Bitmap. 112 | /// 113 | internal static System.Drawing.Bitmap MercuryIconLogo { 114 | get { 115 | object obj = ResourceManager.GetObject("MercuryIconLogo", resourceCulture); 116 | return ((System.Drawing.Bitmap)(obj)); 117 | } 118 | } 119 | 120 | /// 121 | /// Looks up a localized resource of type System.Drawing.Bitmap. 122 | /// 123 | internal static System.Drawing.Bitmap mercuryIMGNotFound { 124 | get { 125 | object obj = ResourceManager.GetObject("mercuryIMGNotFound", resourceCulture); 126 | return ((System.Drawing.Bitmap)(obj)); 127 | } 128 | } 129 | 130 | /// 131 | /// Looks up a localized resource of type System.Drawing.Bitmap. 132 | /// 133 | internal static System.Drawing.Bitmap MercuryLogoWhite2 { 134 | get { 135 | object obj = ResourceManager.GetObject("MercuryLogoWhite2", resourceCulture); 136 | return ((System.Drawing.Bitmap)(obj)); 137 | } 138 | } 139 | 140 | /// 141 | /// Looks up a localized resource of type System.Drawing.Bitmap. 142 | /// 143 | internal static System.Drawing.Bitmap Restart_MouseHover { 144 | get { 145 | object obj = ResourceManager.GetObject("Restart_MouseHover", resourceCulture); 146 | return ((System.Drawing.Bitmap)(obj)); 147 | } 148 | } 149 | 150 | /// 151 | /// Looks up a localized resource of type System.Drawing.Bitmap. 152 | /// 153 | internal static System.Drawing.Bitmap Restart_Normal { 154 | get { 155 | object obj = ResourceManager.GetObject("Restart_Normal", resourceCulture); 156 | return ((System.Drawing.Bitmap)(obj)); 157 | } 158 | } 159 | 160 | /// 161 | /// Looks up a localized resource of type System.Drawing.Bitmap. 162 | /// 163 | internal static System.Drawing.Bitmap sparkles { 164 | get { 165 | object obj = ResourceManager.GetObject("sparkles", resourceCulture); 166 | return ((System.Drawing.Bitmap)(obj)); 167 | } 168 | } 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /MercuryBOT/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\resources\images\discordlogo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\resources\images\github_logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\resources\images\mercuryiconlogo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\resources\images\mercuryimgnotfound.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\resources\sounds\mercury_alert.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 135 | 136 | 137 | ..\resources\sounds\mercury_success.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 138 | 139 | 140 | ..\resources\sounds\mercury_update.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 141 | 142 | 143 | ..\resources\images\restart_mousehover.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | 146 | ..\resources\images\restart_normal.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 147 | 148 | 149 | ..\resources\images\mercurylogowhite2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 150 | 151 | 152 | ..\resources\images\sparkles.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 153 | 154 | -------------------------------------------------------------------------------- /MercuryBOT/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Mercury.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MercuryBOT/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MercuryBOT/Resources/ChatLogger_Alert.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/ChatLogger_Alert.wav -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/DiscordLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/DiscordLogo.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/MercuryIconLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/MercuryIconLogo.ico -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/MercuryIconLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/MercuryIconLogo.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/MercuryLogoWhite2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/MercuryLogoWhite2.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/Restart_MouseHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/Restart_MouseHover.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/Restart_Normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/Restart_Normal.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/SteamLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/SteamLogo.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/github_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/github_logo.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/mapWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/mapWhite.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/mercuryIMGNotFound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/mercuryIMGNotFound.png -------------------------------------------------------------------------------- /MercuryBOT/Resources/Images/sparkles.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Images/sparkles.gif -------------------------------------------------------------------------------- /MercuryBOT/Resources/Sounds/mercury_alert.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Sounds/mercury_alert.wav -------------------------------------------------------------------------------- /MercuryBOT/Resources/Sounds/mercury_success.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Sounds/mercury_success.wav -------------------------------------------------------------------------------- /MercuryBOT/Resources/Sounds/mercury_update.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/Sounds/mercury_update.wav -------------------------------------------------------------------------------- /MercuryBOT/Resources/mercury6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/MercuryBOT/Resources/mercury6.png -------------------------------------------------------------------------------- /MercuryBOT/Splash/SplashScreen.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MercuryBOT.Splash 2 | { 3 | partial class SplashScreen 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SplashScreen)); 32 | this.lbl_version = new MetroFramework.Controls.MetroLabel(); 33 | this.panel1 = new System.Windows.Forms.Panel(); 34 | this.lbl_info2 = new MetroFramework.Controls.MetroLabel(); 35 | this.pictureBox_MercuryLogo = new System.Windows.Forms.PictureBox(); 36 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox_MercuryLogo)).BeginInit(); 37 | this.SuspendLayout(); 38 | // 39 | // lbl_version 40 | // 41 | this.lbl_version.Location = new System.Drawing.Point(23, 312); 42 | this.lbl_version.Name = "lbl_version"; 43 | this.lbl_version.Size = new System.Drawing.Size(255, 19); 44 | this.lbl_version.TabIndex = 3; 45 | this.lbl_version.Text = "version"; 46 | this.lbl_version.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 47 | this.lbl_version.Theme = MetroFramework.MetroThemeStyle.Dark; 48 | this.lbl_version.UseCustomBackColor = true; 49 | this.lbl_version.UseStyleColors = true; 50 | // 51 | // panel1 52 | // 53 | this.panel1.Location = new System.Drawing.Point(59, 6); 54 | this.panel1.Name = "panel1"; 55 | this.panel1.Size = new System.Drawing.Size(241, 49); 56 | this.panel1.TabIndex = 6; 57 | // 58 | // lbl_info2 59 | // 60 | this.lbl_info2.Location = new System.Drawing.Point(23, 213); 61 | this.lbl_info2.Name = "lbl_info2"; 62 | this.lbl_info2.Size = new System.Drawing.Size(255, 19); 63 | this.lbl_info2.TabIndex = 8; 64 | this.lbl_info2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 65 | this.lbl_info2.Theme = MetroFramework.MetroThemeStyle.Dark; 66 | this.lbl_info2.UseCustomBackColor = true; 67 | this.lbl_info2.UseStyleColors = true; 68 | // 69 | // pictureBox_MercuryLogo 70 | // 71 | this.pictureBox_MercuryLogo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17))))); 72 | this.pictureBox_MercuryLogo.Image = global::Mercury.Properties.Resources.MercuryLogoWhite2; 73 | this.pictureBox_MercuryLogo.Location = new System.Drawing.Point(23, 88); 74 | this.pictureBox_MercuryLogo.Name = "pictureBox_MercuryLogo"; 75 | this.pictureBox_MercuryLogo.Size = new System.Drawing.Size(255, 122); 76 | this.pictureBox_MercuryLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 77 | this.pictureBox_MercuryLogo.TabIndex = 48; 78 | this.pictureBox_MercuryLogo.TabStop = false; 79 | // 80 | // SplashScreen 81 | // 82 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; 83 | this.ClientSize = new System.Drawing.Size(301, 351); 84 | this.Controls.Add(this.pictureBox_MercuryLogo); 85 | this.Controls.Add(this.lbl_info2); 86 | this.Controls.Add(this.lbl_version); 87 | this.Controls.Add(this.panel1); 88 | this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 89 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 90 | this.MaximizeBox = false; 91 | this.MinimizeBox = false; 92 | this.Name = "SplashScreen"; 93 | this.Resizable = false; 94 | this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; 95 | this.Style = MetroFramework.MetroColorStyle.Default; 96 | this.Text = "Mercury - Splash"; 97 | this.TextAlign = MetroFramework.Forms.MetroFormTextAlign.Center; 98 | this.Theme = MetroFramework.MetroThemeStyle.Dark; 99 | this.TransparencyKey = System.Drawing.Color.Green; 100 | this.Load += new System.EventHandler(this.SplashScreen_Load); 101 | this.Shown += new System.EventHandler(this.SplashScreen_Shown); 102 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox_MercuryLogo)).EndInit(); 103 | this.ResumeLayout(false); 104 | 105 | } 106 | 107 | #endregion 108 | private MetroFramework.Controls.MetroLabel lbl_version; 109 | private System.Windows.Forms.Panel panel1; 110 | private MetroFramework.Controls.MetroLabel lbl_info2; 111 | private System.Windows.Forms.PictureBox pictureBox_MercuryLogo; 112 | } 113 | } -------------------------------------------------------------------------------- /MercuryBOT/Splash/SplashScreen.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using Gameloop.Vdf; 11 | using Gameloop.Vdf.Linq; 12 | using MercuryBOT.Helpers; 13 | using MercuryBOT.User2Json; 14 | using MercuryBOT.UserSettings; 15 | using Newtonsoft.Json; 16 | using System; 17 | using System.Collections.Generic; 18 | using System.IO; 19 | using System.Linq; 20 | using System.Windows.Forms; 21 | using Win32Interop.Methods; 22 | using Timer = System.Windows.Forms.Timer; 23 | using System.Diagnostics; 24 | 25 | namespace MercuryBOT.Splash 26 | { 27 | public partial class SplashScreen : MetroFramework.Forms.MetroForm 28 | { 29 | 30 | private static List _users; 31 | 32 | public SplashScreen() 33 | { 34 | InitializeComponent(); 35 | 36 | this.components.SetStyle(this); 37 | this.FormBorderStyle = FormBorderStyle.None; 38 | Region = System.Drawing.Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 39 | } 40 | 41 | private void CheckForAccountsFile() 42 | { 43 | if (!File.Exists(Program.AccountsJsonFile)) 44 | { 45 | File.WriteAllText(Program.AccountsJsonFile, "{Accounts: []}"); 46 | } 47 | 48 | if (!File.Exists(Program.SettingsJsonFile)) 49 | { 50 | File.WriteAllText(Program.SettingsJsonFile, "{}"); 51 | } 52 | if (!File.Exists(Program.SentryFolder)) 53 | { 54 | Directory.CreateDirectory(Program.SentryFolder); 55 | } 56 | 57 | if (!File.Exists(Program.ChatLogsFolder)) 58 | { 59 | Directory.CreateDirectory(Program.ChatLogsFolder); 60 | } 61 | 62 | lbl_info2.Text = "LOADING"; 63 | } 64 | 65 | public static void LoginusersVDF_ToFile() 66 | { 67 | _users = GetLoginUsers().ToList(); 68 | if (_users.Count == 0) 69 | { 70 | throw new IOException(@"Cannot find saved users!"); 71 | } 72 | foreach (var user in _users) 73 | { 74 | var list = JsonConvert.DeserializeObject(File.ReadAllText(Program.AccountsJsonFile)); 75 | 76 | IList savedAccs = list.Accounts.Select(u => u.username).ToList(); 77 | 78 | if (!savedAccs.Contains(user.AccountName)) 79 | { 80 | var EmptyGameList = new List(); 81 | var EmptyCustomMessagesList = new List(); 82 | 83 | list.Accounts.Add(new UserAccounts 84 | { 85 | LastLoginTime = user.LastLoginTime.ToString(), 86 | AdminID = 0, 87 | LoginState = 1, //default: online 88 | username = user.AccountName, 89 | password = "", 90 | SteamID = user.SteamId64, 91 | APIWebKey = "", 92 | Games = EmptyGameList, 93 | AFKMessages = EmptyCustomMessagesList, 94 | MsgRecipients = new List() 95 | }); 96 | File.WriteAllText(Program.AccountsJsonFile, JsonConvert.SerializeObject(list, new JsonSerializerSettings { Formatting = Formatting.Indented })); 97 | } 98 | } 99 | } 100 | 101 | public static IEnumerable GetLoginUsers() 102 | { 103 | if (Helpers.Extensions.SteamLocation == null) 104 | { 105 | Helpers.Extensions.Init(); 106 | } 107 | 108 | dynamic volvo = VdfConvert.Deserialize(File.ReadAllText(Helpers.Extensions.SteamLocation + @"\config\loginusers.vdf")); 109 | 110 | VToken v2 = volvo.Value; 111 | return v2.Children().Select(child => new SteamLoginUsers((VProperty)child)).OrderByDescending(user => user.LastLoginTime).ToList(); 112 | //.Where(user => user.RememberPassword) 113 | } 114 | 115 | [Obsolete] 116 | private void SplashScreen_Load(object sender, EventArgs e) 117 | { 118 | this.Activate(); 119 | lbl_version.Text = Program.Version.Replace("-", ""); 120 | } 121 | Timer tmr; 122 | 123 | [Obsolete] 124 | private void SplashScreen_Shown(object sender, EventArgs e) 125 | { 126 | CheckForAccountsFile(); 127 | 128 | try 129 | { 130 | LoginusersVDF_ToFile(); 131 | } 132 | catch (Exception x) 133 | { 134 | Console.WriteLine("[" + Program.TOOLNAME + "] - Steam Directory not found, but starting anyways..." + x); 135 | } 136 | 137 | tmr = new Timer(); 138 | tmr.Interval = 100; 139 | tmr.Start(); 140 | tmr.Tick += tmr_Tick; 141 | } 142 | 143 | [Obsolete] 144 | void tmr_Tick(object sender, EventArgs e) 145 | { 146 | tmr.Stop(); 147 | Form mf = new Main(); 148 | mf.Show(); 149 | this.Hide(); 150 | } 151 | } 152 | } -------------------------------------------------------------------------------- /MercuryBOT/SteamGuard/SteamGuard.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.Helpers; 11 | using System; 12 | using System.Windows.Forms; 13 | using Win32Interop.Methods; 14 | using System.Drawing; 15 | using System.Linq; 16 | 17 | namespace MercuryBOT 18 | { 19 | public partial class SteamGuard : MetroFramework.Forms.MetroForm 20 | { 21 | public static string AuthCode; 22 | 23 | public SteamGuard(string EmailorPhone, string user,bool lastcodeError) 24 | { 25 | InitializeComponent(); this.Activate(); 26 | this.FormBorderStyle = FormBorderStyle.None; 27 | this.components.SetStyle(this); 28 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 29 | 30 | foreach (var button in this.Controls.OfType()) 31 | { 32 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, button.Width, button.Height, 5, 5); 33 | button.Region = Region.FromHrgn(ptr); 34 | Gdi32.DeleteObject(ptr); 35 | } 36 | 37 | 38 | if (lastcodeError) 39 | { 40 | InfoForm.InfoHelper.CustomMessageBox.Show("Error", "The previous two-factor auth code you have provided is incorrect, please try again."); 41 | } 42 | 43 | 44 | lbl_account.Text = user; 45 | if (EmailorPhone == "Phone") 46 | { 47 | lbl_infoemailorPhone.Text = "Enter your two-factor authentication code"; 48 | lbl_emojiInfo.Text = "📱"; 49 | } 50 | else 51 | { 52 | lbl_infoemailorPhone.Text = "Enter Steam Guard code from your email"; 53 | lbl_emojiInfo.Text = "📧"; 54 | MongoToolTip.SetToolTip(lbl_emojiInfo, EmailorPhone); 55 | } 56 | } 57 | 58 | private void SteamGuard_Load(object sender, EventArgs e) 59 | { 60 | txtBox_Code.Focus(); 61 | } 62 | 63 | private void btn_submit_Click(object sender, EventArgs e) 64 | { 65 | if (AuthCode != "") 66 | { 67 | AuthCode = txtBox_Code.Text; 68 | 69 | this.Close(); 70 | } 71 | } 72 | 73 | private void btn_cancel_Click(object sender, EventArgs e) 74 | { 75 | //AccountLogin.Logout(); 76 | this.Close(); 77 | } 78 | 79 | private void SteamGuard_Shown(object sender, EventArgs e) 80 | { 81 | this.Activate(); 82 | // Stream str = Properties.Resources.; 83 | // SoundPlayer snd = new SoundPlayer(str); 84 | // snd.Play(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /MercuryBOT/SteamLocally/LocalSteamConnect.cs: -------------------------------------------------------------------------------- 1 | using Mercury.MetroMessageBox; 2 | using MercuryBOT; 3 | using Steam4NET; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Runtime.CompilerServices; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Mercury.SteamLocally 12 | { 13 | public class LocalSteamConnect 14 | { 15 | 16 | private static ISteamClient012 _steamClient012; 17 | private static ISteamApps001 _steamApps001; 18 | 19 | private static bool ConnectToSteam() 20 | { 21 | if (!Steamworks.Load(true)) 22 | { 23 | CustomMetroMessageBox.Show(Main.ActiveForm,"Steamworks failed to load."); 24 | return false; 25 | } 26 | 27 | _steamClient012 = Steamworks.CreateInterface(); 28 | if (_steamClient012 == null) 29 | { 30 | CustomMetroMessageBox.Show(Main.ActiveForm, "Failed to create Steam Client inferface."); 31 | return false; 32 | } 33 | 34 | int pipe = _steamClient012.CreateSteamPipe(); 35 | if (pipe == 0) 36 | { 37 | CustomMetroMessageBox.Show(Main.ActiveForm, "Failed to create Steam pipe."); 38 | return false; 39 | } 40 | 41 | int user = _steamClient012.ConnectToGlobalUser(pipe); 42 | if (user == 0) 43 | { 44 | CustomMetroMessageBox.Show(Main.ActiveForm, "Failed to connect to Steam user. (No game in this Account!)"); 45 | return false; 46 | } 47 | 48 | _steamApps001 = _steamClient012.GetISteamApps(user, pipe); 49 | if (_steamApps001 == null) 50 | { 51 | CustomMetroMessageBox.Show(Main.ActiveForm, "Failed to create Steam Apps inferface."); 52 | return false; 53 | } 54 | 55 | return true; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /MercuryBOT/SteamProfileBackground/ProfileBackground.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MercuryBOT.SteamProfileBackground 2 | { 3 | partial class ProfileBackground 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProfileBackground)); 32 | this.BTN_GETBackground = new MetroFramework.Controls.MetroButton(); 33 | this.txtBox_steamprofile = new MetroFramework.Controls.MetroTextBox(); 34 | this.picBox_steamBackground = new System.Windows.Forms.PictureBox(); 35 | this.lbl_clickonimginfo = new MetroFramework.Controls.MetroLabel(); 36 | this.metroToolTip1 = new MetroFramework.Components.MetroToolTip(); 37 | ((System.ComponentModel.ISupportInitialize)(this.picBox_steamBackground)).BeginInit(); 38 | this.SuspendLayout(); 39 | // 40 | // BTN_GETBackground 41 | // 42 | this.BTN_GETBackground.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25))))); 43 | this.BTN_GETBackground.ForeColor = System.Drawing.Color.White; 44 | this.BTN_GETBackground.Location = new System.Drawing.Point(266, 268); 45 | this.BTN_GETBackground.Name = "BTN_GETBackground"; 46 | this.BTN_GETBackground.Size = new System.Drawing.Size(75, 23); 47 | this.BTN_GETBackground.Style = MetroFramework.MetroColorStyle.Purple; 48 | this.BTN_GETBackground.TabIndex = 5; 49 | this.BTN_GETBackground.Text = "GET"; 50 | this.BTN_GETBackground.Theme = MetroFramework.MetroThemeStyle.Dark; 51 | this.BTN_GETBackground.UseCustomBackColor = true; 52 | this.BTN_GETBackground.UseCustomForeColor = true; 53 | this.BTN_GETBackground.UseSelectable = true; 54 | this.BTN_GETBackground.UseStyleColors = true; 55 | this.BTN_GETBackground.Click += new System.EventHandler(this.BTN_GETBackground_Click); 56 | // 57 | // txtBox_steamprofile 58 | // 59 | // 60 | // 61 | // 62 | this.txtBox_steamprofile.CustomButton.Image = null; 63 | this.txtBox_steamprofile.CustomButton.Location = new System.Drawing.Point(223, 1); 64 | this.txtBox_steamprofile.CustomButton.Name = ""; 65 | this.txtBox_steamprofile.CustomButton.Size = new System.Drawing.Size(21, 21); 66 | this.txtBox_steamprofile.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; 67 | this.txtBox_steamprofile.CustomButton.TabIndex = 1; 68 | this.txtBox_steamprofile.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; 69 | this.txtBox_steamprofile.CustomButton.UseSelectable = true; 70 | this.txtBox_steamprofile.CustomButton.Visible = false; 71 | this.txtBox_steamprofile.ForeColor = System.Drawing.Color.White; 72 | this.txtBox_steamprofile.Lines = new string[0]; 73 | this.txtBox_steamprofile.Location = new System.Drawing.Point(20, 268); 74 | this.txtBox_steamprofile.MaxLength = 32767; 75 | this.txtBox_steamprofile.Name = "txtBox_steamprofile"; 76 | this.txtBox_steamprofile.PasswordChar = '\0'; 77 | this.txtBox_steamprofile.ScrollBars = System.Windows.Forms.ScrollBars.None; 78 | this.txtBox_steamprofile.SelectedText = ""; 79 | this.txtBox_steamprofile.SelectionLength = 0; 80 | this.txtBox_steamprofile.SelectionStart = 0; 81 | this.txtBox_steamprofile.ShortcutsEnabled = true; 82 | this.txtBox_steamprofile.Size = new System.Drawing.Size(245, 23); 83 | this.txtBox_steamprofile.TabIndex = 1; 84 | this.txtBox_steamprofile.Theme = MetroFramework.MetroThemeStyle.Dark; 85 | this.txtBox_steamprofile.UseCustomBackColor = true; 86 | this.txtBox_steamprofile.UseCustomForeColor = true; 87 | this.txtBox_steamprofile.UseSelectable = true; 88 | this.txtBox_steamprofile.UseStyleColors = true; 89 | this.txtBox_steamprofile.WaterMark = "https://steamcommunity.com/id/?/ or profile!"; 90 | this.txtBox_steamprofile.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); 91 | this.txtBox_steamprofile.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); 92 | // 93 | // picBox_steamBackground 94 | // 95 | this.picBox_steamBackground.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 96 | this.picBox_steamBackground.Cursor = System.Windows.Forms.Cursors.Hand; 97 | this.picBox_steamBackground.InitialImage = null; 98 | this.picBox_steamBackground.Location = new System.Drawing.Point(20, 75); 99 | this.picBox_steamBackground.Name = "picBox_steamBackground"; 100 | this.picBox_steamBackground.Size = new System.Drawing.Size(321, 187); 101 | this.picBox_steamBackground.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 102 | this.picBox_steamBackground.TabIndex = 2; 103 | this.picBox_steamBackground.TabStop = false; 104 | this.metroToolTip1.SetToolTip(this.picBox_steamBackground, "Click and go to market page!"); 105 | this.picBox_steamBackground.Click += new System.EventHandler(this.PicBox_steamBackground_Click); 106 | // 107 | // lbl_clickonimginfo 108 | // 109 | this.lbl_clickonimginfo.AutoSize = true; 110 | this.lbl_clickonimginfo.FontSize = MetroFramework.MetroLabelSize.Small; 111 | this.lbl_clickonimginfo.ForeColor = System.Drawing.SystemColors.AppWorkspace; 112 | this.lbl_clickonimginfo.Location = new System.Drawing.Point(245, 60); 113 | this.lbl_clickonimginfo.Name = "lbl_clickonimginfo"; 114 | this.lbl_clickonimginfo.Size = new System.Drawing.Size(100, 15); 115 | this.lbl_clickonimginfo.TabIndex = 46; 116 | this.lbl_clickonimginfo.Text = "Click on the image!"; 117 | this.lbl_clickonimginfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 118 | this.lbl_clickonimginfo.Theme = MetroFramework.MetroThemeStyle.Dark; 119 | this.lbl_clickonimginfo.UseCustomBackColor = true; 120 | this.lbl_clickonimginfo.UseStyleColors = true; 121 | // 122 | // metroToolTip1 123 | // 124 | this.metroToolTip1.Style = MetroFramework.MetroColorStyle.Default; 125 | this.metroToolTip1.StyleManager = null; 126 | this.metroToolTip1.Theme = MetroFramework.MetroThemeStyle.Dark; 127 | // 128 | // ProfileBackground 129 | // 130 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; 131 | this.ClientSize = new System.Drawing.Size(360, 301); 132 | this.Controls.Add(this.picBox_steamBackground); 133 | this.Controls.Add(this.txtBox_steamprofile); 134 | this.Controls.Add(this.BTN_GETBackground); 135 | this.Controls.Add(this.lbl_clickonimginfo); 136 | this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 137 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 138 | this.MaximizeBox = false; 139 | this.Name = "ProfileBackground"; 140 | this.Resizable = false; 141 | this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; 142 | this.Style = MetroFramework.MetroColorStyle.Default; 143 | this.Text = "Mercury - Profile Background"; 144 | this.Theme = MetroFramework.MetroThemeStyle.Dark; 145 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ProfileBackground_FormClosing); 146 | this.Load += new System.EventHandler(this.ProfileBackground_Load); 147 | ((System.ComponentModel.ISupportInitialize)(this.picBox_steamBackground)).EndInit(); 148 | this.ResumeLayout(false); 149 | this.PerformLayout(); 150 | 151 | } 152 | 153 | #endregion 154 | 155 | private MetroFramework.Controls.MetroButton BTN_GETBackground; 156 | private MetroFramework.Controls.MetroTextBox txtBox_steamprofile; 157 | private System.Windows.Forms.PictureBox picBox_steamBackground; 158 | internal MetroFramework.Controls.MetroLabel lbl_clickonimginfo; 159 | private MetroFramework.Components.MetroToolTip metroToolTip1; 160 | } 161 | } -------------------------------------------------------------------------------- /MercuryBOT/SteamProfileBackground/ProfileBackground.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using AngleSharp.Html.Parser; 11 | using System; 12 | using System.Net; 13 | using System.Text; 14 | using System.Windows.Forms; 15 | using System.Text.RegularExpressions; 16 | using System.Diagnostics; 17 | using MercuryBOT.Helpers; 18 | using Win32Interop.Methods; 19 | using System.Drawing; 20 | using System.Linq; 21 | 22 | namespace MercuryBOT.SteamProfileBackground 23 | { 24 | public partial class ProfileBackground : MetroFramework.Forms.MetroForm 25 | { 26 | private string AppID = "none"; 27 | private readonly WebClient Web = new WebClient(); 28 | 29 | public ProfileBackground() 30 | { 31 | InitializeComponent(); 32 | this.Activate(); 33 | this.FormBorderStyle = FormBorderStyle.None; 34 | this.components.SetStyle(this); 35 | Region = System.Drawing.Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 36 | foreach (var button in this.Controls.OfType()) 37 | { 38 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, button.Width, button.Height, 5, 5); 39 | button.Region = Region.FromHrgn(ptr); 40 | Gdi32.DeleteObject(ptr); 41 | } 42 | } 43 | 44 | private void ProfileBackground_Load(object sender, EventArgs e) 45 | { 46 | picBox_steamBackground.Cursor = DefaultCursor; 47 | lbl_clickonimginfo.Visible = false; 48 | } 49 | 50 | private void BTN_GETBackground_Click(object sender, EventArgs e) 51 | { 52 | if (!string.IsNullOrEmpty(txtBox_steamprofile.Text)) { 53 | GETimage(); 54 | } 55 | } 56 | 57 | public void GETimage() 58 | { 59 | try 60 | { 61 | BTN_GETBackground.Enabled = false; 62 | 63 | var parser = new HtmlParser(); 64 | StringBuilder doc = new StringBuilder(Web.DownloadString(txtBox_steamprofile.Text)); 65 | 66 | var document = parser.ParseDocument(doc.ToString()); 67 | 68 | StringBuilder GetBackgroundClass = new StringBuilder(document.QuerySelector("div.no_header.profile_page.has_profile_background").OuterHtml); 69 | 70 | var linkParser = new Regex(@"\b(?:https?://|www\.)\S+\b", RegexOptions.Compiled | RegexOptions.IgnoreCase); //800iq 71 | 72 | Match aa = linkParser.Match(GetBackgroundClass.ToString()); 73 | if (aa.Success) 74 | { 75 | picBox_steamBackground.ImageLocation = aa.ToString(); 76 | AppID = Regex.Match(aa.ToString(), @"\d+").Value; 77 | 78 | lbl_clickonimginfo.Visible = true; 79 | picBox_steamBackground.Cursor = Cursors.Hand; 80 | BTN_GETBackground.Enabled = true; 81 | } 82 | } 83 | catch (Exception){ 84 | picBox_steamBackground.Cursor = DefaultCursor; 85 | AppID = "none"; 86 | lbl_clickonimginfo.Visible = false; 87 | BTN_GETBackground.Enabled = true; 88 | picBox_steamBackground.Image = null; 89 | InfoForm.InfoHelper.CustomMessageBox.Show("Info", "Steam profile cannot be private, sorry son."); 90 | return; 91 | } 92 | } 93 | 94 | private void PicBox_steamBackground_Click(object sender, EventArgs e) 95 | { 96 | 97 | 98 | string steamMarket = "https://steamcommunity.com/market/search?appid=753&category_753_Game%5B%5D=tag_app_{0}&q=background"; 99 | 100 | if (AppID != "none") 101 | { 102 | if (Program.CurrentProcesses.FirstOrDefault(x => x.ProcessName == "Steam") != null) 103 | { 104 | Process.Start("steam://openurl/" + string.Format(steamMarket, AppID)); 105 | } 106 | else 107 | { 108 | Process.Start(string.Format(steamMarket, AppID)); 109 | } 110 | } 111 | } 112 | 113 | private void ProfileBackground_FormClosing(object sender, FormClosingEventArgs e) 114 | { 115 | if (picBox_steamBackground.Image != null)//free up ram 116 | { 117 | picBox_steamBackground.Image.Dispose(); 118 | picBox_steamBackground.Image = null; 119 | } 120 | } 121 | } 122 | } -------------------------------------------------------------------------------- /MercuryBOT/SteamRep/SteamRepCheck.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.Helpers; 11 | using System; 12 | using System.Diagnostics; 13 | using System.Drawing; 14 | using System.Net; 15 | using System.Text.RegularExpressions; 16 | using Win32Interop.Methods; 17 | using System.Linq; 18 | 19 | namespace MercuryBOT.SteamRep 20 | { 21 | public partial class SteamRepCheck : MetroFramework.Forms.MetroForm 22 | { 23 | System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); 24 | 25 | public SteamRepCheck() 26 | { 27 | InitializeComponent(); 28 | this.components.SetStyle(this); 29 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 30 | foreach (var button in this.Controls.OfType()) 31 | { 32 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, button.Width, button.Height, 5, 5); 33 | button.Region = Region.FromHrgn(ptr); 34 | Gdi32.DeleteObject(ptr); 35 | } 36 | } 37 | 38 | static bool IsDigitsOnly(string str) 39 | { 40 | foreach (char c in str) 41 | { 42 | if (c < '0' || c > '9') 43 | return false; 44 | } 45 | 46 | return true; 47 | } 48 | private void btn_checkUser_Click(object sender, EventArgs e) 49 | { 50 | ProgressSpinner_SteamRepDelay.Visible = true; 51 | 52 | if (string.IsNullOrEmpty(txt_repSteamID.Text))//&& !txt_repSteamID.Text.StartsWith("765611") 53 | { 54 | Title_AlertScammer.Visible = false; 55 | ProgressSpinner_SteamRepDelay.Visible = false; 56 | InfoForm.InfoHelper.CustomMessageBox.Show("Error", "Insert a steam profile url / id32-64"); 57 | } 58 | else 59 | { 60 | var finalID = Extensions.AllToSteamId64(txt_repSteamID.Text); 61 | 62 | if (finalID != String.Empty) 63 | { 64 | using (WebClient a = new WebClient()) 65 | { 66 | var resp = a.DownloadString("https://steamcommunity.com/miniprofile/" + (Convert.ToUInt64(finalID) - 76561197960265728)); // 326iq 67 | picBox_SteamAvatar.ImageLocation = Regex.Match(resp, "", RegexOptions.IgnoreCase | RegexOptions.Compiled).Groups[1].Value; // slow but 983iq 68 | 69 | string SteamRepJsonGather = a.DownloadString("http://steamrep.com/api/beta4/reputation/" + finalID + "?json=1&extended=1"); 70 | 71 | var SteamRepJsonRead = SteamRepAPI.JsonSteamRep.FromJson(SteamRepJsonGather); 72 | 73 | Title_AlertScammer.Visible = true; 74 | switch (SteamRepJsonRead.Steamrep.Reputation.Summary) 75 | { 76 | case "CAUTION": 77 | Title_AlertScammer.BackColor = Color.Yellow; 78 | Title_AlertScammer.Text = "CAUTION"; 79 | break; 80 | case "SCAMMER": 81 | Title_AlertScammer.BackColor = Color.DarkRed; 82 | Title_AlertScammer.Text = "SCAMMER"; 83 | break; 84 | default: 85 | Title_AlertScammer.BackColor = Color.DarkGreen; 86 | Title_AlertScammer.Text = "CLEAN"; 87 | break; 88 | } 89 | lbl_checkUsername.Text = SteamRepJsonRead.Steamrep.Rawdisplayname; 90 | lbl_steamid32.Text = SteamRepJsonRead.Steamrep.SteamId32; 91 | lbl_steamID64.Text = finalID; 92 | } 93 | timer.Interval = 5000; 94 | timer.Tick += AntiSpam_Tick; 95 | timer.Start(); 96 | btn_checkUser.Enabled = false; 97 | } 98 | } 99 | } 100 | 101 | private void metroLink_steamrep_Click(object sender, EventArgs e) 102 | { 103 | Process.Start("https://steamrep.com/"); 104 | Process.Start("https://forums.steamrep.com/threads/steamrep-web-api-beta4-legacy-public.114688/"); 105 | } 106 | 107 | private void Title_AlertScammer_Click(object sender, EventArgs e) 108 | { 109 | Process.Start("https://steamrep.com/search?q=" + txt_repSteamID.Text); 110 | } 111 | 112 | private void AntiSpam_Tick(object sender, EventArgs e) 113 | { 114 | ProgressSpinner_SteamRepDelay.Visible = false; 115 | 116 | btn_checkUser.Enabled = true; 117 | timer.Stop(); 118 | } 119 | 120 | private void picBox_SteamAvatar_Click(object sender, EventArgs e) 121 | { 122 | if (!string.IsNullOrEmpty(txt_repSteamID.Text) && txt_repSteamID.Text.StartsWith("765611")) 123 | { 124 | Process.Start("http://steamcommunity.com/profiles/" + txt_repSteamID); 125 | } 126 | } 127 | } 128 | } -------------------------------------------------------------------------------- /MercuryBOT/UpdateManager/Updater.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MercuryBOT 2 | { 3 | partial class Update 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Update)); 32 | this.txtBox_changelog = new MetroFramework.Controls.MetroTextBox(); 33 | this.btn_installupdate = new MetroFramework.Controls.MetroButton(); 34 | this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); 35 | this.metroLabel2 = new MetroFramework.Controls.MetroLabel(); 36 | this.lbl_infoversion = new MetroFramework.Controls.MetroLabel(); 37 | this.SuspendLayout(); 38 | // 39 | // txtBox_changelog 40 | // 41 | // 42 | // 43 | // 44 | this.txtBox_changelog.CustomButton.Image = null; 45 | this.txtBox_changelog.CustomButton.Location = new System.Drawing.Point(102, 2); 46 | this.txtBox_changelog.CustomButton.Name = ""; 47 | this.txtBox_changelog.CustomButton.Size = new System.Drawing.Size(291, 291); 48 | this.txtBox_changelog.CustomButton.Style = MetroFramework.MetroColorStyle.Blue; 49 | this.txtBox_changelog.CustomButton.TabIndex = 1; 50 | this.txtBox_changelog.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light; 51 | this.txtBox_changelog.CustomButton.UseSelectable = true; 52 | this.txtBox_changelog.CustomButton.Visible = false; 53 | this.txtBox_changelog.ForeColor = System.Drawing.SystemColors.AppWorkspace; 54 | this.txtBox_changelog.Lines = new string[0]; 55 | this.txtBox_changelog.Location = new System.Drawing.Point(8, 131); 56 | this.txtBox_changelog.MaxLength = 32767; 57 | this.txtBox_changelog.Multiline = true; 58 | this.txtBox_changelog.Name = "txtBox_changelog"; 59 | this.txtBox_changelog.PasswordChar = '\0'; 60 | this.txtBox_changelog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; 61 | this.txtBox_changelog.SelectedText = ""; 62 | this.txtBox_changelog.SelectionLength = 0; 63 | this.txtBox_changelog.SelectionStart = 0; 64 | this.txtBox_changelog.ShortcutsEnabled = true; 65 | this.txtBox_changelog.Size = new System.Drawing.Size(396, 296); 66 | this.txtBox_changelog.TabIndex = 10; 67 | this.txtBox_changelog.TabStop = false; 68 | this.txtBox_changelog.UseCustomBackColor = true; 69 | this.txtBox_changelog.UseCustomForeColor = true; 70 | this.txtBox_changelog.UseSelectable = true; 71 | this.txtBox_changelog.UseStyleColors = true; 72 | this.txtBox_changelog.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109))))); 73 | this.txtBox_changelog.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel); 74 | // 75 | // btn_installupdate 76 | // 77 | this.btn_installupdate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(34)))), ((int)(((byte)(34))))); 78 | this.btn_installupdate.ForeColor = System.Drawing.Color.White; 79 | this.btn_installupdate.Location = new System.Drawing.Point(329, 433); 80 | this.btn_installupdate.Name = "btn_installupdate"; 81 | this.btn_installupdate.Size = new System.Drawing.Size(75, 23); 82 | this.btn_installupdate.TabIndex = 1; 83 | this.btn_installupdate.Text = "Install"; 84 | this.btn_installupdate.UseCustomBackColor = true; 85 | this.btn_installupdate.UseSelectable = true; 86 | this.btn_installupdate.UseStyleColors = true; 87 | this.btn_installupdate.Click += new System.EventHandler(this.Btn_installupdate_Click); 88 | // 89 | // metroLabel1 90 | // 91 | this.metroLabel1.AutoSize = true; 92 | this.metroLabel1.FontWeight = MetroFramework.MetroLabelWeight.Bold; 93 | this.metroLabel1.ForeColor = System.Drawing.SystemColors.AppWorkspace; 94 | this.metroLabel1.Location = new System.Drawing.Point(6, 112); 95 | this.metroLabel1.Name = "metroLabel1"; 96 | this.metroLabel1.Size = new System.Drawing.Size(85, 19); 97 | this.metroLabel1.TabIndex = 11; 98 | this.metroLabel1.Text = "Changelog:"; 99 | this.metroLabel1.UseCustomBackColor = true; 100 | this.metroLabel1.UseCustomForeColor = true; 101 | this.metroLabel1.UseStyleColors = true; 102 | // 103 | // metroLabel2 104 | // 105 | this.metroLabel2.AutoSize = true; 106 | this.metroLabel2.FontSize = MetroFramework.MetroLabelSize.Tall; 107 | this.metroLabel2.FontWeight = MetroFramework.MetroLabelWeight.Regular; 108 | this.metroLabel2.ForeColor = System.Drawing.SystemColors.AppWorkspace; 109 | this.metroLabel2.Location = new System.Drawing.Point(6, 74); 110 | this.metroLabel2.Name = "metroLabel2"; 111 | this.metroLabel2.Size = new System.Drawing.Size(309, 25); 112 | this.metroLabel2.TabIndex = 12; 113 | this.metroLabel2.Text = "A new version of Mercury is available!"; 114 | this.metroLabel2.UseCustomBackColor = true; 115 | this.metroLabel2.UseCustomForeColor = true; 116 | this.metroLabel2.UseStyleColors = true; 117 | // 118 | // lbl_infoversion 119 | // 120 | this.lbl_infoversion.Cursor = System.Windows.Forms.Cursors.Hand; 121 | this.lbl_infoversion.FontSize = MetroFramework.MetroLabelSize.Small; 122 | this.lbl_infoversion.ForeColor = System.Drawing.SystemColors.AppWorkspace; 123 | this.lbl_infoversion.Location = new System.Drawing.Point(321, 74); 124 | this.lbl_infoversion.Name = "lbl_infoversion"; 125 | this.lbl_infoversion.Size = new System.Drawing.Size(81, 25); 126 | this.lbl_infoversion.TabIndex = 46; 127 | this.lbl_infoversion.Text = "v"; 128 | this.lbl_infoversion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 129 | this.lbl_infoversion.Theme = MetroFramework.MetroThemeStyle.Dark; 130 | this.lbl_infoversion.UseCustomBackColor = true; 131 | this.lbl_infoversion.UseStyleColors = true; 132 | // 133 | // Update 134 | // 135 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; 136 | this.ClientSize = new System.Drawing.Size(413, 469); 137 | this.Controls.Add(this.lbl_infoversion); 138 | this.Controls.Add(this.metroLabel2); 139 | this.Controls.Add(this.btn_installupdate); 140 | this.Controls.Add(this.txtBox_changelog); 141 | this.Controls.Add(this.metroLabel1); 142 | this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 143 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 144 | this.MaximizeBox = false; 145 | this.Name = "Update"; 146 | this.Resizable = false; 147 | this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow; 148 | this.Style = MetroFramework.MetroColorStyle.Default; 149 | this.Text = "New Update Available"; 150 | this.Theme = MetroFramework.MetroThemeStyle.Dark; 151 | this.TopMost = true; 152 | this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Update_FormClosed); 153 | this.Load += new System.EventHandler(this.Update_Load); 154 | this.Shown += new System.EventHandler(this.Update_Shown); 155 | this.ResumeLayout(false); 156 | this.PerformLayout(); 157 | 158 | } 159 | 160 | #endregion 161 | 162 | private MetroFramework.Controls.MetroTextBox txtBox_changelog; 163 | private MetroFramework.Controls.MetroButton btn_installupdate; 164 | private MetroFramework.Controls.MetroLabel metroLabel1; 165 | private MetroFramework.Controls.MetroLabel metroLabel2; 166 | private MetroFramework.Controls.MetroLabel lbl_infoversion; 167 | } 168 | } -------------------------------------------------------------------------------- /MercuryBOT/UpdateManager/Updater.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using MercuryBOT.Helpers; 11 | using System; 12 | using System.Diagnostics; 13 | using System.IO; 14 | using System.Media; 15 | using System.Net; 16 | using System.Windows.Forms; 17 | using Win32Interop.Methods; 18 | using System.Drawing; 19 | using Newtonsoft.Json; 20 | using MercuryBOT.User2Json; 21 | 22 | namespace MercuryBOT 23 | { 24 | public partial class Update : MetroFramework.Forms.MetroForm 25 | { 26 | public Update(string up) 27 | { 28 | InitializeComponent(); 29 | 30 | lbl_infoversion.Text = up; 31 | this.components.SetStyle(this); 32 | Region = Region.FromHrgn(Gdi32.CreateRoundRectRgn(0, 0, Width, Height, 5, 5)); 33 | 34 | IntPtr ptr = Gdi32.CreateRoundRectRgn(1, 1, btn_installupdate.Width, btn_installupdate.Height, 5, 5); 35 | btn_installupdate.Region = Region.FromHrgn(ptr); 36 | Gdi32.DeleteObject(ptr); 37 | } 38 | 39 | private void Update_Load(object sender, EventArgs e) 40 | { 41 | this.Activate(); 42 | new SoundPlayer(Mercury.Properties.Resources.mercury_update).Play(); 43 | } 44 | 45 | private void Update_Shown(object sender, EventArgs e) 46 | { 47 | RetrieveChangelog(); 48 | } 49 | 50 | private void RetrieveChangelog() 51 | { 52 | try 53 | { 54 | using (WebClient client = new WebClient()) 55 | { 56 | client.Encoding = System.Text.Encoding.UTF8; 57 | txtBox_changelog.Text += client.DownloadString(Program.spkDomain + "update-changelog.php"); 58 | } 59 | } 60 | catch (Exception) 61 | { 62 | InfoForm.InfoHelper.CustomMessageBox.Show("Error", "sp0ok3r website is down, please check for new updates in github!"); 63 | Process.Start("https://github.com/sp0ok3r/Mercury/releases"); 64 | } 65 | } 66 | 67 | private void Update_FormClosed(object sender, FormClosedEventArgs e) 68 | { 69 | Application.Exit(); 70 | } 71 | 72 | private void Btn_installupdate_Click(object sender, EventArgs e) 73 | { 74 | Process.Start(Program.ExecutablePath); 75 | //Process.Start("https://github.com/sp0ok3r/Mercury/releases/tag/" + lbl_infoversion.Text); 76 | Process.Start("https://github.com/sp0ok3r/Mercury/releases/"); 77 | 78 | 79 | var SettingsList = JsonConvert.DeserializeObject(File.ReadAllText(Program.SettingsJsonFile)); 80 | SettingsList.LastTimeCheckedUpdate = DateTime.Now.ToString(); 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /MercuryBOT/User2Json/Comments.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using System; 11 | using System.Collections.Generic; 12 | 13 | namespace MercuryBOT.CommentPage 14 | { 15 | class CommentPage 16 | { 17 | /// 18 | /// The title of the thread. 19 | /// 20 | public string Title { get; internal set; } 21 | 22 | /// 23 | /// The original post made to start the thread. 24 | /// 25 | public Comment OriginalPost { get; internal set; } 26 | 27 | /// 28 | /// List of every other comment made on the page, accending to the newest being last. 29 | /// 30 | public List Comments { get; internal set; } 31 | public CommentPage() 32 | { 33 | Comments = new List(); 34 | } 35 | } 36 | 37 | class Comment 38 | { 39 | /// 40 | /// A unique identifier for the comment. If the first post in a topic, then it will match the topic id. 41 | /// 42 | public string Id { get; internal set; } 43 | 44 | /// 45 | /// The author of the comment 46 | /// 47 | public AuthorDetail Author { get; internal set; } 48 | 49 | /// 50 | /// The time the comment was made 51 | /// 52 | public DateTime Posted { get; internal set; } 53 | 54 | /// 55 | /// The contents of the comment 56 | /// 57 | public string Content { get; internal set; } 58 | 59 | /// 60 | /// A hotlink to the comment 61 | /// 62 | public string Link { get; internal set; } 63 | 64 | public struct AuthorDetail 65 | { 66 | /// 67 | /// Name of the author 68 | /// 69 | public string Name { get; internal set; } 70 | 71 | /// 72 | /// Link to the author's profile 73 | /// 74 | public string Profile { get; internal set; } 75 | 76 | /// 77 | /// The URL to the author's avatar 78 | /// 79 | public string AvatarURL { get; internal set; } 80 | 81 | public override string ToString() 82 | { 83 | return Name; 84 | } 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /MercuryBOT/User2Json/MercurySettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using Newtonsoft.Json; 11 | 12 | namespace MercuryBOT.User2Json 13 | { 14 | public partial class MercurySettings 15 | { 16 | public int startupColor { get; set; } 17 | public bool playsound { get; set; } 18 | 19 | public bool hideInTaskBar { get; set; } 20 | public bool startup { get; set; } 21 | 22 | public int startupTab { get; set; } 23 | 24 | public ulong startupAcc { get; set; } 25 | public bool startMinimized { get; set; } 26 | //public string notificationEffect { get; set; } 27 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 28 | public string LastTimeCheckedUpdate { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /MercuryBOT/User2Json/SteamComments.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | namespace SteamComments 11 | { 12 | using System.Globalization; 13 | using Newtonsoft.Json; 14 | using Newtonsoft.Json.Converters; 15 | 16 | public partial class RenderComments 17 | { 18 | [JsonProperty("success")] 19 | public bool Success { get; set; } 20 | 21 | [JsonProperty("name")] 22 | public string Name { get; set; } 23 | 24 | [JsonProperty("start")] 25 | public long Start { get; set; } 26 | 27 | [JsonProperty("pagesize")] 28 | public long Pagesize { get; set; } 29 | 30 | [JsonProperty("total_count")] 31 | public long TotalCount { get; set; } 32 | 33 | [JsonProperty("upvotes")] 34 | public long Upvotes { get; set; } 35 | 36 | [JsonProperty("has_upvoted")] 37 | public long HasUpvoted { get; set; } 38 | 39 | [JsonProperty("comments_html")] 40 | public string CommentsHtml { get; set; } 41 | 42 | [JsonProperty("timelastpost")] 43 | public long Timelastpost { get; set; } 44 | } 45 | 46 | public partial class RenderComments 47 | { 48 | public static RenderComments FromJson(string json) => JsonConvert.DeserializeObject(json, SteamComments.Converter.Settings); 49 | } 50 | 51 | public static class Serialize 52 | { 53 | public static string ToJson(this RenderComments self) => JsonConvert.SerializeObject(self, SteamComments.Converter.Settings); 54 | } 55 | 56 | internal static class Converter 57 | { 58 | public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings 59 | { 60 | MetadataPropertyHandling = MetadataPropertyHandling.Ignore, 61 | DateParseHandling = DateParseHandling.None, 62 | Converters = 63 | { 64 | new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } 65 | }, 66 | }; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /MercuryBOT/User2Json/SteamLoginUsers.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using Gameloop.Vdf.Linq; 11 | using System; 12 | 13 | namespace MercuryBOT.User2Json 14 | { 15 | public class SteamLoginUsers 16 | { 17 | public SteamLoginUsers(VProperty volvo) 18 | { 19 | SteamId64 = ulong.Parse(volvo.Key); 20 | AccountName = volvo.Value[@"AccountName"].ToString(); 21 | PersonaName = volvo.Value[@"PersonaName"].ToString(); 22 | RememberPassword = int.Parse(volvo.Value[@"RememberPassword"].ToString()) == 1; 23 | //MostRecent = int.Parse(volvo.Value[@"Mostrecent"].ToString()) == 1; 24 | LastLoginTime = volvo.Value[@"Timestamp"].ToString(); 25 | //Helpers.Extensions.GetTime(volvo.Value[@"Timestamp"].ToString()); 26 | } 27 | 28 | public ulong SteamId64 { get; } 29 | 30 | public string AccountName { get; } 31 | 32 | public string PersonaName { get; } 33 | 34 | public bool RememberPassword { get; } 35 | 36 | public bool MostRecent { get; } 37 | 38 | public string LastLoginTime { get; } 39 | } 40 | } -------------------------------------------------------------------------------- /MercuryBOT/User2Json/SteamPlayerLevel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | namespace SteamPlayerLevel 11 | { 12 | using Newtonsoft.Json; 13 | using Newtonsoft.Json.Converters; 14 | using System.Globalization; 15 | 16 | public partial class PlayerLevel 17 | { 18 | [JsonProperty("response")] 19 | public Response Response { get; set; } 20 | } 21 | 22 | public partial class Response 23 | { 24 | [JsonProperty("player_level")] 25 | public long PlayerLevel { get; set; } 26 | } 27 | 28 | public partial class PlayerLevel 29 | { 30 | public static PlayerLevel FromJson(string json) => JsonConvert.DeserializeObject(json, SteamPlayerLevel.Converter.Settings); 31 | } 32 | 33 | internal static class Converter 34 | { 35 | public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings 36 | { 37 | MetadataPropertyHandling = MetadataPropertyHandling.Ignore, 38 | DateParseHandling = DateParseHandling.None, 39 | Converters = 40 | { 41 | new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } 42 | }, 43 | }; 44 | } 45 | } -------------------------------------------------------------------------------- /MercuryBOT/User2Json/SteamProfilePrivacy.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | namespace SteamProfilePrivacy 11 | { 12 | using System.Globalization; 13 | using Newtonsoft.Json; 14 | using Newtonsoft.Json.Converters; 15 | 16 | public partial class RenderProfilePrivacy 17 | { 18 | [JsonProperty("PrivacySettings")] 19 | public PrivacySettings PrivacySettings { get; set; } 20 | 21 | [JsonProperty("eCommentPermission")] 22 | public int ECommentPermission { get; set; } 23 | } 24 | 25 | public partial class PrivacySettings 26 | { 27 | [JsonProperty("PrivacyProfile")] 28 | public int PrivacyProfile { get; set; } 29 | 30 | [JsonProperty("PrivacyInventory")] 31 | public int PrivacyInventory { get; set; } 32 | 33 | [JsonProperty("PrivacyInventoryGifts")] 34 | public int PrivacyInventoryGifts { get; set; } 35 | 36 | [JsonProperty("PrivacyOwnedGames")] 37 | public int PrivacyOwnedGames { get; set; } 38 | 39 | [JsonProperty("PrivacyPlaytime")] 40 | public int PrivacyPlaytime { get; set; } 41 | 42 | [JsonProperty("PrivacyFriendsList")] 43 | public int PrivacyFriendsList { get; set; } 44 | } 45 | 46 | public partial class RenderProfilePrivacy 47 | { 48 | public static RenderProfilePrivacy FromJson(string json) => JsonConvert.DeserializeObject(json, SteamProfilePrivacy.Converter.Settings); 49 | } 50 | 51 | internal static class Converter 52 | { 53 | public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings 54 | { 55 | MetadataPropertyHandling = MetadataPropertyHandling.Ignore, 56 | DateParseHandling = DateParseHandling.None, 57 | Converters = 58 | { 59 | new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } 60 | }, 61 | }; 62 | } 63 | } -------------------------------------------------------------------------------- /MercuryBOT/User2Json/SteamRepApi.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | namespace SteamRepAPI 11 | { 12 | using System; 13 | using System.Globalization; 14 | using Newtonsoft.Json; 15 | using Newtonsoft.Json.Converters; 16 | 17 | public partial class JsonSteamRep 18 | { 19 | [JsonProperty("steamrep")] 20 | public Steamrep Steamrep { get; set; } 21 | } 22 | 23 | public partial class Steamrep 24 | { 25 | [JsonProperty("flags")] 26 | public Flags Flags { get; set; } 27 | 28 | [JsonProperty("steamID32")] 29 | public string SteamId32 { get; set; } 30 | 31 | [JsonProperty("steamID64")] 32 | public string SteamId64 { get; set; } 33 | 34 | [JsonProperty("steamrepurl")] 35 | public Uri Steamrepurl { get; set; } 36 | 37 | [JsonProperty("displayname")] 38 | public string Displayname { get; set; } 39 | 40 | [JsonProperty("rawdisplayname")] 41 | public string Rawdisplayname { get; set; } 42 | 43 | [JsonProperty("avatar")] 44 | public Uri Avatar { get; set; } 45 | 46 | [JsonProperty("membersince")] 47 | 48 | public long Membersince { get; set; } 49 | 50 | [JsonProperty("customurl")] 51 | public string Customurl { get; set; } 52 | 53 | [JsonProperty("tradeban")] 54 | 55 | public long Tradeban { get; set; } 56 | 57 | [JsonProperty("vacban")] 58 | 59 | public long Vacban { get; set; } 60 | 61 | [JsonProperty("lastsynctime")] 62 | 63 | public long Lastsynctime { get; set; } 64 | 65 | [JsonProperty("reputation")] 66 | public Reputation Reputation { get; set; } 67 | 68 | [JsonProperty("stats")] 69 | public Stats Stats { get; set; } 70 | } 71 | 72 | public partial class Flags 73 | { 74 | [JsonProperty("status")] 75 | public string Status { get; set; } 76 | } 77 | 78 | public partial class Reputation 79 | { 80 | [JsonProperty("full")] 81 | public string Full { get; set; } 82 | 83 | [JsonProperty("summary")] 84 | public string Summary { get; set; } 85 | } 86 | 87 | public partial class Stats 88 | { 89 | [JsonProperty("bannedfriends")] 90 | 91 | public long Bannedfriends { get; set; } 92 | 93 | [JsonProperty("unconfirmedreports")] 94 | public Unconfirmedreports Unconfirmedreports { get; set; } 95 | } 96 | 97 | public partial class Unconfirmedreports 98 | { 99 | [JsonProperty("reportcount")] 100 | 101 | public long Reportcount { get; set; } 102 | 103 | [JsonProperty("reportlink")] 104 | public Uri Reportlink { get; set; } 105 | } 106 | 107 | public partial class JsonSteamRep 108 | { 109 | public static JsonSteamRep FromJson(string json) => JsonConvert.DeserializeObject(json, SteamRepAPI.Converter.Settings); 110 | } 111 | internal static class Converter 112 | { 113 | public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings 114 | { 115 | MetadataPropertyHandling = MetadataPropertyHandling.Ignore, 116 | DateParseHandling = DateParseHandling.None, 117 | Converters = 118 | { 119 | new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } 120 | }, 121 | }; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /MercuryBOT/User2Json/UserSettings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | ▄▀▀▄ ▄▀▄ ▄▀▀█▄▄▄▄ ▄▀▀▄▀▀▀▄ ▄▀▄▄▄▄ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄▀▀▀▄ ▄▀▀▄ ▀▀▄ 3 | █ █ ▀ █ ▐ ▄▀ ▐ █ █ █ █ █ ▌ █ █ █ █ █ █ █ ▀▄ ▄▀ 4 | ▐ █ █ █▄▄▄▄▄ ▐ █▀▀█▀ ▐ █ ▐ █ █ ▐ █▀▀█▀ ▐ █ 5 | █ █ █ ▌ ▄▀ █ █ █ █ ▄▀ █ █ 6 | ▄▀ ▄▀ ▄▀▄▄▄▄ █ █ ▄▀▄▄▄▄▀ ▀▄▄▄▄▀ █ █ ▄▀ 7 | █ █ █ ▐ ▐ ▐ █ ▐ ▐ ▐ █ 8 | ▐ ▐ ▐ ▐ ▐ 9 | */ 10 | using Newtonsoft.Json; 11 | using Newtonsoft.Json.Converters; 12 | using System; 13 | using System.Collections.Generic; 14 | using System.Globalization; 15 | 16 | namespace MercuryBOT.UserSettings 17 | { 18 | public partial class UserAccounts 19 | { 20 | [JsonProperty("LastLoginTime")] 21 | public string LastLoginTime { get; set; } 22 | //DateTime 23 | [JsonProperty("AdminID")] 24 | public ulong AdminID { get; set; } 25 | 26 | [JsonProperty("LoginState")] 27 | public int LoginState { get; set; } 28 | 29 | [JsonProperty("username")] 30 | public string username { get; set; } 31 | 32 | [JsonProperty("password")] 33 | public string password { get; set; } 34 | 35 | [JsonProperty("LoginKey")] 36 | public string LoginKey { get; set; } 37 | 38 | [JsonProperty("APIWebKey")] 39 | public string APIWebKey { get; set; } 40 | 41 | [JsonProperty("SteamID")] 42 | public ulong SteamID { get; set; } 43 | 44 | [JsonProperty("ChatLogger")] 45 | public bool ChatLogger { get; set; } 46 | 47 | [JsonProperty("Games")] 48 | public List Games { get; set; } 49 | 50 | [JsonProperty("AFKMessages")] 51 | public List AFKMessages { get; set; } 52 | 53 | [JsonProperty("MsgRecipients")] 54 | public List MsgRecipients { get; set; } 55 | 56 | } 57 | public class Game 58 | { 59 | [JsonProperty("app_id")] 60 | public uint app_id { get; set; } 61 | 62 | [JsonProperty("name")] 63 | public string name { get; set; } 64 | } 65 | 66 | public class CustomMessages 67 | { 68 | [JsonProperty("Message")] 69 | public string Message { get; set; } 70 | } 71 | 72 | public class RootObject 73 | { 74 | public List Accounts { get; set; } 75 | } 76 | 77 | public partial class UserAccounts 78 | { 79 | public static UserAccounts FromJson(string json) => JsonConvert.DeserializeObject(json, UserSettings.Converter.Settings); 80 | } 81 | 82 | public static class Serialize 83 | { 84 | public static string ToJson(this UserAccounts self) => JsonConvert.SerializeObject(self, UserSettings.Converter.Settings); 85 | } 86 | 87 | internal static class Converter 88 | { 89 | public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings 90 | { 91 | MetadataPropertyHandling = MetadataPropertyHandling.Ignore, 92 | DateParseHandling = DateParseHandling.None, 93 | Converters = 94 | { 95 | new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } 96 | }, 97 | }; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /MercuryBOT/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /MercuryBOT/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 58 | 59 | 60 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /MercuryBOT/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Mercury Logo 3 |

4 |

5 | Mercury Banner 6 |

7 | 8 |

9 | Windows 10 | C# 11 | Downloads 12 |

13 | 14 | --- 15 | 16 |

Mercury: The Ultimate Steam Tool

17 |

An advanced C# tool for comprehensive Steam management and automation.

18 | 19 |
20 | Mercury Demo 21 |
22 | 23 | --- 24 | 25 | ## Key Features 26 | - **Quick Account Switching**: Easily switch between multiple Steam accounts. 27 | - **Customizable UI**: Choose from various themes and colors. 28 | - **Auto Login**: Log in to Steam automatically at system startup. 29 | - **Account Detection**: Auto-detect and load all accounts on your PC. 30 | - **ChatLogger*": Saves all messages to file. 31 | - **AFK Responder**: Set custom away messages. 32 | - **Friend Management**: Remove inactive friends by log-off status. 33 | - **Admin Controls**: Manage alt accounts with admin commands. 34 | - **Multi-Game Launching**: Launch up to 32 games simultaneously. 35 | - **Non-Steam Game Support**: Integrate and play non-Steam games. 36 | - **Batch CD-KEY Redeemer**: Redeem multiple keys at once. 37 | - **Group Management**: Mass invite, leave groups, and send announcements. 38 | - **CS:GO Clan Binds**: Create custom clan bindings. 39 | - **Background Collector**: Collect profile backgrounds and marketplace links. 40 | - **Extra Tools**: Clear profile aliases, set "Player of the Week," send mass messages, and more. 41 | 42 | ### Getting Started 43 | 1. Ensure your .NET Framework is up to date: [Download .NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472). 44 | 2. Download the latest Mercury release from the [releases page](https://github.com/sp0ok3r/Mercury/releases/). 45 | 3. Extract the files and run Mercury. 46 | 47 | ### Troubleshooting 48 | - **Mercury won’t open?** Ensure your .NET Framework is updated: [Download .NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472). 49 | - **Compiling Issues**: Missing `Steam4NET`? [Download here](https://mega.nz/#F!oKxWkQyC!5D79iBNX0ynPImn5ekG_PA). 50 | - **"LastTimeCheckedUpdate" Error**: Edit `settings.json` and set "LastTimeCheckedUpdate" to an empty string, then save and retry. 51 | - **Clear Recent Games Not Working**: Play three videos from [Making of Furi](https://store.steampowered.com/app/629150/1/1/), and it should work until Steam patches it. 52 | 53 | --- 54 | 55 | ### Contact & Support 56 | - [Join our Discord community](https://discord.gg/7e7kuhp) for discussions and support. 57 | - [Connect on Steam](http://steamcommunity.com/profiles/76561198041931474) for questions and feedback. 58 | 59 | ### Images & Demonstrations 60 |

61 | Account Detection 62 | AFK Responder 63 | Group Management 64 |

65 | 66 | --- 67 | 68 | ### Other Projects 69 | - Check out [ChatLogger](https://github.com/sp0ok3r/ChatLogger) for chat logging functionalities. 70 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-midnight -------------------------------------------------------------------------------- /img/MercuryIconLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/img/MercuryIconLogo.png -------------------------------------------------------------------------------- /img/MercuryLogoWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/img/MercuryLogoWhite.png -------------------------------------------------------------------------------- /img/mercury_login64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sp0ok3r/Mercury/7215c512e3cdbf676b2dd318390d066d81c9d008/img/mercury_login64.gif --------------------------------------------------------------------------------