[Help] AutoClicker hotkey.

Posts 1–15 of 33 · Page 1 of 3
[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
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
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
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
Nah, that just fucks with the whole code. It may just be my computer though.
ill try to take a look on this O.o
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
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
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?
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"?
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?
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
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.
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
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.
Posts 1–15 of 33 · Page 1 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us