Merhaba arkadaşlar, bugünkü videomuzda c# dili kullanarak otomatik olarak mouse kontrolü yapacağız. Yaptığımız uygulamayı da kullanarak internetten takipkas sitesinden video izleterek puan toplayacağız. Bize destek olmak için videomuzu beğenip kanalımıza abone olabilirsiniz. Eğer başka siteler için de otomatik tıklama programı isterseniz bize yorumlarda belirtebilirsiniz.
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace AutoClick
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
public class Win32
{
[DllImport("User32.Dll")]
public static extern long SetCursorPos(int x, int y);
[DllImport("User32.Dll")]
public static extern bool ClientToScreen(IntPtr hWnd, ref POINT point);
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int x;
public int y;
}
}
public RegistryKey reg;
string sn60izle, sn60basla, sn60gec, sn60gecis, sn120izle, sn120basla, sn120gec, sn120gecis;
int tikSayac = 0;
private void button3_Click(object sender, EventArgs e)
{
timer1.Start();
tikTuru = "basla60";
}
private void button7_Click(object sender, EventArgs e)
{
timer1.Start();
tikTuru = "izle120";
}
private void button8_Click(object sender, EventArgs e)
{
timer1.Start();
tikTuru = "basla120";
}
private void button9_Click(object sender, EventArgs e)
{
timer1.Start();
tikTuru = "gec120";
}
private void button10_Click(object sender, EventArgs e)
{
timer1.Start();
tikTuru = "gecis120";
}
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
timer2.Interval = Convert.ToInt32(numericUpDown1.Value.ToString());
}
string donguTuru = "";
private void button1_Click(object sender, EventArgs e)
{
if (timer2.Enabled == true)
{
timer2.Enabled = !timer2.Enabled;
button1.Text = "60 Saniye Döngüye Başla";
}
else
{
timer2.Enabled = !timer2.Enabled;
button1.Text = "60 Saniye Döngüyü Durdur";
sayac = 0; say60sn = 0; sayac2 = 0; say = 0;
}
donguTuru = "60sndongu";
button6.Enabled = !timer2.Enabled;
button11.Enabled = !timer2.Enabled;
}
private void button6_Click(object sender, EventArgs e)
{
if (timer2.Enabled == true)
{
timer2.Enabled = !timer2.Enabled;
button6.Text = "120 Saniye Döngüye Başla";
}
else
{
timer2.Enabled = !timer2.Enabled;
button6.Text = "120 Saniye Döngüyü Durdur";
sayac = 0; say60sn = 0; sayac2 = 0; say = 0;
}
donguTuru = "120sndongu";
button1.Enabled = !timer2.Enabled;
button11.Enabled = !timer2.Enabled;
}
int sayac = 0, say60sn = 0, sayac2 = 0, say = 0;
private void button11_Click(object sender, EventArgs e)
{
if (timer2.Enabled == true)
{
timer2.Enabled = !timer2.Enabled;
button11.Text = "Sıralı Döngüye Başla";
}
else
{
timer2.Enabled = !timer2.Enabled;
button11.Text = "Sıralı Döngüyü Durdur";
sayac = 0; say60sn = 0; sayac2 = 0; say = 0;
}
donguTuru = "siralidongu";
button6.Enabled = !timer2.Enabled;
button1.Enabled = !timer2.Enabled;
}
int sn60say = 0;
private void timer2_Tick(object sender, EventArgs e)
{
if(donguTuru=="60sndongu")
{
sayac++;
if (sayac == 4)
{
MouseClickIzle(sn60izle);
}
else if (sayac == 9)
{
MouseClickIzle(sn60basla);
}
else if (sayac == 73)
{
MouseClickIzle(sn60gec);
sayac = 0;
sn60say++;
}
if (sn60say == 10)
{
Thread.Sleep(2000);
MouseClickIzle(sn60gecis);
sn60say = 0;
}
}
else if (donguTuru == "120sndongu")
{
sayac++;
if (sayac == 4)
{
MouseClickIzle(sn120izle);
}
else if (sayac == 9)
{
MouseClickIzle(sn120basla);
}
else if (sayac == 131)
{
MouseClickIzle(sn120gec);
sayac = 0;
sn60say++;
}
if (sn60say == 5)
{
Thread.Sleep(2000);
MouseClickIzle(sn120gecis);
sn60say = 0;
}
}
else if(donguTuru == "siralidongu")
{
if (say60sn < 8)
{
sayac++;
if (sayac == 4)
{
MouseClickIzle(sn120izle);
}
else if (sayac == 9)
{
MouseClickIzle(sn120basla);
}
else if (sayac == 131)
{
MouseClickIzle(sn120gec);
sayac = 0;
say60sn++;
if (say60sn == 8)
{
Thread.Sleep(2000);
MouseClickIzle(sn60gecis);
}
}
}
else
{
sayac2++;
if (sayac2 == 4)
{
MouseClickIzle(sn60izle);
}
else if (sayac2 == 9)
{
MouseClickIzle(sn60basla);
}
else if (sayac2 == 72)
{
MouseClickIzle(sn60gec);
sayac2 = 0;
say++;
say60sn++;
if (say == 10)
{
sayac = 0;
say60sn = 0;
say = 0;
sayac2 =0;
Thread.Sleep(2000);
MouseClickIzle(sn120gecis);
}
}
}
}
}
public void MouseClickIzle(string konum)
{
string[] knm = konum.Split(',');
Win32.POINT p = new Win32.POINT();
p.x = Convert.ToInt32(knm[0].ToString());
p.y = Convert.ToInt32(knm[1].ToString());
Win32.ClientToScreen(IntPtr.Zero, ref p);
Win32.SetCursorPos(p.x, p.y);
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, p.x, p.y, 0, 0);
}
private void button4_Click(object sender, EventArgs e)
{
timer1.Start();
tikTuru = "gec60";
}
private void button5_Click(object sender, EventArgs e)
{
timer1.Start();
tikTuru = "gecis60";
}
string tikTuru;
private void timer1_Tick(object sender, EventArgs e)
{
label4.Text = "Fareyi gerekli konuma götürünüz!!!";
if (tikSayac == 5)
{
if (tikTuru == "izle60")
{
reg.SetValue("sn60izle", Cursor.Position.X+","+ Cursor.Position.Y, RegistryValueKind.String);
sn60izle = reg.GetValue("sn60izle").ToString();
label4.Text = Cursor.Position.X + ","+ Cursor.Position.Y + " Konum Eklendi.";
}
else if (tikTuru == "basla60")
{
reg.SetValue("sn60basla", Cursor.Position.X + "," + Cursor.Position.Y, RegistryValueKind.String);
sn60basla = reg.GetValue("sn60basla").ToString();
label4.Text = Cursor.Position.X + "," + Cursor.Position.Y + " Konum Eklendi.";
}
else if (tikTuru == "gec60")
{
reg.SetValue("sn60gec", Cursor.Position.X + "," + Cursor.Position.Y, RegistryValueKind.String);
sn60gec = reg.GetValue("sn60gec").ToString();
label4.Text = Cursor.Position.X + "," + Cursor.Position.Y + " Konum Eklendi.";
}
else if (tikTuru == "gecis60")
{
reg.SetValue("sn60gecis", Cursor.Position.X + "," + Cursor.Position.Y, RegistryValueKind.String);
sn60gecis = reg.GetValue("sn60gecis").ToString();
label4.Text = Cursor.Position.X + "," + Cursor.Position.Y + " Konum Eklendi.";
}
if (tikTuru == "izle120")
{
reg.SetValue("sn120izle", Cursor.Position.X + "," + Cursor.Position.Y, RegistryValueKind.String);
sn120izle = reg.GetValue("sn120izle").ToString();
label4.Text = Cursor.Position.X + "," + Cursor.Position.Y + " Konum Eklendi.";
}
else if (tikTuru == "basla120")
{
reg.SetValue("sn120basla", Cursor.Position.X + "," + Cursor.Position.Y, RegistryValueKind.String);
sn120basla = reg.GetValue("sn120basla").ToString();
label4.Text = Cursor.Position.X + "," + Cursor.Position.Y + " Konum Eklendi.";
}
else if (tikTuru == "gec120")
{
reg.SetValue("sn120gec", Cursor.Position.X + "," + Cursor.Position.Y, RegistryValueKind.String);
sn120gec = reg.GetValue("sn120gec").ToString();
label4.Text = Cursor.Position.X + "," + Cursor.Position.Y + " Konum Eklendi.";
}
else if (tikTuru == "gecis120")
{
reg.SetValue("sn120gecis", Cursor.Position.X + "," + Cursor.Position.Y, RegistryValueKind.String);
sn120gecis = reg.GetValue("sn120gecis").ToString();
label4.Text = Cursor.Position.X + "," + Cursor.Position.Y + " Konum Eklendi.";
}
}
else if(tikSayac>5)
{
timer1.Stop();
tikSayac = 0;
label4.Text = "";
}
tikSayac++;
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Start();
tikTuru = "izle60";
}
private void Form1_Load(object sender, EventArgs e)
{
reg = Registry.CurrentUser.CreateSubKey("SoftwareAutoClick", RegistryKeyPermissionCheck.ReadWriteSubTree);
try
{
sn60izle = reg.GetValue("sn60izle").ToString();
}
catch
{
reg.SetValue("sn60izle", "0,0", RegistryValueKind.String);
sn60izle = reg.GetValue("sn60izle").ToString();
}
try
{
sn60basla = reg.GetValue("sn60basla").ToString();
}
catch
{
reg.SetValue("sn60basla", "0,0", RegistryValueKind.String);
sn60basla = reg.GetValue("sn60basla").ToString();
}
try
{
sn60gec = reg.GetValue("sn60gec").ToString();
}
catch
{
reg.SetValue("sn60gec", "0,0", RegistryValueKind.String);
sn60gec = reg.GetValue("sn60gec").ToString();
}
try
{
sn60gecis = reg.GetValue("sn60gecis").ToString();
}
catch
{
reg.SetValue("sn60gecis", "0,0", RegistryValueKind.String);
sn60gecis = reg.GetValue("sn60gecis").ToString();
}
try
{
sn120izle = reg.GetValue("sn120izle").ToString();
}
catch
{
reg.SetValue("sn120izle", "0,0", RegistryValueKind.String);
sn120izle = reg.GetValue("sn120izle").ToString();
}
try
{
sn120basla = reg.GetValue("sn120basla").ToString();
}
catch
{
reg.SetValue("sn120basla", "0,0", RegistryValueKind.String);
sn120basla = reg.GetValue("sn120basla").ToString();
}
try
{
sn120gec = reg.GetValue("sn120gec").ToString();
}
catch
{
reg.SetValue("sn120gec", "0,0", RegistryValueKind.String);
sn120gec = reg.GetValue("sn120gec").ToString();
}
try
{
sn120gecis = reg.GetValue("sn120gecis").ToString();
}
catch
{
reg.SetValue("sn120gecis", "0,0", RegistryValueKind.String);
sn120gecis = reg.GetValue("sn120gecis").ToString();
}
}
}
}
Yazar: TRCodeRooTeR
Tarih: 2021-08-07 10:51:36
Görüntüleme: 1617
Yorum: 0