[VB6] Making an auto-clicker, paused by a key. (Guide) menu

User Tag List

Results 1 to 8 of 8
  1. #1
    Erra's Avatar Member
    Reputation
    10
    Join Date
    Apr 2007
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [VB6] Making an auto-clicker, paused by a key. (Guide)

    Credits: Erra
    Language: VB6

    The reason I made this for myself is that I play the game Conquer Online and in that game you have to pretty much right-click 24/7.

    So first put two timers on the form and name them respectively tmrCDown and tmrRC (timer C Key Down & timer Right Click) and also two labels, one being called Label1 and one being called lblStatus.

    tmrCDown's interval should be set to 100 (100 milliseconds) and tmrRC's interval should be set to 1500 (1500 milliseconds, or how fast you want the auto-clicker to auto-click).

    Then you'd be best off adding a module to the project (Right-click Form1->Add->Module) and then add this code at the beginning:
    Code:
    Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Public Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
    That will declare the sub "mouse_event" and the function "GetAsyncKeyState", which are used respectively to click a mouse button (send a mouse event) and check for pressed keys.

    Let's continue, we will be needing two constants (not really needing, but it'll keep it all simple):
    Code:
    Public Const MOUSEEVENTF_RIGHTDOWN = &H8
    Public Const MOUSEEVENTF_RIGHTUP = &H10
    Those two constants are there to help you remember what the values are for, as we will use them in the following sub:
    Code:
    Public Sub Mouse_RightClick()
      mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
      mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
    End Sub
    First declaring the sub Mouse_RightClick and then when called it will send the same mouse event that you send when you push the right mouse button down and then the one you send when you release the right mouse button.

    To simplify things even more, we will make a function for checking if the key is being pressed (that is, with GetAsyncKeyState to pause the auto-clicker):
    Code:
    Public Function CKeyDown() As Boolean
      If (GetAsyncKeyState(vbKeyC)) Then
        CKeyDown = True
      Else
        CKeyDown = False
      End If
    End Function
    First declaring the function CKeyDown as Boolean (meaning it'll return either true or false) which then checks if the C button is being pressed (vbKeyC) and if it is, return True, if not, return False.

    Now to the easy part; Double click tmrCDown and insert this code:
    Code:
    If CKeyDown = True Then
      tmrRC.Enabled = Not (tmrRC.Enabled)
      If tmrRC.Enabled = True Then
        lblStatus.Caption = "Status: Enabled."
        Label1.Caption = "Disable by pressing C"
      ElseIf tmrRC.Enabled = False Then
        lblStatus.Caption = "Status: Disabled."
        Label1.Caption = "Enable by pressing C"
      End If
    End If
    First it will call the function CKeyDown and if it returns True then it will either enable or disable tmrRC (you'll see what it does in a minute), then it checks if tmrRC was enabled or disabled, if it was enabled then it will say so or if it was disabled it'll say so.

    Now the only remaining code is tmrRC's code, double click tmrRC and insert this code:
    Code:
    Mouse_RightClick
    It will now start right clicking as fast as you set the timer to.

    Form1's code should now look pretty much like this:
    Code:
    Private Sub tmrCDown_Timer()
    If CKeyDown = True Then
    tmrRC.Enabled = Not (tmrRC.Enabled)
    
    If tmrRC.Enabled = True Then
    lblStatus.Caption = "Status: Enabled."
    Label1.Caption = "Disable by pressing C"
    ElseIf tmrRC.Enabled = False Then
    lblStatus.Caption = "Status: Disabled."
    Label1.Caption = "Enable by pressing C"
    End If
    
    End If
    End Sub
    
    Private Sub tmrRC_Timer()
    Mouse_RightClick
    End Sub
    and the module you created (module1 if you haven't changed the name):
    Code:
    Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Public Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
    
    Public Const MOUSEEVENTF_LEFTDOWN = &H2
    Public Const MOUSEEVENTF_LEFTUP = &H4
    Public Const MOUSEEVENTF_RIGHTDOWN = &H8
    Public Const MOUSEEVENTF_RIGHTUP = &H10
    
    Public Sub Mouse_RightClick()
      mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
      mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
    End Sub
    
    Public Function CKeyDown() As Boolean
      If (GetAsyncKeyState(vbKeyC) And &H8000) Then
        CKeyDown = True
      Else
        CKeyDown = False
      End If
    End Function
    I hope this "tutorial" was useful for you :angel:

    Regards,
    Erra

    Ps. If you want it to left click then add this after the other constants:
    Code:
    Public Const MOUSEEVENTF_LEFTDOWN = &H2
    Public Const MOUSEEVENTF_LEFTUP = &H4
    and add the sub Mouse_LeftClick(), into the module you created earlier:
    Code:
    Public Sub Mouse_LeftClick()
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
    End Sub

    I'll post a guide on how to make you able to set where to push the mousebutton as soon as I get the time to.

    [VB6] Making an auto-clicker, paused by a key. (Guide)
  2. #2
    Garosie's Avatar Active Member
    Reputation
    18
    Join Date
    Jul 2007
    Posts
    68
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice, i will +Rep if u can tell me, where can i download visual basic 6.0 ?? been trying to get it for over a week now, but cant get it :S

  3. #3
    Erra's Avatar Member
    Reputation
    10
    Join Date
    Apr 2007
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suppose I could upload it, here it goes:
    MEGAUPLOAD - The leading online storage and file delivery service

    If you want another tutorial from me, simply suggest what it should cover.

  4. #4
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very good, +Repx3, but, uh, VB6 is really outdated now, and VB.NET Express is free >.> Does all the VB6 stuff and then some.

  5. #5
    Erra's Avatar Member
    Reputation
    10
    Join Date
    Apr 2007
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    True, I'm actually learning C# at this time

  6. #6
    Garosie's Avatar Active Member
    Reputation
    18
    Join Date
    Jul 2007
    Posts
    68
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it says over 99 files are missing :S

  7. #7
    Erra's Avatar Member
    Reputation
    10
    Join Date
    Apr 2007
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works perfectly for me, I'll upload it somewhere else and see if it makes a difference.
    Here it goes @ rapidshare:
    RapidShare: 1-Click Webhosting

  8. #8
    miggy27's Avatar Private
    Reputation
    1
    Join Date
    Oct 2014
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IT doesnt work

    Originally Posted by Erra View Post
    Works perfectly for me, I'll upload it somewhere else and see if it makes a difference.
    Here it goes @ rapidshare:
    RapidShare: 1-Click Webhosting
    IT doesnt work in conquer dude!.PLS REPS

Similar Threads

  1. [PC] Auto-Clicker 2.0
    By Gothian in forum World of Warcraft Bots and Programs
    Replies: 76
    Last Post: 06-29-2008, 03:29 AM
  2. Smart auto clicker?
    By bloodninja in forum WoW Scams Help
    Replies: 0
    Last Post: 04-06-2008, 01:08 AM
  3. Bux.to auto clicker
    By SHADOWMANJARO in forum Community Chat
    Replies: 3
    Last Post: 02-03-2008, 04:36 AM
  4. Is Auto Clicker safe to use?
    By tekstorm in forum World of Warcraft General
    Replies: 0
    Last Post: 09-01-2007, 08:37 AM
  5. Auto-Clicker
    By Pragma in forum World of Warcraft Bots and Programs
    Replies: 17
    Last Post: 05-18-2007, 08:51 PM
All times are GMT -5. The time now is 11:27 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search