Auto Clicker

Posts 1–14 of 14 · Page 1 of 1
Auto Clicker
Here this is a simple source code for a simple auto clicker.
Code:
//©®o$s ƒi®E™
Public Class Form1
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
    Private Declare Sub mouse_event Lib "user32" (ByVal dwflags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cbuttons As Long, ByVal dwExtraInfo As Long)
    Private Const mouseclickup = 4
    Private Const mouseclickdown = 2                                                                                                                                                                                                                                                                                                                 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkeys.Tick
        Dim Hotkey1 As Boolean
        Hotkey1 = GetAsyncKeyState(Keys.F5)
        If Hotkey1 = True Then
            Clicks.Start()

        End If
        Dim Hotkey2 As Boolean
        Hotkey2 = GetAsyncKeyState(Keys.F6)
        If Hotkey2 = True Then
            Clicks.Stop()

        End If
    End Sub

    Private Sub Click_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Clicks.Tick
        Clicks.Interval = TextBox1.Text
        mouse_event(mouseclickdown, 0, 0, 0, 0)
        mouse_event(mouseclickup, 0, 0, 0, 0)
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub
    Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click

    End Sub
End Class
Please don't leach this and if you use this give credits.
Here is how it will look like:
◄ Moved to Source Code Section ►
Quote Originally Posted by Gab View Post
◄ Moved to Source Code Section ►
Thanks .
For what is that all?

Code:
If GetAsyncKeyState(Keys.Yourkey) = True Then
'Your code here..
End if
PS: Timer1 Must be enabled with at least 1 interval to 700..(Delay of the hotkey)
Quote Originally Posted by Lyoto Machida View Post
For what is that all?

Code:
If GetAsyncKeyState(Keys.Yourkey) = True Then
'Your code here..
End if
PS: Timer1 Must be enabled with at least 1 interval to 700..(Delay of the hotkey)
Where are you seeing
Code:
If GetAsyncKeyState(Keys.Yourkey) = True Then
'Your code here..
End if
Im saying its better like that (What i posted) then:

Hotkey2 or 1 doesnt matter is just need to do what i posted..
Code:
Dim Hotkey2 As Boolean
        Hotkey2 = GetAsyncKeyState(Keys.F6)
        If Hotkey2 = True Then
            Clicks.Stop()

        End If
This is less code and better xD
Code:
If GetAsyncKeyState(Keys.Yourkey) = True Then
'Your code here..
End if
Quote Originally Posted by Lyoto Machida View Post
Im saying its better like that (What i posted) then:

Hotkey2 or 1 doesnt matter is just need to do what i posted..
Code:
Dim Hotkey2 As Boolean
        Hotkey2 = GetAsyncKeyState(Keys.F6)
        If Hotkey2 = True Then
            Clicks.Stop()

        End If
I kept it basic because I will edit the thread later and tell what each sub does and what you can change and not.
on MSDN

just saying

anyways here is another example by me
dont rat about me for using system() or not using talkative navigation, i just wanted to make this short.
Code:
#include <iostream>
#include <windows.h>
void SayStuff(bool status, int z)
{
	system("cls");
	std::cout << "Welcome to <name's> AutoClicker" << std::endl;
	std::cout << "Press Right Arrow to increase click speed" << endl << "\torLeft Arrow to decrease click speed" << endl;
	std::cout << "Current time interval between clicks is " << z << "miliseconds" << endl;
	std::cout << "Clicker is now " << ((status==true)?"ON":"OFF") << endl;
}
int main()
{
	INPUT DOWN,UP;
	DOWN.type          = INPUT_MOUSE;
	DOWN.mi.dwFlags    = MOUSEEVENTF_LEFTDOWN;
	UP.type            = INPUT_MOUSE;
	UP.mi.dwFlags      = MOUSEEVENTF_LEFTUP;
	DWORD TimeInterval = 50;
	bool isClicking    = false;
	SayStuff(isClicking,TimeInterval);
	while(1)
	{
		if(GetAsyncKeyState(VK_RIGHT)&1)
		{
			if(TimeInterval>2) (TimeInterval==10)?TimeInterval=1:TimeInterval-=10;
			else
			{
				TimeInterval = 1;
				std::cout << "[ERROR] cant set to lower than 1" << std::endl;
			}
			SayStuff(isClicking,TimeInterval);
		}
		if(GetAsyncKeyState(VK_LEFT)&1)
		{
			TimeInterval+=10;
			if(TimeInterval%10 == 1) TimeInterval--;
			SayStuff(isClicking,TimeInterval);
		}
		if(GetAsyncKeyState(VK_DOWN)&1)
		{
			isClicking = !isClicking;
			SayStuff(isClicking,TimeInterval);
		}
		if(GetAsyncKeyState(VK_UP)&1)
		{
			isClicking = false;
			SayStuff(isClicking,TimeInterval);
		}
		if(isClicking)
		{
			SendInput(1,&DOWN,sizeof(INPUT));
			SendInput(1,&UP  ,sizeof(INPUT));
		}
		Sleep(TimeInterval);
	}
	return 0;
}
Should I release this?
Thank you for information!
thanks for sharing the info.
Press it
It reduce spam./
Thanks for information
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us