Page 1 of 3 123 LastLast
Results 1 to 15 of 33
  1. #1
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired

    [Help] AutoClicker hotkey.

    I've got a big problem with the hotkeys on my autoclicker, If anyone could help me, just PM for the full code.

    When I press the start hotkey, nothing happens, but when I press the stop hotkey it stops (When its running)

    I'll only accept give my full code to trusted members.

    Code:
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    
            Timer1.Interval = TextBox1.Text * 1000 + TextBox2.Text
            AutoClick()
    
            If GetAsyncKeyState(Keys.F5) Then
                Timer1.Start()
            End If
            If GetAsyncKeyState(Keys.F6) Then
                Timer1.Stop()
            End If
        End Sub
    Last edited by Lolland; 11-20-2009 at 11:09 PM.

  2. #2
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    431
    Reputation
    16
    Thanks
    310
    first of all make two timers, make the first timer interval "1" and then add this code
    Code:
            Dim F5key As Boolean
            Dim F6key As Boolean
            F5key = GetAsyncKeyState(Keys.F5)
            F6key = GetAsyncKeyState(Keys.F6)
            If F5key = True Then
                'your code here to start other timer
            End If
            If F6key = True Then
                F5key = False 'dont think you need this but i put anyways
                'your code here yet again to turn off
            End If
    on the second timer add your code that does something
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  3. #3
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Well, I'm trying to keep it to one timer, so I tried your method, and once again, I can stop it with f6, but cannot start it.

    Code:
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    
            Timer1.Interval = TextBox1.Text * 1000 + TextBox2.Text
            AutoClick()
    
            Dim F5key As Boolean
            Dim F6key As Boolean
            F5key = GetAsyncKeyState(Keys.F5)
            F6key = GetAsyncKeyState(Keys.F6)
            If F5key = True Then
                Timer1.Start()
            End If
            If F6key = True Then
                F5key = False
                Timer1.Stop()
            End If
    
        End Sub

  4. #4
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    431
    Reputation
    16
    Thanks
    310
    ya see your timer has already started so that wont work and will collide with the code, so try this, i havent done this before on one timer so im just giving a guess

    Code:
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    
            Timer1.interval = 1
    
            Dim F5key As Boolean
            Dim F6key As Boolean
            F5key = GetAsyncKeyState(Keys.F5)
            F6key = GetAsyncKeyState(Keys.F6)
            If F5key = True Then
                Timer1.Interval = TextBox1.Text * 1000 + TextBox2.Text
            AutoClick()
            End If
            If F6key = True Then
                timer1.interval = 1
                'put your code here to stop whatever your doing
            End If
    
            
    
           
    
        End Sub
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  5. #5
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Nah, that just fucks with the whole code. It may just be my computer though.

  6. #6
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    431
    Reputation
    16
    Thanks
    310
    ill try to take a look on this O.o
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  7. #7
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    First add this under public class:
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As System.Int16) As Int16 'so its x64 bit compatible
    Then under a timer which should start at form1 load put:
    Code:
    Dim StartHotkey As Integer
    StartHotkey = GetAsyncKeyState(120)
    If StartHotkey <> 0 Then
    'Your code here
    end if
    BTW thats the hotkey F9 heres a list of hotkeys and their correspnding #'s
    112 F1 key
    113 F2 key
    114 F3 key
    115 F4 key
    116 F5 key
    117 F6 key
    118 F7 key
    119 F8 key
    120 F9 key
    121 F10 key
    122 F11 key
    123 F12 key
    124 F13 key
    125 F14 key
    126 F15 key
    127 F16 key

    the # goes to the hotkey so 127 is F16

  8. #8
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Even with this:

    Code:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Timer1.Interval = TextBox1.Text * 1000 + TextBox2.Text
            AutoClick()
            Dim StartHotkey As Integer
            StartHotkey = GetAsyncKeyState(120)
            If StartHotkey <> 0 Then
                Timer1.Start()
            End If
            Dim StopHotkey As Integer
            StopHotkey = GetAsyncKeyState(121)
            If StopHotkey <> 0 Then
                Timer1.Stop()
            End If
        End Sub
    My start hotkey doesnt work.

  9. #9
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by lolland View Post
    Even with this:

    Code:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Timer1.Interval = TextBox1.Text * 1000 + TextBox2.Text
            AutoClick()
            Dim StartHotkey As Integer
            StartHotkey = GetAsyncKeyState(120)
            If StartHotkey <> 0 Then
                Timer1.Start()
            End If
            Dim StopHotkey As Integer
            StopHotkey = GetAsyncKeyState(121)
            If StopHotkey <> 0 Then
                Timer1.Stop()
            End If
        End Sub
    My start hotkey doesnt work.
    did u put in this code under public class?
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As System.Int16) As Int16 'so its x64 bit compatible

  10. #10
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    431
    Reputation
    16
    Thanks
    310
    Quote Originally Posted by lolland View Post
    Even with this:

    Code:
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Timer1.Interval = TextBox1.Text * 1000 + TextBox2.Text
            AutoClick()
            Dim StartHotkey As Integer
            StartHotkey = GetAsyncKeyState(120)
            If StartHotkey <> 0 Then
                Timer1.Start()
            End If
            Dim StopHotkey As Integer
            StopHotkey = GetAsyncKeyState(121)
            If StopHotkey <> 0 Then
                Timer1.Stop()
            End If
        End Sub
    My start hotkey doesnt work.
    Its because when u do this it takes it as every time you press the button it will do the code so u would have to hold it down for it to actually work...... but also if u do something with this code it just doesnt work in general

    Quote Originally Posted by bombsaway707 View Post
    First add this under public class:
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As System.Int16) As Int16 'so its x64 bit compatible
    Then under a timer which should start at form1 load put:
    Code:
    Dim StartHotkey As Integer
    StartHotkey = GetAsyncKeyState(120)
    If StartHotkey <> 0 Then
    'Your code here
    end if
    BTW thats the hotkey F9 heres a list of hotkeys and their correspnding #'s
    112 F1 key
    113 F2 key
    114 F3 key
    115 F4 key
    116 F5 key
    117 F6 key
    118 F7 key
    119 F8 key
    120 F9 key
    121 F10 key
    122 F11 key
    123 F12 key
    124 F13 key
    125 F14 key
    126 F15 key
    127 F16 key

    the # goes to the hotkey so 127 is F16
    btw your fix for x64 gives me an error and im on x32 so it dont work for both
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  11. #11
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by guza44_44 View Post
    Its because when u do this it takes it as every time you press the button it will do the code so u would have to hold it down for it to actually work...... but also if u do something with this code it just doesnt work in general



    btw your fix for x64 gives me an error and im on x32 so it dont work for both
    what error do u get?

  12. #12
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Yes I do have.
    Code:
        Private Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As System.Int16) As Int16
    And even if I hold F9 it doesn't work.

  13. #13
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    431
    Reputation
    16
    Thanks
    310
    Quote Originally Posted by bombsaway707 View Post
    what error do u get?
    says i cant use the if key = true or anything, i think u forgot to add "as integer" at the end O.o or do u use "as int16"?
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

  14. #14
    Bombsaway707's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Gym
    Posts
    8,799
    Reputation
    791
    Thanks
    4,004
    My Mood
    Amused
    Quote Originally Posted by guza44_44 View Post
    says i cant use the if key = true or anything, i think u forgot to add "as integer" at the end O.o
    no cuz it works for me... when u click the error what line of code does it highlight?

  15. #15
    guza44_44's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    431
    Reputation
    16
    Thanks
    310
    Quote Originally Posted by bombsaway707 View Post
    no cuz it works for me... when u click the error what line of code does it highlight?
    If F1key <> 0 Then
    [IMG]https://i304.photobucke*****m/albums/nn168/guza44/sig-1.png[/IMG]

Page 1 of 3 123 LastLast

Similar Threads

  1. [HELP] Tapper Hotkeys
    By Jàzzà_ in forum Visual Basic Programming
    Replies: 1
    Last Post: 10-30-2009, 05:32 PM
  2. Mass help with Hotkeys Warrock
    By araz in forum Visual Basic Programming
    Replies: 3
    Last Post: 03-23-2008, 08:04 PM
  3. [Help] Mouse Hotkeys
    By ilovepie21 in forum Visual Basic Programming
    Replies: 1
    Last Post: 03-09-2008, 06:22 AM
  4. [HELP] VB6 Hotkey for Zoom not working
    By SteeL in forum WarRock - International Hacks
    Replies: 13
    Last Post: 11-10-2007, 03:06 AM
  5. [Help]With Hotkeys..
    By dor619 in forum Visual Basic Programming
    Replies: 2
    Last Post: 10-14-2007, 12:03 PM

Tags for this Thread