QuestionHelpwhat even...?

Posts 16 of 6 · Page 1 of 1
what even...?
so, i recently got into visual basic after playing around with c++ for a while.
now i am trying to get a key spammer (definedly not to bhop)

so how does this shit work. after 2days i literally have nothing.

so, how does key up work in vb?(i dont mind if you post your whole key spam shit for me to see how it works)









fuck me.
/Moved to the correct section.
Possibly the most basic.

Code:
int main()
{
while (true) // Infinite loop
     {
     keybd_event(~YourKey~, 0, KEYEVENTF_KEYDOWN, 0); //Key Down
     Sleep(1);
     keybd_event(~YourKey, 0, KEYEVENTF_KEYUP, 0); //Key Up
     }
}
If you know c++, then you'll know how to set the keys.
Quote Originally Posted by Lak33 View Post
snip~
For Reference, here are key codes for vb -> msdn . microsoft . com/ en-us/library/aa243025(v=vs.60).aspx

or you can use Keys.(key)

For Starters, you might wanna import GetAsyncKeyState, (shouldn't be hard), secondly, you might want to import keyboard event, it took me two seconds to find out each of these,

Code:
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
you could read this on how to import keybd_event -> www . pinvoke . net/default.aspx/user32.keybd_event
Code:
Class MainShizzle

  'Declares
  Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
  Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

  'Thread(s)
  Dim thread_Spammer As New System.Threading.Thread(AddressOf Spammer)

  'Vars
  Const VK_RETURN As Byte = &HD
  Const KEYEVENT_KEYUP As UInteger = &H2
  Const Spammer_Key As Integer = &H20
  Const SpammerEnabled As Boolean = True
  Dim Exit_Thread As Boolean = False

  'Sub-routines
  Sub Main()
    thread_Spammer.Start()
    Application.Run
  End Sub

  Public Sub Spammer()
    While(Not Exit_Thread)
      If SpammerEnabled AndAlso GetAsyncKeyState(Spammer_Key) Then
        keybd_event(VK_RETURN, 0, 0, 0)
        Threading.Thread.Sleep(15)
        keybd_event(VK_RETURN, 0, KEYEVENT_KEYUP, 0)
      End If
      Threading.Thread.Sleep(1)
    End While
  End Sub

End Class
I guess? You'll hit many walls if this is how you're getting into development.
1 week has passed and no further replies have been made by the OP. Assuming solved.

/Closed.
Posts 16 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?