├── AutoClicker ├── App.config ├── Controls │ └── ValueCheckBox.cs ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Program.cs ├── Win32Api.cs ├── Extensions.cs ├── NotRunning.cs ├── ButtonInputs.cs ├── MultipleInstances.cs ├── Clicker.cs ├── MultipleInstances.Designer.cs ├── AutoClicker.csproj ├── ButtonInputs.Designer.cs ├── NotRunning.Designer.cs ├── Main.Designer.cs ├── Main.resx ├── ButtonInputs.resx ├── MultipleInstances.resx ├── NotRunning.resx └── Main.cs ├── AutoClicker.sln ├── README.md └── .gitignore /AutoClicker/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AutoClicker/Controls/ValueCheckBox.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | 3 | namespace AutoClicker.Controls 4 | { 5 | public class ValueCheckBox : CheckBox 6 | { 7 | public string Value { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /AutoClicker/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AutoClicker/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace AutoClicker 5 | { 6 | static class Program 7 | { 8 | /// 9 | /// The main entry point for the application. 10 | /// 11 | [STAThread] 12 | static void Main() 13 | { 14 | Application.EnableVisualStyles(); 15 | Application.SetCompatibleTextRenderingDefault(false); 16 | Application.Run(new Main()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /AutoClicker/Win32Api.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace AutoClicker 5 | { 6 | public class Win32Api 7 | { 8 | [DllImport("user32.dll")] 9 | public static extern IntPtr PostMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); 10 | 11 | [DllImport("user32.dll")] 12 | public static extern bool SetForegroundWindow(IntPtr hWnd); 13 | 14 | [DllImport("user32.dll")] 15 | internal static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); //ShowWindow needs an IntPtr 16 | 17 | public static uint WmRbuttonDown => 0x0204; 18 | public static uint WmLbuttonDown => 0x201; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /AutoClicker/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Windows.Forms; 4 | 5 | namespace AutoClicker 6 | { 7 | public static class Extensions 8 | { 9 | public static IEnumerable AllControls(this Control startingPoint) where T : Control 10 | { 11 | var hit = startingPoint is T; 12 | 13 | if (hit) 14 | yield return (T) startingPoint; 15 | 16 | foreach (var child in startingPoint.Controls.Cast()) 17 | { 18 | foreach (var item in AllControls(child)) 19 | { 20 | yield return item; 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /AutoClicker.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoClicker", "AutoClicker\AutoClicker.csproj", "{B27BC860-EB89-4917-976E-06813F7783E0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B27BC860-EB89-4917-976E-06813F7783E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {B27BC860-EB89-4917-976E-06813F7783E0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {B27BC860-EB89-4917-976E-06813F7783E0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {B27BC860-EB89-4917-976E-06813F7783E0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Minecraft Auto Clicker 2 | 3 | * Be sure to go into options.txt in your .minecraft folder and set "pauseOnLostFocus" to "false" 4 | * Must be done with Minecraft closed 5 | 6 | To access your .minecraft folder, open explorer and paste this into the address bar: 7 | * %appdata%\\.minecraft 8 | 9 | Alternatively, you can also do F3 + P in game until it says "Pause on lost focus: disabled" 10 | 11 | To Use: 12 | 13 | Line yourself up for whatever action you want to take and then bring up the menu. Go into the application and click "Start". 14 | 15 | Once you click start, you will have 3 seconds to go into the game and exit the menu. When the countdown hits 0, the program will run and will auto tab you out of the game. 16 | 17 | When you want to stop, click "Stop" and it will stop the action. 18 | 19 | 中文版介绍 20 | 21 | 使用前需要关闭`失去焦点时暂停游戏`选项,关闭方法如下: 22 | * 在游戏中按快捷键`F3 + P`,提示`失去焦点时暂停游戏:禁用` 23 | 24 | 或者 25 | * 在资源管理器的地址栏中输入`%appdata%\\.minecraft` 26 | * 打开`options.txt`,将`pauseOnLostFocus`设置为`false` 27 | 28 | 使用指南(以后台挂机钓鱼为例,与原文有所不同): 29 | 30 | * 打开游戏和点击程序,将游戏调整至所需状态(如手持鱼竿处于钓鱼的合适位置) 31 | * 切换回程序,选中`Right Click`和`Hold Click Button Down (For Mining)`,点击`Start` 32 | * 等待三秒,程序运行,开始后台自动钓鱼 33 | -------------------------------------------------------------------------------- /AutoClicker/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 AutoClicker.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /AutoClicker/NotRunning.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Windows.Forms; 6 | 7 | namespace AutoClicker 8 | { 9 | public partial class NotRunning : Form 10 | { 11 | public NotRunning() 12 | { 13 | InitializeComponent(); 14 | } 15 | 16 | public string ProcessTitle { get; private set; } 17 | 18 | private void NotRunning_Load(object sender, EventArgs e) 19 | { 20 | var processes = Process.GetProcesses().Where(b => b.ProcessName.StartsWith("java")).OrderBy(b => b.MainWindowTitle).Select(b => b.MainWindowTitle).ToArray(); 21 | cmbProcess.Items.AddRange(processes); 22 | 23 | // if there is only 1 item, may as well select it for the, as it is probably the window they want 24 | if (cmbProcess.Items.Count == 1) 25 | cmbProcess.SelectedItem = cmbProcess.Items[0]; 26 | } 27 | 28 | private void BtnOK_Click(object sender, EventArgs e) 29 | { 30 | this.DialogResult = DialogResult.OK; 31 | 32 | if(cmbProcess.SelectedItem != null) 33 | this.ProcessTitle = cmbProcess.SelectedItem.ToString(); 34 | 35 | this.Close(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /AutoClicker/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("Minecraft Auto-Clicker")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Minecraft Auto-Clicker")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 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("2900ffa1-3aa7-41ee-abfe-238fcb63ba2b")] 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("1.1.0.0")] 36 | [assembly: AssemblyFileVersion("1.1.0.0")] 37 | -------------------------------------------------------------------------------- /AutoClicker/ButtonInputs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace AutoClicker 5 | { 6 | public partial class ButtonInputs : UserControl 7 | { 8 | private readonly uint buttonDownCode; 9 | private readonly uint buttonUpCode; 10 | 11 | public bool Needed => cbButtonEnable.Checked; 12 | 13 | public ButtonInputs(string buttonName, uint buttonDownCode, uint buttonUpCode) 14 | { 15 | InitializeComponent(); 16 | 17 | this.buttonDownCode = buttonDownCode; 18 | this.buttonUpCode = buttonUpCode; 19 | cbButtonEnable.Text = buttonName; 20 | numDelay.Maximum = int.MaxValue; 21 | numDelay.Value = 200; 22 | } 23 | 24 | internal Clicker StartClicking(IntPtr minecraftHandle) 25 | { 26 | var delay = (int)numDelay.Value; 27 | var clicker = new Clicker(buttonDownCode, buttonUpCode, minecraftHandle); 28 | 29 | clicker.Start(delay, cbHold.Checked); 30 | 31 | return clicker; 32 | } 33 | 34 | private void CbButtonEnable_Click(object sender, EventArgs e) 35 | { 36 | if (cbButtonEnable.Checked) 37 | { 38 | cbHold.Enabled = true; 39 | HoldCheckBoxClicked(); 40 | } 41 | else 42 | { 43 | cbHold.Enabled = false; 44 | numDelay.Enabled = false; 45 | } 46 | } 47 | 48 | private void CbHold_Click(object sender, EventArgs e) 49 | { 50 | HoldCheckBoxClicked(); 51 | } 52 | 53 | private void HoldCheckBoxClicked() 54 | { 55 | numDelay.Enabled = !cbHold.Checked; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /AutoClicker/MultipleInstances.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Drawing; 5 | using System.Windows.Forms; 6 | using System.Linq; 7 | using AutoClicker.Controls; 8 | 9 | namespace AutoClicker 10 | { 11 | public partial class MultipleInstances : Form 12 | { 13 | public List SelectedInstances { get; } 14 | 15 | public MultipleInstances(IEnumerable foundProcesses) 16 | { 17 | InitializeComponent(); 18 | 19 | SelectedInstances = new List(); 20 | const int x = 25; 21 | var y = 20; 22 | var buttonX = grpInstances.Location.X + grpInstances.Width - 100; 23 | var processCount = 0; 24 | 25 | foreach (var process in foundProcesses) 26 | { 27 | var checkbox = new ValueCheckBox 28 | { 29 | Text = process.MainWindowTitle, 30 | Value = process.Id.ToString(), 31 | Location = new Point(x, y), 32 | AutoSize = true 33 | }; 34 | 35 | var button = new Button 36 | { 37 | Text = @"Focus", 38 | Location = new Point(buttonX, y) 39 | }; 40 | 41 | button.Click += (sender, e) => { Win32Api.SetForegroundWindow(process.MainWindowHandle); }; 42 | 43 | grpInstances.Controls.Add(checkbox); 44 | grpInstances.Controls.Add(button); 45 | 46 | y += 25; 47 | processCount++; 48 | AdjustForm(processCount); 49 | } 50 | } 51 | 52 | private void Btn_ok_Click(object sender, EventArgs e) 53 | { 54 | var selectedInstances = grpInstances.AllControls().Where(b => b.Checked).ToList(); 55 | 56 | if (!selectedInstances.Any()) 57 | { 58 | MessageBox.Show(@"You must select at least one instance!", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 59 | return; 60 | } 61 | 62 | foreach (var instance in selectedInstances) 63 | SelectedInstances.Add(int.Parse(instance.Value)); 64 | 65 | DialogResult = DialogResult.OK; 66 | Close(); 67 | } 68 | 69 | private void AdjustForm(int processCount) 70 | { 71 | if (processCount > 4) 72 | { 73 | grpInstances.Height += 25; 74 | Height += 25; 75 | btn_cancel.Location = new Point(btn_cancel.Location.X, btn_cancel.Location.Y + 25); 76 | btn_ok.Location = new Point(btn_ok.Location.X, btn_ok.Location.Y + 25); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /AutoClicker/Clicker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace AutoClicker 5 | { 6 | internal class Clicker : IDisposable 7 | { 8 | private readonly uint buttonDownCode; 9 | private readonly uint buttonUpCode; 10 | private readonly IntPtr minecraftHandle; 11 | private readonly Timer timer; 12 | 13 | private bool hold = false; 14 | private bool disposed; 15 | 16 | public Clicker(uint buttonDownCode, uint buttonUpCode, IntPtr minecraftHandle) 17 | { 18 | this.buttonDownCode = buttonDownCode; 19 | this.buttonUpCode = buttonUpCode; 20 | this.minecraftHandle = minecraftHandle; 21 | 22 | timer = new Timer(); 23 | timer.Tick += Timer_Tick; 24 | } 25 | 26 | private void Timer_Tick(object sender, EventArgs e) 27 | { 28 | // keep sending hold every tick as well in case they do something to interrupt the input 29 | if(hold) 30 | { 31 | Hold(); 32 | } else 33 | { 34 | Click(); 35 | } 36 | } 37 | 38 | public void Start(int delay, bool hold) 39 | { 40 | this.hold = hold; 41 | Stop(); 42 | 43 | if (hold) 44 | { 45 | Hold(); 46 | timer.Interval = delay; 47 | timer.Start(); 48 | 49 | } 50 | else 51 | { 52 | Click(); 53 | timer.Interval = delay; 54 | timer.Start(); 55 | } 56 | } 57 | 58 | public void Stop() 59 | { 60 | if (!hold) 61 | timer.Stop(); 62 | 63 | Click(); 64 | } 65 | 66 | private void Hold() 67 | { 68 | Win32Api.PostMessage(minecraftHandle, buttonDownCode, IntPtr.Zero, IntPtr.Zero); 69 | } 70 | 71 | private void Click() 72 | { 73 | Win32Api.PostMessage(minecraftHandle, buttonDownCode, IntPtr.Zero, IntPtr.Zero); 74 | Win32Api.PostMessage(minecraftHandle, buttonUpCode, IntPtr.Zero, IntPtr.Zero); 75 | } 76 | 77 | #region Dispose 78 | public void Dispose() 79 | { 80 | // Dispose of unmanaged resources. 81 | Dispose(true); 82 | // Suppress finalization. 83 | GC.SuppressFinalize(this); 84 | } 85 | 86 | protected void Dispose(bool disposing) 87 | { 88 | if (disposed) 89 | return; 90 | 91 | if (disposing) 92 | { 93 | Stop(); 94 | timer.Dispose(); 95 | } 96 | 97 | disposed = true; 98 | } 99 | 100 | ~Clicker() 101 | { 102 | Dispose(false); 103 | } 104 | #endregion 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /AutoClicker/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 AutoClicker.Properties 12 | { 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", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoFisher.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /.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 | *.userosscache 7 | *.sln.docstates 8 | *.user 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 | x64/ 19 | x86/ 20 | build/ 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 | *.opensdf 80 | *.sdf 81 | *.cachefile 82 | 83 | # Visual Studio profiler 84 | *.psess 85 | *.vsp 86 | *.vspx 87 | *.sap 88 | 89 | # TFS 2012 Local Workspace 90 | $tf/ 91 | 92 | # Guidance Automation Toolkit 93 | *.gpState 94 | 95 | # ReSharper is a .NET coding add-in 96 | _ReSharper*/ 97 | *.[Rr]e[Ss]harper 98 | *.DotSettings.user 99 | 100 | # JustCode is a .NET coding add-in 101 | .JustCode 102 | 103 | # TeamCity is a build add-in 104 | _TeamCity* 105 | 106 | # DotCover is a Code Coverage Tool 107 | *.dotCover 108 | 109 | # NCrunch 110 | _NCrunch_* 111 | .*crunch*.local.xml 112 | nCrunchTemp_* 113 | 114 | # MightyMoose 115 | *.mm.* 116 | AutoTest.Net/ 117 | 118 | # Web workbench (sass) 119 | .sass-cache/ 120 | 121 | # Installshield output folder 122 | [Ee]xpress/ 123 | 124 | # DocProject is a documentation generator add-in 125 | DocProject/buildhelp/ 126 | DocProject/Help/*.HxT 127 | DocProject/Help/*.HxC 128 | DocProject/Help/*.hhc 129 | DocProject/Help/*.hhk 130 | DocProject/Help/*.hhp 131 | DocProject/Help/Html2 132 | DocProject/Help/html 133 | 134 | # Click-Once directory 135 | publish/ 136 | 137 | # Publish Web Output 138 | *.[Pp]ublish.xml 139 | *.azurePubxml 140 | # TODO: Comment the next line if you want to checkin your web deploy settings 141 | # but database connection strings (with potential passwords) will be unencrypted 142 | *.pubxml 143 | *.publishproj 144 | 145 | # NuGet Packages 146 | *.nupkg 147 | # The packages folder can be ignored because of Package Restore 148 | **/packages/* 149 | # except build/, which is used as an MSBuild target. 150 | !**/packages/build/ 151 | # Uncomment if necessary however generally it will be regenerated when needed 152 | #!**/packages/repositories.config 153 | 154 | # Windows Azure Build Output 155 | csx/ 156 | *.build.csdef 157 | 158 | # Windows Store app package directory 159 | AppPackages/ 160 | 161 | # Visual Studio cache files 162 | # files ending in .cache can be ignored 163 | *.[Cc]ache 164 | # but keep track of directories ending in .cache 165 | !*.[Cc]ache/ 166 | 167 | # Others 168 | ClientBin/ 169 | [Ss]tyle[Cc]op.* 170 | ~$* 171 | *~ 172 | *.dbmdl 173 | *.dbproj.schemaview 174 | *.pfx 175 | *.publishsettings 176 | node_modules/ 177 | orleans.codegen.cs 178 | 179 | # RIA/Silverlight projects 180 | Generated_Code/ 181 | 182 | # Backup & report files from converting an old project file 183 | # to a newer Visual Studio version. Backup files are not needed, 184 | # because we have git ;-) 185 | _UpgradeReport_Files/ 186 | Backup*/ 187 | UpgradeLog*.XML 188 | UpgradeLog*.htm 189 | 190 | 191 | # Business Intelligence projects 192 | *.rdl.data 193 | *.bim.layout 194 | *.bim_*.settings 195 | 196 | # Microsoft Fakes 197 | FakesAssemblies/ 198 | 199 | # Node.js Tools for Visual Studio 200 | .ntvs_analysis.dat 201 | 202 | # Visual Studio 6 build log 203 | *.plg 204 | 205 | # Visual Studio 6 workspace options file 206 | *.opt 207 | 208 | # Visual Studio LightSwitch build output 209 | **/*.HTMLClient/GeneratedArtifacts 210 | **/*.DesktopClient/GeneratedArtifacts 211 | **/*.DesktopClient/ModelManifest.xml 212 | **/*.Server/GeneratedArtifacts 213 | **/*.Server/ModelManifest.xml 214 | _Pvt_Extensions 215 | 216 | # SQL Server files 217 | *.mdf 218 | *.ldf 219 | -------------------------------------------------------------------------------- /AutoClicker/MultipleInstances.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace AutoClicker 2 | { 3 | partial class MultipleInstances 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.lbl_info = new System.Windows.Forms.Label(); 32 | this.btn_ok = new System.Windows.Forms.Button(); 33 | this.btn_cancel = new System.Windows.Forms.Button(); 34 | this.grpInstances = new System.Windows.Forms.GroupBox(); 35 | this.SuspendLayout(); 36 | // 37 | // lbl_info 38 | // 39 | this.lbl_info.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.150944F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 40 | this.lbl_info.Location = new System.Drawing.Point(12, 9); 41 | this.lbl_info.Name = "lbl_info"; 42 | this.lbl_info.Size = new System.Drawing.Size(337, 37); 43 | this.lbl_info.TabIndex = 1; 44 | this.lbl_info.Text = "Multiple Minecraft instances found. Which ones would you like to run the auto-cli" + 45 | "cker on?"; 46 | // 47 | // btn_ok 48 | // 49 | this.btn_ok.Location = new System.Drawing.Point(183, 179); 50 | this.btn_ok.Name = "btn_ok"; 51 | this.btn_ok.Size = new System.Drawing.Size(82, 35); 52 | this.btn_ok.TabIndex = 2; 53 | this.btn_ok.Text = "OK"; 54 | this.btn_ok.UseVisualStyleBackColor = true; 55 | this.btn_ok.Click += new System.EventHandler(this.Btn_ok_Click); 56 | // 57 | // btn_cancel 58 | // 59 | this.btn_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 60 | this.btn_cancel.Location = new System.Drawing.Point(271, 179); 61 | this.btn_cancel.Name = "btn_cancel"; 62 | this.btn_cancel.Size = new System.Drawing.Size(78, 35); 63 | this.btn_cancel.TabIndex = 3; 64 | this.btn_cancel.Text = "Cancel"; 65 | this.btn_cancel.UseVisualStyleBackColor = true; 66 | // 67 | // grpInstances 68 | // 69 | this.grpInstances.Location = new System.Drawing.Point(15, 49); 70 | this.grpInstances.Name = "grpInstances"; 71 | this.grpInstances.Size = new System.Drawing.Size(338, 124); 72 | this.grpInstances.TabIndex = 4; 73 | this.grpInstances.TabStop = false; 74 | this.grpInstances.Text = "Active Instances"; 75 | // 76 | // MultipleInstances 77 | // 78 | this.AcceptButton = this.btn_ok; 79 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 80 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 81 | this.CancelButton = this.btn_cancel; 82 | this.ClientSize = new System.Drawing.Size(368, 228); 83 | this.Controls.Add(this.grpInstances); 84 | this.Controls.Add(this.btn_cancel); 85 | this.Controls.Add(this.btn_ok); 86 | this.Controls.Add(this.lbl_info); 87 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 88 | this.Name = "MultipleInstances"; 89 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 90 | this.Text = "Multiple Instances Found"; 91 | this.ResumeLayout(false); 92 | 93 | } 94 | 95 | #endregion 96 | private System.Windows.Forms.Label lbl_info; 97 | private System.Windows.Forms.Button btn_ok; 98 | private System.Windows.Forms.Button btn_cancel; 99 | private System.Windows.Forms.GroupBox grpInstances; 100 | } 101 | } -------------------------------------------------------------------------------- /AutoClicker/AutoClicker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {B27BC860-EB89-4917-976E-06813F7783E0} 8 | WinExe 9 | Properties 10 | AutoClicker 11 | AutoClicker 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | Component 50 | 51 | 52 | 53 | Form 54 | 55 | 56 | Main.cs 57 | 58 | 59 | Form 60 | 61 | 62 | MultipleInstances.cs 63 | 64 | 65 | Form 66 | 67 | 68 | NotRunning.cs 69 | 70 | 71 | 72 | 73 | UserControl 74 | 75 | 76 | ButtonInputs.cs 77 | 78 | 79 | 80 | Main.cs 81 | 82 | 83 | MultipleInstances.cs 84 | 85 | 86 | NotRunning.cs 87 | 88 | 89 | ResXFileCodeGenerator 90 | Resources.Designer.cs 91 | Designer 92 | 93 | 94 | True 95 | Resources.resx 96 | 97 | 98 | ButtonInputs.cs 99 | 100 | 101 | SettingsSingleFileGenerator 102 | Settings.Designer.cs 103 | 104 | 105 | True 106 | Settings.settings 107 | True 108 | 109 | 110 | 111 | 112 | 113 | 114 | 121 | -------------------------------------------------------------------------------- /AutoClicker/ButtonInputs.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace AutoClicker 2 | { 3 | partial class ButtonInputs 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 Component 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.cbButtonEnable = new System.Windows.Forms.CheckBox(); 32 | this.cbHold = new System.Windows.Forms.CheckBox(); 33 | this.lblDelay = new System.Windows.Forms.Label(); 34 | this.numDelay = new System.Windows.Forms.NumericUpDown(); 35 | ((System.ComponentModel.ISupportInitialize)(this.numDelay)).BeginInit(); 36 | this.SuspendLayout(); 37 | // 38 | // cbButtonEnable 39 | // 40 | this.cbButtonEnable.Anchor = System.Windows.Forms.AnchorStyles.None; 41 | this.cbButtonEnable.AutoSize = true; 42 | this.cbButtonEnable.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); 43 | this.cbButtonEnable.Location = new System.Drawing.Point(18, 12); 44 | this.cbButtonEnable.Name = "cbButtonEnable"; 45 | this.cbButtonEnable.Size = new System.Drawing.Size(107, 21); 46 | this.cbButtonEnable.TabIndex = 1; 47 | this.cbButtonEnable.Text = "Button name"; 48 | this.cbButtonEnable.UseVisualStyleBackColor = true; 49 | this.cbButtonEnable.Click += new System.EventHandler(this.CbButtonEnable_Click); 50 | // 51 | // cbHold 52 | // 53 | this.cbHold.Anchor = System.Windows.Forms.AnchorStyles.None; 54 | this.cbHold.AutoSize = true; 55 | this.cbHold.Enabled = false; 56 | this.cbHold.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); 57 | this.cbHold.Location = new System.Drawing.Point(18, 48); 58 | this.cbHold.Name = "cbHold"; 59 | this.cbHold.Size = new System.Drawing.Size(100, 21); 60 | this.cbHold.TabIndex = 2; 61 | this.cbHold.Text = "Hold button"; 62 | this.cbHold.UseVisualStyleBackColor = true; 63 | this.cbHold.Click += new System.EventHandler(this.CbHold_Click); 64 | // 65 | // lblDelay 66 | // 67 | this.lblDelay.Anchor = System.Windows.Forms.AnchorStyles.None; 68 | this.lblDelay.AutoSize = true; 69 | this.lblDelay.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); 70 | this.lblDelay.Location = new System.Drawing.Point(19, 83); 71 | this.lblDelay.Name = "lblDelay"; 72 | this.lblDelay.Size = new System.Drawing.Size(80, 17); 73 | this.lblDelay.TabIndex = 3; 74 | this.lblDelay.Text = "Delay (ms):"; 75 | // 76 | // numDelay 77 | // 78 | this.numDelay.Anchor = System.Windows.Forms.AnchorStyles.None; 79 | this.numDelay.Enabled = false; 80 | this.numDelay.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); 81 | this.numDelay.Location = new System.Drawing.Point(105, 83); 82 | this.numDelay.Minimum = new decimal(new int[] { 83 | 1, 84 | 0, 85 | 0, 86 | 0}); 87 | this.numDelay.Name = "numDelay"; 88 | this.numDelay.Size = new System.Drawing.Size(120, 23); 89 | this.numDelay.TabIndex = 4; 90 | this.numDelay.Value = new decimal(new int[] { 91 | 1, 92 | 0, 93 | 0, 94 | 0}); 95 | // 96 | // UserInput 97 | // 98 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 99 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 100 | this.Controls.Add(this.numDelay); 101 | this.Controls.Add(this.lblDelay); 102 | this.Controls.Add(this.cbHold); 103 | this.Controls.Add(this.cbButtonEnable); 104 | this.Name = "UserInput"; 105 | this.Size = new System.Drawing.Size(240, 130); 106 | ((System.ComponentModel.ISupportInitialize)(this.numDelay)).EndInit(); 107 | this.ResumeLayout(false); 108 | this.PerformLayout(); 109 | 110 | } 111 | 112 | #endregion 113 | private System.Windows.Forms.CheckBox cbButtonEnable; 114 | private System.Windows.Forms.CheckBox cbHold; 115 | private System.Windows.Forms.Label lblDelay; 116 | private System.Windows.Forms.NumericUpDown numDelay; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /AutoClicker/NotRunning.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace AutoClicker 2 | { 3 | partial class NotRunning 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.cmbProcess = new System.Windows.Forms.ComboBox(); 32 | this.btnOK = new System.Windows.Forms.Button(); 33 | this.btnCancel = new System.Windows.Forms.Button(); 34 | this.lblGameWindow = new System.Windows.Forms.Label(); 35 | this.lblInfo = new System.Windows.Forms.Label(); 36 | this.SuspendLayout(); 37 | // 38 | // cmbProcess 39 | // 40 | this.cmbProcess.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 41 | this.cmbProcess.FormattingEnabled = true; 42 | this.cmbProcess.Location = new System.Drawing.Point(157, 180); 43 | this.cmbProcess.MaxDropDownItems = 50; 44 | this.cmbProcess.Name = "cmbProcess"; 45 | this.cmbProcess.Size = new System.Drawing.Size(479, 28); 46 | this.cmbProcess.TabIndex = 0; 47 | // 48 | // btnOK 49 | // 50 | this.btnOK.Location = new System.Drawing.Point(396, 238); 51 | this.btnOK.Name = "btnOK"; 52 | this.btnOK.Size = new System.Drawing.Size(115, 44); 53 | this.btnOK.TabIndex = 1; 54 | this.btnOK.Text = "OK"; 55 | this.btnOK.UseVisualStyleBackColor = true; 56 | this.btnOK.Click += new System.EventHandler(this.BtnOK_Click); 57 | // 58 | // btnCancel 59 | // 60 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 61 | this.btnCancel.Location = new System.Drawing.Point(533, 238); 62 | this.btnCancel.Name = "btnCancel"; 63 | this.btnCancel.Size = new System.Drawing.Size(115, 44); 64 | this.btnCancel.TabIndex = 2; 65 | this.btnCancel.Text = "Cancel"; 66 | this.btnCancel.UseVisualStyleBackColor = true; 67 | // 68 | // lblGameWindow 69 | // 70 | this.lblGameWindow.AutoSize = true; 71 | this.lblGameWindow.Location = new System.Drawing.Point(34, 183); 72 | this.lblGameWindow.Name = "lblGameWindow"; 73 | this.lblGameWindow.Size = new System.Drawing.Size(117, 20); 74 | this.lblGameWindow.TabIndex = 3; 75 | this.lblGameWindow.Text = "Game Window:"; 76 | // 77 | // lblInfo 78 | // 79 | this.lblInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 80 | this.lblInfo.Location = new System.Drawing.Point(33, 33); 81 | this.lblInfo.Name = "lblInfo"; 82 | this.lblInfo.Size = new System.Drawing.Size(596, 144); 83 | this.lblInfo.TabIndex = 4; 84 | this.lblInfo.Text = "No Minecraft game window was found. This may mean you\'re using a modded client. I" + 85 | "f you\'re sure Minecraft is running, please select it from the windows listed bel" + 86 | "ow."; 87 | // 88 | // NotRunning 89 | // 90 | this.AcceptButton = this.btnOK; 91 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); 92 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 93 | this.CancelButton = this.btnCancel; 94 | this.ClientSize = new System.Drawing.Size(673, 297); 95 | this.Controls.Add(this.lblInfo); 96 | this.Controls.Add(this.lblGameWindow); 97 | this.Controls.Add(this.btnCancel); 98 | this.Controls.Add(this.btnOK); 99 | this.Controls.Add(this.cmbProcess); 100 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 101 | this.MaximizeBox = false; 102 | this.MinimizeBox = false; 103 | this.Name = "NotRunning"; 104 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 105 | this.Text = "No Minecraft Client Found!"; 106 | this.Load += new System.EventHandler(this.NotRunning_Load); 107 | this.ResumeLayout(false); 108 | this.PerformLayout(); 109 | 110 | } 111 | 112 | #endregion 113 | 114 | private System.Windows.Forms.ComboBox cmbProcess; 115 | private System.Windows.Forms.Button btnOK; 116 | private System.Windows.Forms.Button btnCancel; 117 | private System.Windows.Forms.Label lblGameWindow; 118 | private System.Windows.Forms.Label lblInfo; 119 | } 120 | } -------------------------------------------------------------------------------- /AutoClicker/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 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /AutoClicker/Main.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace AutoClicker 2 | { 3 | partial class Main 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.btn_start = new System.Windows.Forms.Button(); 32 | this.lblStartTime = new System.Windows.Forms.Label(); 33 | this.btn_stop = new System.Windows.Forms.Button(); 34 | this.biLeftMouse = new AutoClicker.ButtonInputs("Left mouse button", Win32Api.WmLbuttonDown, Win32Api.WmLbuttonDown + 1); 35 | this.biRightMouse = new AutoClicker.ButtonInputs("Right mouse button", Win32Api.WmRbuttonDown, Win32Api.WmRbuttonDown + 1); 36 | this.lblStarted = new System.Windows.Forms.Label(); 37 | this.SuspendLayout(); 38 | // 39 | // btn_start 40 | // 41 | this.btn_start.Location = new System.Drawing.Point(269, 160); 42 | this.btn_start.Name = "btn_start"; 43 | this.btn_start.Size = new System.Drawing.Size(88, 51); 44 | this.btn_start.TabIndex = 0; 45 | this.btn_start.Text = "START!"; 46 | this.btn_start.UseVisualStyleBackColor = true; 47 | this.btn_start.Click += new System.EventHandler(this.Btn_action_Click); 48 | // 49 | // lblStartTime 50 | // 51 | this.lblStartTime.AutoSize = true; 52 | this.lblStartTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); 53 | this.lblStartTime.Location = new System.Drawing.Point(233, 222); 54 | this.lblStartTime.Name = "lblStartTime"; 55 | this.lblStartTime.Size = new System.Drawing.Size(34, 17); 56 | this.lblStartTime.TabIndex = 2; 57 | this.lblStartTime.Text = "time"; 58 | this.lblStartTime.Visible = false; 59 | // 60 | // btn_stop 61 | // 62 | this.btn_stop.Enabled = false; 63 | this.btn_stop.Location = new System.Drawing.Point(165, 160); 64 | this.btn_stop.Name = "btn_stop"; 65 | this.btn_stop.Size = new System.Drawing.Size(88, 51); 66 | this.btn_stop.TabIndex = 3; 67 | this.btn_stop.Text = "STOP!"; 68 | this.btn_stop.UseVisualStyleBackColor = true; 69 | this.btn_stop.Click += new System.EventHandler(this.Btn_stop_Click); 70 | // 71 | // biLeftMouse 72 | // 73 | this.biLeftMouse.Location = new System.Drawing.Point(12, 18); 74 | this.biLeftMouse.Name = "biLeftMouse"; 75 | this.biLeftMouse.Size = new System.Drawing.Size(240, 130); 76 | this.biLeftMouse.TabIndex = 4; 77 | // 78 | // biRightMouse 79 | // 80 | this.biRightMouse.Location = new System.Drawing.Point(258, 18); 81 | this.biRightMouse.Name = "biRightMouse"; 82 | this.biRightMouse.Size = new System.Drawing.Size(240, 130); 83 | this.biRightMouse.TabIndex = 5; 84 | // 85 | // lblStarted 86 | // 87 | this.lblStarted.AutoSize = true; 88 | this.lblStarted.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); 89 | this.lblStarted.Location = new System.Drawing.Point(162, 222); 90 | this.lblStarted.Name = "lblStarted"; 91 | this.lblStarted.Size = new System.Drawing.Size(74, 17); 92 | this.lblStarted.TabIndex = 6; 93 | this.lblStarted.Text = "Started at:"; 94 | this.lblStarted.Visible = false; 95 | // 96 | // Main 97 | // 98 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 99 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 100 | this.ClientSize = new System.Drawing.Size(518, 250); 101 | this.Controls.Add(this.lblStarted); 102 | this.Controls.Add(this.biRightMouse); 103 | this.Controls.Add(this.biLeftMouse); 104 | this.Controls.Add(this.btn_stop); 105 | this.Controls.Add(this.lblStartTime); 106 | this.Controls.Add(this.btn_start); 107 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 108 | this.MaximizeBox = false; 109 | this.MinimizeBox = false; 110 | this.Name = "Main"; 111 | this.Text = "Auto-Clicker"; 112 | this.ResumeLayout(false); 113 | this.PerformLayout(); 114 | 115 | } 116 | 117 | #endregion 118 | 119 | private System.Windows.Forms.Button btn_start; 120 | private System.Windows.Forms.Label lblStartTime; 121 | private System.Windows.Forms.Button btn_stop; 122 | private ButtonInputs biLeftMouse; 123 | private ButtonInputs biRightMouse; 124 | private System.Windows.Forms.Label lblStarted; 125 | } 126 | } 127 | 128 | -------------------------------------------------------------------------------- /AutoClicker/Main.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 | -------------------------------------------------------------------------------- /AutoClicker/ButtonInputs.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 | -------------------------------------------------------------------------------- /AutoClicker/MultipleInstances.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 | -------------------------------------------------------------------------------- /AutoClicker/NotRunning.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 | -------------------------------------------------------------------------------- /AutoClicker/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | using System.Windows.Forms; 9 | 10 | namespace AutoClicker 11 | { 12 | public partial class Main : Form 13 | { 14 | private readonly Dictionary> instanceClickers = new Dictionary>(); 15 | private static readonly List WindowTitles = new List 16 | { 17 | "Minecraft", 18 | "RLCraft" 19 | }; 20 | 21 | public Main() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | private async void Btn_action_Click(object sender, EventArgs e) 27 | { 28 | try 29 | { 30 | EnableElements(false); 31 | var mcProcesses = Process.GetProcesses().Where(b => b.ProcessName.StartsWith("java") && WindowTitles.Any(title => b.MainWindowTitle.Contains(title))).ToList(); 32 | var mainHandle = Handle; 33 | 34 | if (!mcProcesses.Any()) 35 | { 36 | // if we first don't find any windows matching an expected name, give the user the ability to override 37 | var notRunning = new NotRunning(); 38 | if (notRunning.ShowDialog() != DialogResult.OK) 39 | { 40 | EnableElements(true); 41 | return; 42 | } 43 | 44 | if(!string.IsNullOrEmpty(notRunning.ProcessTitle)) 45 | mcProcesses = Process.GetProcesses().Where(b => b.MainWindowTitle == notRunning.ProcessTitle).ToList(); 46 | } 47 | 48 | if (!mcProcesses.Any()) 49 | { 50 | MessageBox.Show(@"Unable to find Minecraft process!", @"Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); 51 | EnableElements(true); 52 | return; 53 | } 54 | 55 | if (mcProcesses.Count > 1) 56 | { 57 | using (var instancesForm = new MultipleInstances(mcProcesses)) 58 | { 59 | if (instancesForm.ShowDialog() != DialogResult.OK) 60 | { 61 | EnableElements(true); 62 | return; 63 | } 64 | 65 | mcProcesses = instancesForm.SelectedInstances.Select(Process.GetProcessById).ToList(); 66 | } 67 | } 68 | 69 | lblStartTime.Text = DateTime.Now.ToString("MMMM dd HH:mm tt"); 70 | lblStarted.Visible = true; 71 | lblStartTime.Visible = true; 72 | 73 | foreach (var mcProcess in mcProcesses) 74 | { 75 | var minecraftHandle = mcProcess.MainWindowHandle; 76 | FocusToggle(minecraftHandle); 77 | 78 | await Task.Run(() => CountDown(mainHandle)); 79 | 80 | // Right click needs to be ahead of left click for concrete mining 81 | if (biRightMouse.Needed) 82 | { 83 | var clicker = biRightMouse.StartClicking(minecraftHandle); 84 | AddToInstanceClickers(mcProcess, clicker); 85 | } 86 | 87 | /* 88 | * This sleep is needed, because if you want to mine concrete, then Minecraft starts to hold left click first 89 | * and it won't place the block in your second hand for some reason... 90 | */ 91 | Thread.Sleep(100); 92 | 93 | if (biLeftMouse.Needed) 94 | { 95 | var clicker = biLeftMouse.StartClicking(minecraftHandle); 96 | AddToInstanceClickers(mcProcess, clicker); 97 | } 98 | } 99 | } 100 | catch (Exception ex) 101 | { 102 | MessageBox.Show(ex.Message, "An error occured", MessageBoxButtons.OK, MessageBoxIcon.Error); 103 | Stop(); 104 | } 105 | } 106 | 107 | private void CountDown(IntPtr mainHandle) 108 | { 109 | SetControlPropertyThreadSafe(btn_start, "Text", @"Starting in: "); 110 | Thread.Sleep(750); 111 | 112 | for (var i = 5; i > 0; i--) 113 | { 114 | SetControlPropertyThreadSafe(btn_start, "Text", i.ToString()); 115 | Thread.Sleep(750); 116 | } 117 | 118 | FocusToggle(mainHandle); 119 | SetControlPropertyThreadSafe(btn_start, "Text", @"Running..."); 120 | Thread.Sleep(750); 121 | } 122 | 123 | private void AddToInstanceClickers(Process mcProcess, Clicker clicker) 124 | { 125 | if (instanceClickers.ContainsKey(mcProcess)) 126 | instanceClickers[mcProcess].Add(clicker); 127 | else 128 | instanceClickers.Add(mcProcess, new List { clicker }); 129 | } 130 | 131 | private void Btn_stop_Click(object sender, EventArgs e) 132 | { 133 | Stop(); 134 | } 135 | 136 | private void Stop() 137 | { 138 | btn_stop.Enabled = false; 139 | 140 | foreach (var clickers in instanceClickers.Values) 141 | { 142 | foreach (var clicker in clickers) 143 | { 144 | clicker?.Dispose(); 145 | } 146 | } 147 | 148 | instanceClickers.Clear(); 149 | 150 | lblStarted.Visible = false; 151 | lblStartTime.Visible = false; 152 | 153 | btn_start.Text = "START"; 154 | EnableElements(true); 155 | } 156 | 157 | private void EnableElements(bool enable) 158 | { 159 | btn_start.Enabled = enable; 160 | biLeftMouse.Enabled = enable; 161 | biRightMouse.Enabled = enable; 162 | btn_stop.Enabled = !enable; 163 | } 164 | 165 | private static void FocusToggle(IntPtr hwnd) 166 | { 167 | Thread.Sleep(200); 168 | Win32Api.SetForegroundWindow(hwnd); 169 | } 170 | 171 | private delegate void SetControlPropertyThreadSafeDelegate(Control control, string propertyName, object propertyValue); 172 | public static void SetControlPropertyThreadSafe(Control control, string propertyName, object propertyValue) 173 | { 174 | if (control.InvokeRequired) 175 | control.Invoke(new SetControlPropertyThreadSafeDelegate(SetControlPropertyThreadSafe), control, propertyName, propertyValue); 176 | else 177 | control.GetType().InvokeMember(propertyName, BindingFlags.SetProperty, null, control, new[] { propertyValue }); 178 | }//end SetControlPropertyThreadSafe 179 | } 180 | } 181 | --------------------------------------------------------------------------------