├── ShopeeAutobuyBot ├── 2015085.ico ├── Resources │ ├── cashing.mp3 │ ├── htuachecker.exe │ ├── Settings.settings │ └── Settings.Designer.cs ├── icons8-shopee-100.ico ├── Constants │ ├── ResponseStatus.cs │ ├── BuyingMode.cs │ ├── Urls.cs │ ├── AutoBuyInfo.cs │ ├── DirectoryPaths.cs │ └── ElementXpath.cs ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Models │ ├── Mode.cs │ ├── MaintenanceModel.cs │ ├── ProgramInfoModel.cs │ ├── UserModel.cs │ ├── DelayModel.cs │ ├── ProfileModel.cs │ └── ElementModel.cs ├── Services │ ├── Notification │ │ ├── INotificationService.cs │ │ └── NotificationService.cs │ ├── AutoBuy │ │ └── IAutoBuyService.cs │ ├── Logger │ │ ├── IAutoBuyLoggerService.cs │ │ └── AutoBuyLoggerService.cs │ ├── Profile │ │ ├── IProfileService.cs │ │ └── ProfileService.cs │ └── Selenium │ │ ├── ISeleniumService.cs │ │ └── SeleniumService.cs ├── Utililties │ ├── ChromeDriver.cs │ ├── SettingsHelper.cs │ ├── db.cs │ ├── Encryption.cs │ ├── SeleniumHandler.cs │ └── Helper.cs ├── Extensions │ └── RichTextBoxExtensions.cs ├── Forms │ ├── Changelog │ │ ├── ChangelogHistory.cs │ │ └── ChangelogHistory.Designer.cs │ ├── Element Editor │ │ └── Element Editor.cs │ ├── Login │ │ └── Login.Designer.cs │ └── Scan Payday Sale │ │ ├── Scan payday sale.Designer.cs │ │ └── Scan payday sale.cs ├── Program.cs ├── App.config └── Shopee Autobuy Bot.csproj ├── GetChromeVersion ├── GetChromeVersion.csproj └── Program.cs ├── Settings ├── config.settings └── element.settings ├── ShopeeAutobuyBot.sln ├── .gitattributes ├── README.md └── .gitignore /ShopeeAutobuyBot/2015085.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pearlxcore/Shopee-Autobuy-Bot/HEAD/ShopeeAutobuyBot/2015085.ico -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Resources/cashing.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pearlxcore/Shopee-Autobuy-Bot/HEAD/ShopeeAutobuyBot/Resources/cashing.mp3 -------------------------------------------------------------------------------- /ShopeeAutobuyBot/icons8-shopee-100.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pearlxcore/Shopee-Autobuy-Bot/HEAD/ShopeeAutobuyBot/icons8-shopee-100.ico -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Resources/htuachecker.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pearlxcore/Shopee-Autobuy-Bot/HEAD/ShopeeAutobuyBot/Resources/htuachecker.exe -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Constants/ResponseStatus.cs: -------------------------------------------------------------------------------- 1 | namespace Shopee_Autobuy_Bot.Constants 2 | { 3 | public class ResponseStatus 4 | { 5 | public const string SUCCESS = "success"; 6 | public const string ERROR = "error"; 7 | } 8 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Models/Mode.cs: -------------------------------------------------------------------------------- 1 | namespace Shopee_Autobuy_Bot.Models 2 | { 3 | public enum Mode 4 | { 5 | normal, 6 | cart_checkout, 7 | flash, 8 | below_price, 9 | below_price_cart 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Models/MaintenanceModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Shopee_Autobuy_Bot.Models 4 | { 5 | public class MaintenanceModel 6 | { 7 | public int status { get; set; } 8 | public List exclude { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /GetChromeVersion/GetChromeVersion.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Models/ProgramInfoModel.cs: -------------------------------------------------------------------------------- 1 | namespace Shopee_Autobuy_Bot.Models 2 | { 3 | public class ProgramInfoModel 4 | { 5 | public string version { get; set; } 6 | public string date { get; set; } 7 | public string url { get; set; } 8 | public bool mandatory { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Services/Notification/INotificationService.cs: -------------------------------------------------------------------------------- 1 | using Shopee_Autobuy_Bot.Services.Profile; 2 | using System; 3 | 4 | namespace Shopee_Autobuy_Bot.Services.Notification 5 | { 6 | public interface INotificationService 7 | { 8 | void SendNotification(string sabAccount, IProfileService profileService, string orderPrice, TimeSpan checkoutTimeSpan); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Services/AutoBuy/IAutoBuyService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Shopee_Autobuy_Bot.Services 4 | { 5 | public interface IAutoBuyService 6 | { 7 | TimeSpan TotalTimeSpan { get; } 8 | TimeSpan CheckoutTimeSpan { get; } 9 | String TotalPayment { get; } 10 | void ShopeeAutobuy(DateTime? jobStartTime = null); 11 | bool Abort { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Constants/BuyingMode.cs: -------------------------------------------------------------------------------- 1 | namespace Shopee_Autobuy_Bot.Constants 2 | { 3 | public static class BuyingMode 4 | { 5 | public const string Normal = "Normal"; 6 | public const string Flash_Shocking = "Flash_Shocking"; 7 | public const string Below_Price = "Below_Price"; 8 | public const string Below_Price_Cart = "Below_Price_Cart"; 9 | public const string Cart = "Cart"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Settings/config.settings: -------------------------------------------------------------------------------- 1 | { 2 | "delay_step_94": 500, 3 | "delay_step_95": 300, 4 | "delay_step_96": 500, 5 | "delay_step_0": 0, 6 | "delay_step_1": 0, 7 | "delay_claim_shop_voucher": 700, 8 | "delay_any_shopee_voucher": 500, 9 | "delay_step_2": 300, 10 | "delay_step_3": 0, 11 | "delay_step_4": 0, 12 | "delay_step_5": 500, 13 | "delay_step_6": 200, 14 | "delay_shopee_pay": 800, 15 | "delay_redeem_coin": 300 16 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Utililties/ChromeDriver.cs: -------------------------------------------------------------------------------- 1 | using OpenQA.Selenium; 2 | using OpenQA.Selenium.Chrome; 3 | 4 | namespace Shopee_Autobuy_Bot.Utililties 5 | { 6 | public class ChromeDriverHelper 7 | { 8 | public IWebDriver driver { get; set; } 9 | public int driverProc { get; set; } 10 | public ChromeDriverService driverService = ChromeDriverService.CreateDefaultService(); 11 | public ChromeOptions options = new ChromeOptions(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Services/Logger/IAutoBuyLoggerService.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace Shopee_Autobuy_Bot.Services.Logger 5 | { 6 | public interface IAutoBuyLoggerService 7 | { 8 | public void AutoBuyProcessLog(string text, Color? color = null, bool NewLine = true, bool Production = true, bool WithDateTime = true); 9 | public void ProgramLog(); 10 | public void SaveAutoBuyProcessLogToLogFile(RichTextBox richTextBox); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Constants/Urls.cs: -------------------------------------------------------------------------------- 1 | namespace Shopee_Autobuy_Bot.Constants 2 | { 3 | public static class Urls 4 | { 5 | public const string Github = "github.com"; 6 | public static class SabSettings 7 | { 8 | public const string Configuration = "https://raw.githubusercontent.com/pearlxcore/Shopee-Autobuy-Bot/master/Settings/config.settings"; 9 | public const string Element = "https://raw.githubusercontent.com/pearlxcore/Shopee-Autobuy-Bot/master/Settings/element.settings"; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Constants/AutoBuyInfo.cs: -------------------------------------------------------------------------------- 1 | using Shopee_Autobuy_Bot.Models; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace Shopee_Autobuy_Bot.Constants 6 | { 7 | public static class AutoBuyInfo 8 | { 9 | public static string SAB_Account { get; set; } 10 | public static DateTime AutoBuyStartTime { get; set; } 11 | public static Dictionary CurrentElementDictionary = new Dictionary(); 12 | public static DelayModel ConfigInfo { get; set; } 13 | public static ElementModel.Root ConstantElements { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Models/UserModel.cs: -------------------------------------------------------------------------------- 1 | namespace Shopee_Autobuy_Bot.Models 2 | { 3 | public class UserModel 4 | { 5 | public string status { get; set; } 6 | public string id { get; set; } 7 | public string password { get; set; } 8 | public string name { get; set; } 9 | public bool online { get; set; } 10 | public string device_fingerprintv2 { get; set; } 11 | public string device_fingerprint1 { get; set; } 12 | public string device_fingerprint2 { get; set; } 13 | public string device_fingerprint3 { get; set; } 14 | public string expiry_date { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Services/Profile/IProfileService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Shopee_Autobuy_Bot.Services.Profile 4 | { 5 | public interface IProfileService 6 | { 7 | public bool DeleteProfile(string profileName); 8 | public List LoadProfiles(); 9 | public void CreateNewProfile(Utililties.ProfileModel.Root profile); 10 | public void UpdateExistingProfile(Utililties.ProfileModel.Root profile); 11 | Utililties.ProfileModel.Root SelectedProfile { get; set; } 12 | string NewProfileName { get; set; } 13 | bool LoadProfile { get; set; } 14 | bool IsSavingProfile { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Models/DelayModel.cs: -------------------------------------------------------------------------------- 1 | namespace Shopee_Autobuy_Bot.Models 2 | { 3 | public class DelayModel 4 | { 5 | public int delay_step_94 { get; set; } 6 | public int delay_step_95 { get; set; } 7 | public int delay_step_96 { get; set; } 8 | public int delay_step_0 { get; set; } 9 | public int delay_step_1 { get; set; } 10 | public int delay_claim_shop_voucher { get; set; } 11 | public int delay_any_shopee_voucher { get; set; } 12 | public int delay_step_2 { get; set; } 13 | public int delay_step_3 { get; set; } 14 | public int delay_step_4 { get; set; } 15 | public int delay_step_5 { get; set; } 16 | public int delay_step_6 { get; set; } 17 | public int delay_shopee_pay { get; set; } 18 | public int delay_redeem_coin { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /GetChromeVersion/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System.Diagnostics; 3 | 4 | namespace GetChromeVersion 5 | { 6 | internal class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | string registryPath; 11 | if (Environment.Is64BitOperatingSystem) 12 | registryPath =@"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe"; 13 | else 14 | registryPath = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe"; 15 | 16 | object path; 17 | string version = ""; 18 | path = Registry.GetValue(registryPath, "", null); 19 | 20 | if (path != null) 21 | { 22 | version = FileVersionInfo.GetVersionInfo(path.ToString()).FileVersion; 23 | } 24 | 25 | Console.WriteLine(version); 26 | Console.ReadLine(); 27 | } 28 | 29 | public static void GetChromeVersion() 30 | { 31 | 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Extensions/RichTextBoxExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Reflection; 4 | using System.Windows.Forms; 5 | 6 | namespace Shopee_Autobuy_Bot.Extensions 7 | { 8 | public static class RichTextBoxExtensions 9 | { 10 | public static void AppendText(this RichTextBox box, string text, Color color, bool AddNewLine = false) 11 | { 12 | try 13 | { 14 | if (AddNewLine) 15 | text += Environment.NewLine; 16 | box.SelectionStart = box.TextLength; 17 | box.SelectionLength = 0; 18 | box.SelectionColor = color; 19 | box.AppendText(text); 20 | box.SelectionColor = box.ForeColor; 21 | } 22 | catch { } 23 | 24 | } 25 | 26 | public static void DoubleBuffered(this DataGridView dgv, bool setting) 27 | { 28 | Type dgvType = dgv.GetType(); 29 | PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic); 30 | pi.SetValue(dgv, setting, null); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Constants/DirectoryPaths.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Shopee_Autobuy_Bot.Constants 4 | { 5 | public static class DirectoryPaths 6 | { 7 | public static readonly string SabTempDirectory = System.IO.Path.GetTempPath() + @"86dg5fd86g5d9f86b8d6\"; 8 | public static readonly string UserTempDirectory = System.IO.Path.GetTempPath(); 9 | public static readonly string LogDirectory = Environment.CurrentDirectory + @"\Configuration\Logs\"; 10 | public static readonly string SabProfileDirectory = Environment.CurrentDirectory + @"\Configuration\SAB profile\"; 11 | public static readonly string CurrentDirectory = Environment.CurrentDirectory + "\\"; 12 | public static readonly string ElementSettingsPath = Environment.CurrentDirectory + @"\Configuration\element.settings"; 13 | public static readonly string ProfileSettingsPath = Environment.CurrentDirectory + @"\Configuration\profile.settings"; 14 | public static readonly string ChromedriverPath = DirectoryPaths.CurrentDirectory + "chromedriver.exe"; 15 | public static readonly string ChromedriverZipPath = SabTempDirectory + "chromedriver.exe"; 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot/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 Shopee_Autobuy_Bot.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.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 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Utililties/SettingsHelper.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Shopee_Autobuy_Bot.Constants; 3 | using Shopee_Autobuy_Bot.Models; 4 | using System.IO; 5 | using System.Text; 6 | 7 | namespace Shopee_Autobuy_Bot.Utililties 8 | { 9 | public class SettingsHelper 10 | { 11 | public class Element 12 | { 13 | public static ElementModel.Root LoadElementsFromFile() 14 | { 15 | if (!File.Exists(DirectoryPaths.ElementSettingsPath)) 16 | return null; 17 | var text = File.ReadAllText(DirectoryPaths.ElementSettingsPath, Encoding.UTF8); 18 | var deserialized = JsonConvert.DeserializeObject(text); 19 | return deserialized; 20 | } 21 | 22 | public static void SaveElementsToFile(ElementModel.Root rootElement) 23 | { 24 | string jsonString = JsonConvert.SerializeObject(rootElement, Formatting.Indented); 25 | var elementPath = DirectoryPaths.ElementSettingsPath; 26 | File.WriteAllText(elementPath, jsonString); 27 | AutoBuyInfo.ConstantElements = rootElement; 28 | } 29 | } 30 | 31 | public class BotConfiguration 32 | { 33 | 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Forms/Changelog/ChangelogHistory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using System.Windows.Forms; 5 | 6 | namespace Shopee_Autobuy_Bot 7 | { 8 | public partial class ChangelogHistory : Form 9 | { 10 | public ChangelogHistory() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private void Form3_Load(object sender, EventArgs e) 16 | { 17 | //string changlogHistoryUrl = $"{Urls.Host}api/ChangelogHistory"; 18 | //string changelog = GetWithResponse(changlogHistoryUrl).Replace("\n", Environment.NewLine); 19 | //darkTextBox1.Text = changelog; 20 | } 21 | 22 | private string GetWithResponse(string url) 23 | { 24 | string html_ = string.Empty; 25 | 26 | HttpWebRequest request_ = (HttpWebRequest)WebRequest.Create(url); 27 | request_.AutomaticDecompression = DecompressionMethods.GZip; 28 | 29 | using (HttpWebResponse response = (HttpWebResponse)request_.GetResponse()) 30 | using (Stream stream_ = response.GetResponseStream()) 31 | using (StreamReader reader = new StreamReader(stream_)) 32 | { 33 | html_ = reader.ReadToEnd(); 34 | } 35 | return html_; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("Shopee Autobuy Bot")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("Shopee Autobuy Bot")] 12 | [assembly: AssemblyCopyright("Copyright © pearlxcore 2023")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("f7e8753c-0304-42fa-be34-9c708aff1b9c")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.5.6")] 35 | [assembly: AssemblyFileVersion("2.5.6")] -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Constants/ElementXpath.cs: -------------------------------------------------------------------------------- 1 | namespace Shopee_Autobuy_Bot.Constants 2 | { 3 | public class ElementXpath 4 | { 5 | public static string strShopeePay_5 = "//*[@id=\"main\"]/div/div[3]/div[2]/div[5]/div[1]/div/div[1]/div[2]/span[1]/button"; 6 | public static string strShopeePay_4 = "//*[@id=\"main\"]/div/div[3]/div[2]/div[4]/div[1]/div/div[1]/div[2]/span[1]/button"; 7 | public static string strInformationUpdatedOkButton = "//*[@id=\"modal\"]/div[2]/div[1]/div/div[2]/span"; 8 | public static string strChangeCourier = "//div[contains(@class, '_26DEZ8') and contains(text(), 'change')]"; 9 | public static string strDeliverAnytime = "//div[contains(text(), 'Deliver any time')]"; 10 | public static string strSubmitCourier = "//button[contains(text(), 'submit')]"; 11 | public static string strPayButtonID = "//*[@id=\"pay-button\"]"; 12 | public static string strShopeePayPin = "//div[contains(@class, 'digit-input active')]"; 13 | public static string strShopeePayCOnfirm = "//div[contains(@class, 'okText') and contains(text(), 'CONFIRM')]"; 14 | public static string str7ElevenOk = "//button[contains(@class, '_2W0k_h _2yXzsi') and contains(text(), 'OK')]"; 15 | public static string strPayCcardButton = "//button[contains(@class, '_2W0k_h _2yXzsi') and contains(text(), 'Pay')]"; 16 | public static string ItemNotSelected = "//div[contains(@class, 'shopee-alert-popup__message') and contains(text(), 'You have not selected any items for checkout')]"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Services/Selenium/ISeleniumService.cs: -------------------------------------------------------------------------------- 1 | using OpenQA.Selenium; 2 | 3 | namespace Shopee_Autobuy_Bot 4 | { 5 | public interface ISeleniumService 6 | { 7 | IWebDriver _driver { get; set; } 8 | int timeOut { get; set; } 9 | 10 | SeleniumService ClearKeys(); 11 | 12 | SeleniumService ClickElement(); 13 | 14 | void ClickElement(IWebElement webElement); 15 | 16 | bool ElementClickable(By locator); 17 | 18 | bool ElementExists(By locator); 19 | 20 | IWebElement GetElement(By locator); 21 | 22 | SeleniumService GoToUrl(string url); 23 | 24 | SeleniumService Initialize(bool disableImageExtension, bool headless, string chromeProfile); 25 | 26 | SeleniumService QuitDriver(); 27 | 28 | SeleniumService RefreshPage(); 29 | 30 | SeleniumService ReturnPage(string url); 31 | 32 | void Run(); 33 | 34 | SeleniumService SelectElement(By locator); 35 | 36 | SeleniumService SendKeys(string text); 37 | 38 | bool UrlContainString(string text); 39 | 40 | SeleniumService WaitElementClickable(By locator); 41 | 42 | SeleniumService WaitElementExists(By locator); 43 | 44 | SeleniumService WaitElementVisible(By locator); 45 | 46 | SeleniumService WaitForUrlToMatch(string url); 47 | 48 | SeleniumService WaitUrlContainString(string text); 49 | void SaveCookie(); 50 | 51 | void LoadCookie(); 52 | 53 | void ClearCookie(); 54 | 55 | public bool CheckLogin(); 56 | } 57 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33205.214 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shopee Autobuy Bot", "ShopeeAutobuyBot\Shopee Autobuy Bot.csproj", "{F7E8753C-0304-42FA-BE34-9C708AFF1B9C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetChromeVersion", "GetChromeVersion\GetChromeVersion.csproj", "{61594397-160F-44AF-AABB-D08CDE4C190B}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {F7E8753C-0304-42FA-BE34-9C708AFF1B9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {F7E8753C-0304-42FA-BE34-9C708AFF1B9C}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {F7E8753C-0304-42FA-BE34-9C708AFF1B9C}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {F7E8753C-0304-42FA-BE34-9C708AFF1B9C}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {61594397-160F-44AF-AABB-D08CDE4C190B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {61594397-160F-44AF-AABB-D08CDE4C190B}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {61594397-160F-44AF-AABB-D08CDE4C190B}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {61594397-160F-44AF-AABB-D08CDE4C190B}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {26258234-C8A9-4B2E-9283-3C4DB77C5051} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Utililties/db.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using MySql.Data.MySqlClient; 7 | using System.Windows.Forms; 8 | using MySql.Data; 9 | using System.Data; 10 | 11 | namespace Shopee_Autobuy_Bot 12 | { 13 | public class Login 14 | { 15 | public MySqlConnection connection; 16 | private string server; 17 | private string database; 18 | private string user; 19 | private string password; 20 | private string port; 21 | private string connectionString; 22 | private string sslM; 23 | 24 | public Login() 25 | { 26 | 27 | server = "202.71.110.6"; 28 | database = "pearlxc1_db"; 29 | user = "pearlxc1_user"; 30 | password = "aGI6joeg!,]4"; 31 | port = "3306"; 32 | 33 | connectionString = "SERVER=143.198.217.144;PORT=3306;DATABASE=pearlxc1_db;UID=pearlxc1_user"; 34 | //connectionString = String.Format("server={0};port={1};user id={2}; password={3}; database={4}", server, port, user, password, database); 35 | 36 | connection = new MySqlConnection(connectionString); 37 | } 38 | 39 | public void con() 40 | { 41 | connection.Open(); 42 | MessageBox.Show("successful connection"); 43 | connection.Close(); 44 | //try 45 | //{ 46 | // connection.Open(); 47 | // MessageBox.Show("successful connection"); 48 | // connection.Close(); 49 | //} 50 | //catch (MySqlException ex) 51 | //{ 52 | // MessageBox.Show(ex.Message + "\n\n" + connectionString); 53 | //} 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /ShopeeAutobuyBot/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Microsoft.Extensions.Hosting; 3 | using Shopee_Autobuy_Bot.Services; 4 | using Shopee_Autobuy_Bot.Services.Logger; 5 | using Shopee_Autobuy_Bot.Services.Notification; 6 | using Shopee_Autobuy_Bot.Services.Profile; 7 | using System; 8 | using System.Windows.Forms; 9 | 10 | namespace Shopee_Autobuy_Bot 11 | { 12 | static class Program 13 | { 14 | /// 15 | /// The main entry point for the application. 16 | /// 17 | //[STAThread] 18 | //static void Main() 19 | //{ 20 | // Application.EnableVisualStyles(); 21 | // Application.SetCompatibleTextRenderingDefault(false); 22 | // Application.Run(new Login()); 23 | //} 24 | 25 | [STAThread] 26 | static void Main() 27 | { 28 | Application.EnableVisualStyles(); 29 | Application.SetCompatibleTextRenderingDefault(false); 30 | 31 | var host = CreateHostBuilder().Build(); 32 | ServiceProvider = host.Services; 33 | 34 | Application.Run(ServiceProvider.GetRequiredService()); 35 | } 36 | public static IServiceProvider ServiceProvider { get; private set; } 37 | static IHostBuilder CreateHostBuilder() 38 | { 39 | return Host.CreateDefaultBuilder() 40 | .ConfigureServices((context, services) => 41 | { 42 | services.AddTransient(); 43 | services.AddTransient(); 44 | services.AddTransient(); 45 | services.AddTransient(); 46 | services.AddTransient(); 47 | services.AddSingleton(); 48 | services.AddSingleton