diff --git a/.gitignore b/.gitignore index a18f6b6..aedbbc2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /ToonTown Rewritten Bot/obj/project.nuget.cache /ToonTown Rewritten Bot/obj/ToonTown Rewritten Bot.csproj.nuget.dgspec.json /ToonTown Rewritten Bot/obj/ToonTown Rewritten Bot.csproj.nuget.g.props +/ToonTown Rewritten Bot/Properties/PublishProfiles diff --git a/ToonTown Rewritten Bot/AboutBox1.Designer.cs b/ToonTown Rewritten Bot/AboutBox1.Designer.cs index 65ce956..039775d 100644 --- a/ToonTown Rewritten Bot/AboutBox1.Designer.cs +++ b/ToonTown Rewritten Bot/AboutBox1.Designer.cs @@ -1,4 +1,4 @@ -namespace ToonTown_Rewritten_Bot +namespace ToonTown_Rewritten_Bot { partial class AboutBox1 { @@ -27,148 +27,150 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.okButton = new System.Windows.Forms.Button(); - this.textBoxDescription = new System.Windows.Forms.TextBox(); - this.labelCompanyName = new System.Windows.Forms.Label(); - this.labelCopyright = new System.Windows.Forms.Label(); - this.labelVersion = new System.Windows.Forms.Label(); - this.labelProductName = new System.Windows.Forms.Label(); - this.logoPictureBox = new System.Windows.Forms.PictureBox(); - this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); - this.tableLayoutPanel.SuspendLayout(); - this.SuspendLayout(); + okButton = new System.Windows.Forms.Button(); + textBoxDescription = new System.Windows.Forms.TextBox(); + labelCompanyName = new System.Windows.Forms.Label(); + labelCopyright = new System.Windows.Forms.Label(); + labelVersion = new System.Windows.Forms.Label(); + labelProductName = new System.Windows.Forms.Label(); + logoPictureBox = new System.Windows.Forms.PictureBox(); + tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); + ((System.ComponentModel.ISupportInitialize)logoPictureBox).BeginInit(); + tableLayoutPanel.SuspendLayout(); + SuspendLayout(); // // okButton // - this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.okButton.Location = new System.Drawing.Point(339, 239); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); - this.okButton.TabIndex = 24; - this.okButton.Text = "&OK"; + okButton.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; + okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + okButton.Location = new System.Drawing.Point(395, 277); + okButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + okButton.Name = "okButton"; + okButton.Size = new System.Drawing.Size(88, 27); + okButton.TabIndex = 24; + okButton.Text = "&OK"; // // textBoxDescription // - this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxDescription.Location = new System.Drawing.Point(143, 107); - this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3); - this.textBoxDescription.Multiline = true; - this.textBoxDescription.Name = "textBoxDescription"; - this.textBoxDescription.ReadOnly = true; - this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBoxDescription.Size = new System.Drawing.Size(271, 126); - this.textBoxDescription.TabIndex = 23; - this.textBoxDescription.TabStop = false; - this.textBoxDescription.Text = "This program is a bot that will perform certain time consuming tasks on ToonTown " + - "Rewritten."; + textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; + textBoxDescription.Location = new System.Drawing.Point(167, 123); + textBoxDescription.Margin = new System.Windows.Forms.Padding(7, 3, 4, 3); + textBoxDescription.Multiline = true; + textBoxDescription.Name = "textBoxDescription"; + textBoxDescription.ReadOnly = true; + textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; + textBoxDescription.Size = new System.Drawing.Size(316, 147); + textBoxDescription.TabIndex = 23; + textBoxDescription.TabStop = false; + textBoxDescription.Text = "This program is a bot that will perform certain time consuming tasks on ToonTown Rewritten."; // // labelCompanyName // - this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelCompanyName.Location = new System.Drawing.Point(143, 78); - this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17); - this.labelCompanyName.Name = "labelCompanyName"; - this.labelCompanyName.Size = new System.Drawing.Size(271, 17); - this.labelCompanyName.TabIndex = 22; - this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; + labelCompanyName.Location = new System.Drawing.Point(167, 90); + labelCompanyName.Margin = new System.Windows.Forms.Padding(7, 0, 4, 0); + labelCompanyName.MaximumSize = new System.Drawing.Size(0, 20); + labelCompanyName.Name = "labelCompanyName"; + labelCompanyName.Size = new System.Drawing.Size(316, 20); + labelCompanyName.TabIndex = 22; + labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelCopyright // - this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelCopyright.Location = new System.Drawing.Point(143, 52); - this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17); - this.labelCopyright.Name = "labelCopyright"; - this.labelCopyright.Size = new System.Drawing.Size(271, 17); - this.labelCopyright.TabIndex = 21; - this.labelCopyright.Text = "Programmed by primetime43"; - this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; + labelCopyright.Location = new System.Drawing.Point(167, 60); + labelCopyright.Margin = new System.Windows.Forms.Padding(7, 0, 4, 0); + labelCopyright.MaximumSize = new System.Drawing.Size(0, 20); + labelCopyright.Name = "labelCopyright"; + labelCopyright.Size = new System.Drawing.Size(316, 20); + labelCopyright.TabIndex = 21; + labelCopyright.Text = "Programmed by primetime43"; + labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelVersion // - this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelVersion.Location = new System.Drawing.Point(143, 26); - this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17); - this.labelVersion.Name = "labelVersion"; - this.labelVersion.Size = new System.Drawing.Size(271, 17); - this.labelVersion.TabIndex = 0; - this.labelVersion.Text = "Version 1.4"; - this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; + labelVersion.Location = new System.Drawing.Point(167, 30); + labelVersion.Margin = new System.Windows.Forms.Padding(7, 0, 4, 0); + labelVersion.MaximumSize = new System.Drawing.Size(0, 20); + labelVersion.Name = "labelVersion"; + labelVersion.Size = new System.Drawing.Size(316, 20); + labelVersion.TabIndex = 0; + labelVersion.Text = "Version 1.4"; + labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelProductName // - this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelProductName.Location = new System.Drawing.Point(143, 0); - this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17); - this.labelProductName.Name = "labelProductName"; - this.labelProductName.Size = new System.Drawing.Size(271, 17); - this.labelProductName.TabIndex = 19; - this.labelProductName.Text = "ToonTown Rewritten Bot"; - this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; + labelProductName.Location = new System.Drawing.Point(167, 0); + labelProductName.Margin = new System.Windows.Forms.Padding(7, 0, 4, 0); + labelProductName.MaximumSize = new System.Drawing.Size(0, 20); + labelProductName.Name = "labelProductName"; + labelProductName.Size = new System.Drawing.Size(316, 20); + labelProductName.TabIndex = 19; + labelProductName.Text = "ToonTown Rewritten Bot"; + labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // logoPictureBox // - this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.logoPictureBox.Image = global::ToonTown_Rewritten_Bot.Properties.Resources._12_5_13_welcome1; - this.logoPictureBox.Location = new System.Drawing.Point(3, 3); - this.logoPictureBox.Name = "logoPictureBox"; - this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); - this.logoPictureBox.Size = new System.Drawing.Size(131, 259); - this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.logoPictureBox.TabIndex = 12; - this.logoPictureBox.TabStop = false; + logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + logoPictureBox.Image = Properties.Resources._12_5_13_welcome1; + logoPictureBox.Location = new System.Drawing.Point(4, 3); + logoPictureBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + logoPictureBox.Name = "logoPictureBox"; + tableLayoutPanel.SetRowSpan(logoPictureBox, 6); + logoPictureBox.Size = new System.Drawing.Size(152, 301); + logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + logoPictureBox.TabIndex = 12; + logoPictureBox.TabStop = false; // // tableLayoutPanel // - this.tableLayoutPanel.ColumnCount = 2; - this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); - this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67F)); - this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0); - this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); - this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); - this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); - this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3); - this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); - this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); - this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9); - this.tableLayoutPanel.Name = "tableLayoutPanel"; - this.tableLayoutPanel.RowCount = 6; - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265); - this.tableLayoutPanel.TabIndex = 0; + tableLayoutPanel.ColumnCount = 2; + tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); + tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67F)); + tableLayoutPanel.Controls.Add(logoPictureBox, 0, 0); + tableLayoutPanel.Controls.Add(labelProductName, 1, 0); + tableLayoutPanel.Controls.Add(labelVersion, 1, 1); + tableLayoutPanel.Controls.Add(labelCopyright, 1, 2); + tableLayoutPanel.Controls.Add(labelCompanyName, 1, 3); + tableLayoutPanel.Controls.Add(textBoxDescription, 1, 4); + tableLayoutPanel.Controls.Add(okButton, 1, 5); + tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; + tableLayoutPanel.Location = new System.Drawing.Point(10, 10); + tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + tableLayoutPanel.Name = "tableLayoutPanel"; + tableLayoutPanel.RowCount = 6; + tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + tableLayoutPanel.Size = new System.Drawing.Size(487, 307); + tableLayoutPanel.TabIndex = 0; // // AboutBox1 // - this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(435, 283); - this.Controls.Add(this.tableLayoutPanel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AboutBox1"; - this.Padding = new System.Windows.Forms.Padding(9); - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "About"; - ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); - this.tableLayoutPanel.ResumeLayout(false); - this.tableLayoutPanel.PerformLayout(); - this.ResumeLayout(false); - + AcceptButton = okButton; + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(507, 327); + Controls.Add(tableLayoutPanel); + FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + MaximizeBox = false; + MinimizeBox = false; + Name = "AboutBox1"; + Padding = new System.Windows.Forms.Padding(10); + ShowIcon = false; + ShowInTaskbar = false; + StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + Text = "About"; + ((System.ComponentModel.ISupportInitialize)logoPictureBox).EndInit(); + tableLayoutPanel.ResumeLayout(false); + tableLayoutPanel.PerformLayout(); + ResumeLayout(false); } #endregion diff --git a/ToonTown Rewritten Bot/AboutBox1.cs b/ToonTown Rewritten Bot/AboutBox1.cs index 1c3e86a..daa57a5 100644 --- a/ToonTown Rewritten Bot/AboutBox1.cs +++ b/ToonTown Rewritten Bot/AboutBox1.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; @@ -16,7 +16,7 @@ public AboutBox1() InitializeComponent(); this.Text = String.Format("About {0} by primetime43", AssemblyTitle); this.labelProductName.Text = AssemblyProduct; - this.labelVersion.Text = "Version 1.4"; + this.labelVersion.Text = "Version 1.4.1"; this.labelCopyright.Text = "Programmed by primetime43"; this.labelCompanyName.Text = AssemblyCompany; this.textBoxDescription.Text = "This program is a bot that will perform certain time consuming tasks on ToonTown Rewritten."; diff --git a/ToonTown Rewritten Bot/AboutBox1.resx b/ToonTown Rewritten Bot/AboutBox1.resx index 1af7de1..6dae11d 100644 --- a/ToonTown Rewritten Bot/AboutBox1.resx +++ b/ToonTown Rewritten Bot/AboutBox1.resx @@ -1,64 +1,4 @@ - - diff --git a/ToonTown Rewritten Bot/AdvancedSettings.resx b/ToonTown Rewritten Bot/AdvancedSettings.resx index 1af7de1..d58980a 100644 --- a/ToonTown Rewritten Bot/AdvancedSettings.resx +++ b/ToonTown Rewritten Bot/AdvancedSettings.resx @@ -1,4 +1,4 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ToonTown Rewritten Bot/DevForm.Designer.cs b/ToonTown Rewritten Bot/DevForm.Designer.cs index 4dda19c..f6f8931 100644 --- a/ToonTown Rewritten Bot/DevForm.Designer.cs +++ b/ToonTown Rewritten Bot/DevForm.Designer.cs @@ -1,4 +1,4 @@ -namespace ToonTown_Rewritten_Bot +namespace ToonTown_Rewritten_Bot { partial class DevForm { @@ -34,13 +34,13 @@ private void InitializeComponent() this.trackBar1 = new System.Windows.Forms.TrackBar(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.imageBox1 = new Emgu.CV.UI.ImageBox(); + //this.imageBox1 = new Emgu.CV.UI.ImageBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.label1 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.checkBox2 = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.imageBox1)).BeginInit(); + //((System.ComponentModel.ISupportInitialize)(this.imageBox1)).BeginInit(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); @@ -96,12 +96,12 @@ private void InitializeComponent() // // imageBox1 // - this.imageBox1.Location = new System.Drawing.Point(1025, 8); + /*this.imageBox1.Location = new System.Drawing.Point(1025, 8); this.imageBox1.Name = "imageBox1"; this.imageBox1.Size = new System.Drawing.Size(99, 93); this.imageBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.imageBox1.TabIndex = 2; - this.imageBox1.TabStop = false; + this.imageBox1.TabStop = false;*/ // // groupBox1 // @@ -156,12 +156,12 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1146, 599); this.Controls.Add(this.groupBox1); - this.Controls.Add(this.imageBox1); + //this.Controls.Add(this.imageBox1); this.Controls.Add(this.button1); this.Name = "DevForm"; this.Text = "DevForm"; ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.imageBox1)).EndInit(); + //((System.ComponentModel.ISupportInitialize)(this.imageBox1)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); @@ -173,7 +173,7 @@ private void InitializeComponent() #endregion private System.Windows.Forms.Button button1; - private Emgu.CV.UI.ImageBox imageBox1; + //private Emgu.CV.UI.ImageBox imageBox1; private System.Windows.Forms.Button button2; private System.Windows.Forms.TrackBar trackBar1; private System.Windows.Forms.CheckBox checkBox1; diff --git a/ToonTown Rewritten Bot/DevForm.cs b/ToonTown Rewritten Bot/DevForm.cs index d7ef930..7d85f10 100644 --- a/ToonTown Rewritten Bot/DevForm.cs +++ b/ToonTown Rewritten Bot/DevForm.cs @@ -1,11 +1,11 @@ -using Emgu.CV; -using Emgu.CV.Structure; +//using Emgu.CV; +//using Emgu.CV.Structure; using System; using System.Drawing; using System.Runtime.InteropServices; using System.Threading; using System.Windows.Forms; -using Tesseract; +//using Tesseract; using System.Diagnostics; using System.IO; @@ -105,12 +105,12 @@ public void CaptureWindow(IntPtr handle) //previousImage?.Dispose(); //testing - testImageCapture(result); + //testImageCapture(result); } } //prob just use to show box where the coords are for debugging purposes in release version - Image template = new Image(Properties.Resources.stickerBook.ToImage().Data); // Image A + /*Image template = new Image(Properties.Resources.stickerBook.ToImage().Data); // Image A private void testImageCapture(Bitmap inputImage) { //find image a in b @@ -137,7 +137,7 @@ private void testImageCapture(Bitmap inputImage) } imageBox1.Image = imageToShow; - } + }*/ [StructLayout(LayoutKind.Sequential)] public struct POINT @@ -184,7 +184,7 @@ public struct Rect public const string TESS_PATH = "tessdata/"; public const string TESS_LANGUAGE = "eng"; - private static TesseractEngine engine; + //private static TesseractEngine engine; /*public static void readText(Image inputImage) { diff --git a/ToonTown Rewritten Bot/DoodleTraining.cs b/ToonTown Rewritten Bot/DoodleTraining.cs index 3586e38..08c80ee 100644 --- a/ToonTown Rewritten Bot/DoodleTraining.cs +++ b/ToonTown Rewritten Bot/DoodleTraining.cs @@ -9,6 +9,7 @@ class DoodleTraining public static int numberOfFeeds, numberOfScratches; private static string selectedTrick; private static bool infiniteTimeCheckBox, justFeedCheckBox, justScratchCheckBox; + public static bool shouldStopTraining = false; public static void startTrainingDoodle(int feeds, int scratches, bool unlimitedCheckBox, string trick, bool justFeed, bool justScratch) { numberOfFeeds = feeds; @@ -30,7 +31,7 @@ public static void feedAndScratch() numberOfScratches = 0; else if (justScratchCheckBox) numberOfFeeds = 0; - while (numberOfFeeds > 0 || numberOfScratches > 0) + while (numberOfFeeds > 0 || numberOfScratches > 0 && !shouldStopTraining) { Thread.Sleep(5000); if (numberOfFeeds > 0)//feed doodle @@ -48,7 +49,7 @@ public static void feedAndScratch() } else //infinite checkbox is checked, so loop until stopped { - while (true) + while (true && !shouldStopTraining) { if (justFeedCheckBox)//just feed is checked feedDoodle(); diff --git a/ToonTown Rewritten Bot/Fishing.cs b/ToonTown Rewritten Bot/Fishing.cs index fb76faf..1190cb0 100644 --- a/ToonTown Rewritten Bot/Fishing.cs +++ b/ToonTown Rewritten Bot/Fishing.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Drawing; using System.IO; @@ -16,6 +16,7 @@ class Fishing : AdvancedSettings private new static int x, y; private static Random rand = new Random(); private static string redFishingButtonColor = "#FD0000"; + public static bool shouldStopFishing = false; //location, num of casts, num of sells public static async void startFishing(string location, int numberOfCasts, int numberOfTimesToMeetFisherman, bool randomCasting) @@ -54,45 +55,48 @@ public static async void startFishing(string location, int numberOfCasts, int nu //start fishing startFishing(numberOfCasts, randomCasting); //walking to fisherman - switch (location) + if (!shouldStopFishing) { - case "TOONTOWN CENTRAL PUNCHLINE PLACE": - fishTTCPunchlinePlace();//goes to fisherman and back to dock - startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); - break; - case "DONALD DREAM LAND LULLABY LANE": - fishDDLLullabyLane(); - startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); - break; - case "BRRRGH POLAR PLACE": - fishBrrrghPolarPlace(); - startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); - break; - case "BRRRGH WALRUS WAY": - fishBrrrghWalrusWay(); - startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); - break; - case "BRRRGH SLEET STREET": - fishBrrrghSleetSt(); - startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); - break; - case "MINNIE'S MELODYLAND TENOR TERRACE": - fishMMTenorTerrace(); - startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); - break; - case "DONALD DOCK LIGHTHOUSE LANE": - fishDDLighthouseLane(); - startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); - break; - case "DAISY'S GARDEN ELM STREET": - fishDaisyGardenElmSt(); - startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); - break; - case "FISH ANYWHERE": - break; + switch (location) + { + case "TOONTOWN CENTRAL PUNCHLINE PLACE": + fishTTCPunchlinePlace();//goes to fisherman and back to dock + startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); + break; + case "DONALD DREAM LAND LULLABY LANE": + fishDDLLullabyLane(); + startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); + break; + case "BRRRGH POLAR PLACE": + fishBrrrghPolarPlace(); + startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); + break; + case "BRRRGH WALRUS WAY": + fishBrrrghWalrusWay(); + startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); + break; + case "BRRRGH SLEET STREET": + fishBrrrghSleetSt(); + startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); + break; + case "MINNIE'S MELODYLAND TENOR TERRACE": + fishMMTenorTerrace(); + startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); + break; + case "DONALD DOCK LIGHTHOUSE LANE": + fishDDLighthouseLane(); + startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); + break; + case "DAISY'S GARDEN ELM STREET": + fishDaisyGardenElmSt(); + startFishing(location, numberOfCasts, numberOfTimesToMeetFisherman - 1, randomCasting); + break; + case "FISH ANYWHERE": + break; + } + MessageBox.Show("Done!"); } } - MessageBox.Show("Done!"); } private static void fishTTCPunchlinePlace() @@ -237,7 +241,7 @@ private static void fishDDLighthouseLane() private static void startFishing(int numberOfCasts, bool fishVariance) { Stopwatch stopwatch = new Stopwatch(); - while (numberOfCasts != 0) + while (numberOfCasts != 0 && !shouldStopFishing) { castLine(fishVariance); stopwatch.Start(); @@ -250,8 +254,11 @@ private static void startFishing(int numberOfCasts, bool fishVariance) numberOfCasts--; Thread.Sleep(1000); } - exitFishing(); - Thread.Sleep(3000); + if (!shouldStopFishing) // Only call exitFishing() if we didn't break out of the loop + { + exitFishing(); + Thread.Sleep(3000); + } } private static void sellFish() diff --git a/ToonTown Rewritten Bot/Form1.cs b/ToonTown Rewritten Bot/Form1.cs index 6c5799f..04f0149 100644 --- a/ToonTown Rewritten Bot/Form1.cs +++ b/ToonTown Rewritten Bot/Form1.cs @@ -1,4 +1,4 @@ -using Emgu.CV.XPhoto; +//using Emgu.CV.XPhoto; using System; using System.Collections.Generic; using System.Configuration; @@ -161,7 +161,7 @@ private void button3_Click(object sender, EventArgs e) private void button7_Click(object sender, EventArgs e) { - BotFunctions.resetAllCoordinates(); + BotFunctions.createFreshCoordinatesFile(); MessageBox.Show("All coordinates reset!"); } @@ -226,13 +226,11 @@ private void randomFishing_CheckedChanged(object sender, EventArgs e) fishingThreading = new Thread(() => ToonTown_Rewritten_Bot.Fishing.startFishing(selected, numberOfCasts, numberOfSells, fishVariance)); fishingThreading.Start(); } - else if (stopCheck) - fishingThreading.Abort(); } private void button4_Click(object sender, EventArgs e)//button to stop fishing { - startFishingThread(null, 0, 0, true); + ToonTown_Rewritten_Bot.Fishing.shouldStopFishing = true; MessageBox.Show("Fishing stopped!"); } @@ -415,13 +413,11 @@ public void startDoodleTrainingThread(int numberOfFeeds, int numberOfScratches, doodleTrainingThreading = new Thread(() => DoodleTraining.startTrainingDoodle(numberOfFeeds, numberOfScratches, checkBox3.Checked, selectedTrick, checkBox4.Checked, checkBox5.Checked)); doodleTrainingThreading.Start(); } - else if (stopTrainingClicked) - doodleTrainingThreading.Abort(); } private void button19_Click(object sender, EventArgs e) { - startDoodleTrainingThread(0, 0, false, true, ""); + DoodleTraining.shouldStopTraining = true; MessageBox.Show("Doodle Training stopped!"); } diff --git a/ToonTown Rewritten Bot/ImageRecognition.cs b/ToonTown Rewritten Bot/ImageRecognition.cs index b982127..efd75d5 100644 --- a/ToonTown Rewritten Bot/ImageRecognition.cs +++ b/ToonTown Rewritten Bot/ImageRecognition.cs @@ -1,7 +1,7 @@ -using Emgu.CV.CvEnum; +/*using Emgu.CV.CvEnum; using Emgu.CV; using Emgu.CV.Stitching; -using Emgu.CV.Structure; +using Emgu.CV.Structure;*/ using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/ToonTown Rewritten Bot/ToonTown Rewritten Bot.csproj b/ToonTown Rewritten Bot/ToonTown Rewritten Bot.csproj index f5b09bb..9fb0586 100644 --- a/ToonTown Rewritten Bot/ToonTown Rewritten Bot.csproj +++ b/ToonTown Rewritten Bot/ToonTown Rewritten Bot.csproj @@ -1,4 +1,4 @@ - + net7.0-windows WinExe @@ -21,6 +21,7 @@ false true true + true true @@ -76,9 +77,4 @@ - - - - - \ No newline at end of file diff --git a/ToonTown Rewritten Bot/ToonTown Rewritten Bot.csproj.user b/ToonTown Rewritten Bot/ToonTown Rewritten Bot.csproj.user index fc01d67..2d9a08c 100644 --- a/ToonTown Rewritten Bot/ToonTown Rewritten Bot.csproj.user +++ b/ToonTown Rewritten Bot/ToonTown Rewritten Bot.csproj.user @@ -1,4 +1,4 @@ - + publish\ @@ -12,6 +12,7 @@ false + <_LastSelectedProfileId>C:\Users\primetime43\source\repos\Toontown-Rewritten-Bot\ToonTown Rewritten Bot\Properties\PublishProfiles\FolderProfile.pubxml @@ -45,4 +46,9 @@ Form + + + Designer + + \ No newline at end of file diff --git a/ToonTown Rewritten Bot/obj/ToonTown Rewritten Bot.csproj.nuget.g.targets b/ToonTown Rewritten Bot/obj/ToonTown Rewritten Bot.csproj.nuget.g.targets index 5b2cbca..babc2c6 100644 --- a/ToonTown Rewritten Bot/obj/ToonTown Rewritten Bot.csproj.nuget.g.targets +++ b/ToonTown Rewritten Bot/obj/ToonTown Rewritten Bot.csproj.nuget.g.targets @@ -1,7 +1,2 @@ - - - - - - - \ No newline at end of file + + \ No newline at end of file