Jump to content

Auto Clicker

- - - - -

  • Please log in to reply
5 replies to this topic

#1
Sean0323

Sean0323

    Newbie

  • Members
  • Pip
  • 4 posts
Hey guys I'm working on a program and I need to find how to make auto clicker as one of its features I've searched google for a long time to no avail. Does anyone know how to do this?

#2
Sean0323

Sean0323

    Newbie

  • Members
  • Pip
  • 4 posts
I need to make it so Thread.Sleep(); takes a variable here is my form1.cs
using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Threading;


namespace AutoTyper

{

    public partial class Form1 : Form

    {

        private bool canWork = false;

        public Form1()

        {

            InitializeComponent();

        }


        private void button1_Click(object sender, EventArgs e)

        {

            Form Form1 = new Form4();

            Form1.Show();

        }

        private void textBox2_KeyPress(object sender, KeyPressEventArgs e)

        {

            char ch = e.KeyChar;


            if (!char.IsDigit(ch) && ch != 8)

            {

                e.Handled = true;

            }

        }

        private void StartTyping(object obj)

        {

            string message = obj.ToString();//Retreives the message

            string ch = textBox2.Text;

            Thread.Sleep(400);


            while (canWork)

            {

                SendKeys.SendWait(message); //Send the message.

                SendKeys.SendWait("{ENTER}");  //Send the enter key.

                Thread.Sleep(ch); //Wait 1000 milliseconds -> 1 seconds.

            }


        }


        private void supportUsToolStripMenuItem_Click(object sender, EventArgs e)

        {

            Form Form2 = new Form2();

            Form2.Show();

        }


        private void openToolStripMenuItem_Click(object sender, EventArgs e)

        {

            Form Form2 = new Form2();

            Form2.Show();

        }


        private void Form1_Load(object sender, EventArgs e)

        {


        }



        private void autoClickerToolStripMenuItem_Click(object sender, EventArgs e)

        {

            Form Form3 = new Form3();

            Form3.Show();

        }


        private void button1_Click_1(object sender, EventArgs e)

        {

            if (button1.Text == "Start")

            {

                canWork = true;

                button1.Text = "Stop";


                Thread thread = new Thread(StartTyping); //Create a new thread

                thread.Start(textBox1.Text);

            }


            else

            {

                canWork = false;

                button1.Text = "Start";

            }

        }


        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)

        {

            Form AboutBox1 = new AboutBox1();

            AboutBox1.Show();

        }


        private void supportUsToolStripMenuItem_Click_1(object sender, EventArgs e)

        {

            Form Form2 = new Form2();

            Form2.Show();

        }


        private void startingScreenToolStripMenuItem_Click(object sender, EventArgs e)

        {

            Form Form4 = new Form4();

            Form4.Show();

        }


        private void autoClickerToolStripMenuItem_Click_1(object sender, EventArgs e)

        {

            Form Form3 = new Form3();

            Form3.Show();

        }


        private void openToolStripMenuItem_Click_1(object sender, EventArgs e)

        {

            Form Form3 = new Form3();

            Form3.Show();

        }


    }

}



#3
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
You'll probbaly have to parse to Integer if this isn't working:
Thread.Sleep(ch);

int sleep = int.Parse(ch);
Thread.Sleep(sleep);

#4
Sean0323

Sean0323

    Newbie

  • Members
  • Pip
  • 4 posts
thanks i got that working anyone have help for the auto clicker?

#5
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
I think mouseclicks are send using SendInput. And moving the mouse is probably done using Cursor.Position = new Point(x,y);

I don't know how the SendInput really works, i guess google will be your friend.

#6
Sean0323

Sean0323

    Newbie

  • Members
  • Pip
  • 4 posts
Cant find much on google about it hm I have a c++ but not c# so I know its possible I'll go look into it moire.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users