A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[VB] Need Help with something

949 views · started by Raivu ·
#1
[VB] Need Help with something
So I'm trying to work on my auto clicker program in VB (visual basics 2008 express edition) and I'm trying to find a way to pause/stop the program with a right-click of the mouse, so you're not auto clicking EVERYTHING while you're trying to bring it back up. (I had a pretty hectic time stopping it)

Could anyone help me with this? It'd be greatly appreciated.

-Raivu

Edit: I've tried
If e.keycode = keys.space then
timer1.stop()
End If

(Timer1 is the clicker)

And I've also tried the mouse functions, but I don't know a lot about those yet, so whether or not I was doing it correctly, I'm not sure.
#2
Ive never really worked with the mouse much, BUT. You could try hotkeys. Such as, F2 to start, F3 to finish.

I dont have anything to work off right now, because I just reformatted and im learning PHP, but try googling for the code.

Hope i helped
~Bman
#3
Bman wrote:
Ive never really worked with the mouse much, BUT. You could try hotkeys. Such as, F2 to start, F3 to finish.

I dont have anything to work off right now, because I just reformatted and im learning PHP, but try googling for the code.

Hope i helped
~Bman


I tried that, but I can't get the hotkeys to work.
In order to make a hotkey you need to dropdown to "keydown" and put in the code

e.keycode = keys.F1

Then put the IF function and all that jazz into it.

I'll look more online. Thanks for the help, Bman
#4
No problem :D

If you need anymore help drop me a PM.

Also, check out for tutorials on youtube and google about hotkeys.

Thats what I done when I first started VB.Net
#5
Whats wrong with Send Keys?

Example:
        If (SendKeys.Equals(" ", " ")) Then
MessageBox.Show("You have clicked space!", "Spacebar...", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If


What it seems your looking for:
        If (SendKeys.Equals(" ", " ")) Then
Timer1.Enabled = False
End If
#6
Instead of using " "

Try using {SPACE} or something, I cant remember it exactly.
#7
Bman wrote:
Instead of using " "

Try using {SPACE} or something, I cant remember it exactly.


Yeah I was trying to remember, The " " code does work though (Strangely enough o.o)...
#8
you need the either key up or key down function added to your project which you can do by clicking your control, then the lightning bolt in properties, then find key up and double click it.

Example

    Private Sub Form1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
If (e.KeyData = Keys.Space) Then
your function goes here
End If
End Sub
End Class
#9
Chad wrote:
you need the either key up or key down function added to your project which you can do by clicking your control, then the lightning bolt in properties, then find key up and double click it.

Example


Private Sub Form1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
If (e.KeyData = Keys.Space) Then
your function goes here
End If
End Sub
End Class


I've got that, but it still won't work.

Maybe because I used

e.keycode = keys.space
instead of
e.keydata = keys.space

Does it matter?
#10
Yes, it does matter.
#11
:P
Wanna try:
    Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If Asc(e.KeyChar) = Keys.Space Then
timer1.stop()
End If
End Sub
#12
iPoison wrote:
:P
Wanna try:
    Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If Asc(e.KeyChar) = Keys.Space Then
timer1.stop()
End If
End Sub


what is Asc? and what does it do?
#13
Asc is a key hook that is exactly like KeyUP or KeyDOWN event but global. It uses more memory to use and can drain you as well as has to be used in a timer. KeyUp or KeyDown is an event that doesn't need a timer yet it's not global.
#14
Chad wrote:
Asc is a key hook that is exactly like KeyUP or KeyDOWN event but global. It uses more memory to use and can drain you as well as has to be used in a timer. KeyUp or KeyDown is an event that doesn't need a timer yet it's not global.


By global, do you mean it uses key up, key down, mouse functions, etc. all at once without having to switch between them?