Added Source code for CC-Clicker 2.0
This commit is contained in:
parent
b72576dbef
commit
ba94e7f816
63
.gitattributes
vendored
63
.gitattributes
vendored
@ -1,2 +1,63 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
|
11
.gitignore
vendored
11
.gitignore
vendored
@ -42,6 +42,7 @@ dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
@ -142,7 +143,7 @@ publish/
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
#*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
@ -188,6 +189,7 @@ ClientBin/
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
@ -250,3 +252,10 @@ paket-files/
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
@ -1,25 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27130.2027
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoClicker", "AutoClicker.csproj", "{C567B050-F98B-49B5-AC6F-8D63573F3161}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C567B050-F98B-49B5-AC6F-8D63573F3161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C567B050-F98B-49B5-AC6F-8D63573F3161}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C567B050-F98B-49B5-AC6F-8D63573F3161}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C567B050-F98B-49B5-AC6F-8D63573F3161}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2DE97599-9181-4959-9211-94158082618F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -4,13 +4,14 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{C567B050-F98B-49B5-AC6F-8D63573F3161}</ProjectGuid>
|
||||
<ProjectGuid>{61B4565A-608D-4107-8656-3B24F5C61997}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>AutoClicker</RootNamespace>
|
||||
<AssemblyName>AutoClicker</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<RootNamespace>CC_Clicker_2._0</RootNamespace>
|
||||
<AssemblyName>CC-Clicker 2.0</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@ -31,6 +32,9 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>C_64.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@ -78,5 +82,8 @@
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="C_64.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
158
Form1.Designer.cs
generated
158
Form1.Designer.cs
generated
@ -1,4 +1,4 @@
|
||||
namespace AutoClicker
|
||||
namespace CC_Clicker_2._0
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
@ -30,98 +30,102 @@
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.ClickTimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.clickBox = new System.Windows.Forms.CheckBox();
|
||||
this.rightBox = new System.Windows.Forms.CheckBox();
|
||||
this.timeBox = new System.Windows.Forms.TextBox();
|
||||
this.keyButton = new System.Windows.Forms.Button();
|
||||
this.DelmBox = new System.Windows.Forms.CheckBox();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.delmVal = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
// clickBox
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(9, 6);
|
||||
this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(56, 19);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "Enable";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
this.clickBox.AutoSize = true;
|
||||
this.clickBox.Location = new System.Drawing.Point(12, 14);
|
||||
this.clickBox.Name = "clickBox";
|
||||
this.clickBox.Size = new System.Drawing.Size(49, 17);
|
||||
this.clickBox.TabIndex = 0;
|
||||
this.clickBox.Text = "Click";
|
||||
this.clickBox.UseVisualStyleBackColor = true;
|
||||
this.clickBox.CheckedChanged += new System.EventHandler(this.clickBox_CheckedChanged);
|
||||
//
|
||||
// button2
|
||||
// rightBox
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(9, 30);
|
||||
this.button2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(56, 19);
|
||||
this.button2.TabIndex = 1;
|
||||
this.button2.Text = "Disable";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
this.rightBox.AutoSize = true;
|
||||
this.rightBox.Location = new System.Drawing.Point(12, 42);
|
||||
this.rightBox.Name = "rightBox";
|
||||
this.rightBox.Size = new System.Drawing.Size(51, 17);
|
||||
this.rightBox.TabIndex = 1;
|
||||
this.rightBox.Text = "Right";
|
||||
this.rightBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// textBox1
|
||||
// timeBox
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(70, 6);
|
||||
this.textBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(98, 20);
|
||||
this.textBox1.TabIndex = 2;
|
||||
this.textBox1.Text = "10";
|
||||
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
|
||||
this.timeBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.timeBox.BackColor = System.Drawing.Color.White;
|
||||
this.timeBox.Location = new System.Drawing.Point(101, 12);
|
||||
this.timeBox.Name = "timeBox";
|
||||
this.timeBox.Size = new System.Drawing.Size(100, 20);
|
||||
this.timeBox.TabIndex = 2;
|
||||
this.timeBox.Text = "100";
|
||||
this.timeBox.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
|
||||
//
|
||||
// label1
|
||||
// keyButton
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(68, 27);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(92, 13);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "Times per Secons";
|
||||
this.keyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.keyButton.BackColor = System.Drawing.Color.Red;
|
||||
this.keyButton.Location = new System.Drawing.Point(101, 38);
|
||||
this.keyButton.Name = "keyButton";
|
||||
this.keyButton.Size = new System.Drawing.Size(100, 23);
|
||||
this.keyButton.TabIndex = 3;
|
||||
this.keyButton.Text = "Click to set key";
|
||||
this.keyButton.UseVisualStyleBackColor = false;
|
||||
this.keyButton.Click += new System.EventHandler(this.keyButton_Click);
|
||||
//
|
||||
// ClickTimer
|
||||
// DelmBox
|
||||
//
|
||||
this.ClickTimer.Tick += new System.EventHandler(this.ClickTimer_Tick);
|
||||
this.DelmBox.AutoSize = true;
|
||||
this.DelmBox.Location = new System.Drawing.Point(12, 69);
|
||||
this.DelmBox.Name = "DelmBox";
|
||||
this.DelmBox.Size = new System.Drawing.Size(69, 17);
|
||||
this.DelmBox.TabIndex = 4;
|
||||
this.DelmBox.Text = "DelayMix";
|
||||
this.DelmBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label2
|
||||
// timer1
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(7, 50);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(88, 13);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "Hold shift to click";
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// button3
|
||||
// delmVal
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(118, 42);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(56, 20);
|
||||
this.button3.TabIndex = 5;
|
||||
this.button3.Text = "Left";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
this.delmVal.BackColor = System.Drawing.Color.White;
|
||||
this.delmVal.Location = new System.Drawing.Point(101, 67);
|
||||
this.delmVal.Name = "delmVal";
|
||||
this.delmVal.Size = new System.Drawing.Size(100, 20);
|
||||
this.delmVal.TabIndex = 5;
|
||||
this.delmVal.Text = "4";
|
||||
this.delmVal.TextChanged += new System.EventHandler(this.delmVal_TextChanged);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(176, 63);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.ClientSize = new System.Drawing.Size(213, 93);
|
||||
this.Controls.Add(this.delmVal);
|
||||
this.Controls.Add(this.DelmBox);
|
||||
this.Controls.Add(this.keyButton);
|
||||
this.Controls.Add(this.timeBox);
|
||||
this.Controls.Add(this.rightBox);
|
||||
this.Controls.Add(this.clickBox);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(229, 132);
|
||||
this.MinimumSize = new System.Drawing.Size(229, 132);
|
||||
this.Name = "Form1";
|
||||
this.Text = "CC-Clicker";
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.Text = "CC-Clicker 2.0";
|
||||
this.Resize += new System.EventHandler(this.Form1_Resize);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@ -129,13 +133,13 @@
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Timer ClickTimer;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.CheckBox clickBox;
|
||||
private System.Windows.Forms.CheckBox rightBox;
|
||||
private System.Windows.Forms.TextBox timeBox;
|
||||
private System.Windows.Forms.Button keyButton;
|
||||
private System.Windows.Forms.CheckBox DelmBox;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
private System.Windows.Forms.TextBox delmVal;
|
||||
}
|
||||
}
|
||||
|
||||
|
155
Form1.cs
155
Form1.cs
@ -1,88 +1,135 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Drawing;
|
||||
|
||||
namespace AutoClicker
|
||||
#pragma warning disable IDE1006
|
||||
namespace CC_Clicker_2._0
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
|
||||
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
|
||||
private const int MOUSEEVENTF_LEFTUP = 0x04;
|
||||
private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
|
||||
private const int MOUSEEVENTF_RIGHTUP = 0x10;
|
||||
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
SessionData.keyButton = keyButton;
|
||||
}
|
||||
|
||||
public static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
|
||||
{
|
||||
if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
|
||||
{
|
||||
int vkCode = Marshal.ReadInt32(lParam);
|
||||
if (SessionData.isSettingKey)
|
||||
{
|
||||
SessionData.key = (Keys)vkCode;
|
||||
SessionData.keyButton.BackColor = Color.FromArgb(224, 224, 224);
|
||||
SessionData.keyButton.Text = ((Keys)vkCode).ToString();
|
||||
SessionData.isSettingKey = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((Keys)vkCode == SessionData.key)
|
||||
SessionData.isClicking = !SessionData.isClicking;
|
||||
}
|
||||
}
|
||||
return CallNextHookEx(_hookID, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
private void clickBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SessionData.isClicking = false;
|
||||
timer1.Enabled = clickBox.Checked;
|
||||
}
|
||||
|
||||
private void textBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ClickTimer.Interval = 1000 / Int32.Parse(textBox1.Text);
|
||||
if (int.TryParse(timeBox.Text, out int re) && re > 0)
|
||||
{
|
||||
SessionData.setDelay = re;
|
||||
timer1.Interval = re;
|
||||
timeBox.BackColor = Color.White;
|
||||
} else
|
||||
{
|
||||
timeBox.BackColor = Color.Red;
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
private void delmVal_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ClickTimer.Start();
|
||||
button2.Enabled = true;
|
||||
button1.Enabled = false;
|
||||
textBox1.Enabled = false;
|
||||
if (int.TryParse(delmVal.Text, out int re) && re > 0 && re % 2 == 0)
|
||||
{
|
||||
SessionData.delmVal = re;
|
||||
delmVal.BackColor = Color.White;
|
||||
}
|
||||
else
|
||||
{
|
||||
delmVal.BackColor = Color.Red;
|
||||
}
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
private void keyButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClickTimer.Stop();
|
||||
button2.Enabled = false;
|
||||
button1.Enabled = true;
|
||||
textBox1.Enabled = true;
|
||||
SessionData.isSettingKey = true;
|
||||
keyButton.BackColor = Color.FromArgb(128, 255, 128);
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
ClickTimer.Stop();
|
||||
button2.Enabled = false;
|
||||
button1.Enabled = true;
|
||||
textBox1.Enabled = true;
|
||||
}
|
||||
|
||||
private void ClickTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if ((Control.ModifierKeys & Keys.Shift) != 0)
|
||||
{
|
||||
if (SessionData.isClicking) {
|
||||
uint X = (uint)Cursor.Position.X;
|
||||
uint Y = (uint)Cursor.Position.Y;
|
||||
switch (button3.Text)
|
||||
{
|
||||
case "Left":
|
||||
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
|
||||
break;
|
||||
default:
|
||||
mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP, X, Y, 0, 0);
|
||||
break;
|
||||
}
|
||||
if (rightBox.Checked)
|
||||
mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP, X, Y, 0, 0);
|
||||
else
|
||||
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
|
||||
if (DelmBox.Checked)
|
||||
timer1.Interval = Math.Max(SessionData.setDelay + (new Random().Next(0, SessionData.delmVal) - (SessionData.delmVal / 2)), 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
private void Form1_Resize(object sender, EventArgs e) => WindowState = FormWindowState.Normal;
|
||||
|
||||
#region DllImports and dummy code
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
|
||||
public const int MOUSEEVENTF_LEFTDOWN = 0x02;
|
||||
public const int MOUSEEVENTF_LEFTUP = 0x04;
|
||||
public const int MOUSEEVENTF_RIGHTDOWN = 0x08;
|
||||
public const int MOUSEEVENTF_RIGHTUP = 0x10;
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool UnhookWindowsHookEx(IntPtr hhk);
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
public static extern IntPtr GetModuleHandle(string lpModuleName);
|
||||
public static IntPtr SetHook(LowLevelKeyboardProc proc)
|
||||
{
|
||||
switch (button3.Text)
|
||||
using (Process curProcess = Process.GetCurrentProcess())
|
||||
using (ProcessModule curModule = curProcess.MainModule)
|
||||
{
|
||||
case "Left":
|
||||
button3.Text = "Right";
|
||||
break;
|
||||
default:
|
||||
button3.Text = "Left";
|
||||
break;
|
||||
return SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
|
||||
}
|
||||
}
|
||||
|
||||
public delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
|
||||
public const int WH_KEYBOARD_LL = 13;
|
||||
public const int WM_KEYDOWN = 0x0100;
|
||||
public static LowLevelKeyboardProc _proc = HookCallback;
|
||||
public static IntPtr _hookID = IntPtr.Zero;
|
||||
public static class SessionData
|
||||
{
|
||||
public static Button keyButton;
|
||||
public static bool isSettingKey = false;
|
||||
public static Keys key = Keys.LShiftKey;
|
||||
public static bool isClicking = false;
|
||||
public static int setDelay = 100;
|
||||
public static int delmVal = 4;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ClickTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright 2018 CreepyCrafter24
|
||||
Copyright 2019 CreepyCrafter24
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AutoClicker
|
||||
namespace CC_Clicker_2._0
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
@ -16,7 +16,9 @@ namespace AutoClicker
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Form1._hookID = Form1.SetHook(Form1._proc);
|
||||
Application.Run(new Form1());
|
||||
Form1.UnhookWindowsHookEx(Form1._hookID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("AutoClicker")]
|
||||
[assembly: AssemblyTitle("CC-Clicker 2.0")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AutoClicker")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyProduct("CC-Clicker 2.0")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("c567b050-f98b-49b5-ac6f-8d63573f3161")]
|
||||
[assembly: Guid("61b4565a-608d-4107-8656-3b24f5c61997")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
|
4
Properties/Resources.Designer.cs
generated
4
Properties/Resources.Designer.cs
generated
@ -8,7 +8,7 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AutoClicker.Properties
|
||||
namespace CC_Clicker_2._0.Properties
|
||||
{
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ namespace AutoClicker.Properties
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoClicker.Properties.Resources", typeof(Resources).Assembly);
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CC_Clicker_2._0.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
|
2
Properties/Settings.Designer.cs
generated
2
Properties/Settings.Designer.cs
generated
@ -8,7 +8,7 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AutoClicker.Properties
|
||||
namespace CC_Clicker_2._0.Properties
|
||||
{
|
||||
|
||||
|
||||
|
Binary file not shown.
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
</configuration>
|
Binary file not shown.
Binary file not shown.
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
</configuration>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
08bf06d9cc1fca392bb7a08d0cd993c764c4ee4c
|
@ -1,10 +0,0 @@
|
||||
C:\Users\Johannes\source\repos\AutoClicker\bin\Debug\AutoClicker.exe.config
|
||||
C:\Users\Johannes\source\repos\AutoClicker\bin\Debug\AutoClicker.exe
|
||||
C:\Users\Johannes\source\repos\AutoClicker\bin\Debug\AutoClicker.pdb
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Debug\AutoClicker.csprojResolveAssemblyReference.cache
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Debug\AutoClicker.Form1.resources
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Debug\AutoClicker.Properties.Resources.resources
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Debug\AutoClicker.csproj.GenerateResource.Cache
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Debug\AutoClicker.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Debug\AutoClicker.exe
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Debug\AutoClicker.pdb
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
54d859b9ab6e1ef1406c48e3bf3ada09d9bd7a01
|
@ -1,9 +0,0 @@
|
||||
C:\Users\Johannes\source\repos\AutoClicker\bin\Release\AutoClicker.exe.config
|
||||
C:\Users\Johannes\source\repos\AutoClicker\bin\Release\AutoClicker.exe
|
||||
C:\Users\Johannes\source\repos\AutoClicker\bin\Release\AutoClicker.pdb
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Release\AutoClicker.Form1.resources
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Release\AutoClicker.Properties.Resources.resources
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Release\AutoClicker.csproj.GenerateResource.Cache
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Release\AutoClicker.csproj.CoreCompileInputs.cache
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Release\AutoClicker.exe
|
||||
C:\Users\Johannes\source\repos\AutoClicker\obj\Release\AutoClicker.pdb
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user