Results 1 to 11 of 11
  1. #1
    R3DDOT's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    C://Windows/system32
    Posts
    347
    Reputation
    38
    Thanks
    2,351
    My Mood
    Cheerful

    Macro & QuickSwitch Sourcecodes (VB.NET) by R3DDOT

    So, I'm releasing the codes for my macro & quickswitch.
    I'm not that interested in making them anymore, therefore I thought to my self "Why not share them with everyone?"
    Use them as you wish.

    Module:
    Code:
         
    
    
    Imports System.Runtime.InteropServices
    
    
    Module MacroModulebyR3DDOT
    
    <System.Runtime.InteropServices.DllImport("user32.dll")>    Public Function GetAsyncKeyState(ByVal e As System.Windows.Forms.Keys) As Short
        End Function
    
        Public Function GetKeyState(ByVal e As System.Windows.Forms.Keys) As Boolean
        Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
    
    
    
    #Region "Window Stuff"
        <DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
        Public Function GetForegroundWindow() As IntPtr
        End Function
        Public Declare Auto Function FindWindow Lib "user32.dll" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
    #End Region
    
    
        Public Sub LeftClick() 'Left Mouse Button Click.
            mouse_event(&H2, 0, 0, 0, 0)
            mouse_event(&H4, 0, 0, 0, 0)
        End Sub
        Public Sub RightClick() 'Right Mouse Button Click.
            mouse_event(&H8, 0, 0, 0, 0)
            mouse_event(&H10, 0, 0, 0, 0)
        End Sub
        Public Sub MiddleClick() 'Middle Mouse Button Click.
            mouse_event(&H20, 0, 0, 0, 0)
            mouse_event(&H40, 0, 0, 0, 0)
        End Sub

    On Form(QuickSwitch):

    Code:
    Dim AllowedToShoot as Boolean
    Dim QSTicks as Integer
    
    [...]
    
    'Find your own interval for your timer. Do it through trial and error, and you'll get there.
    'Alternative: Add textbox so user can customize the interval between ticks.
    
    Private Sub QuickSwitchTMR_Tick(sender As Object, e As EventArgs) Handles QuickSwitchTMR.Tick
    Dim QSHotkey As Boolean = GetKeyState(Keys.LButton)
    
    
             If AllowedToShoot = False Then  'Anti-bug function. Skips 1 tick, regardless if LButton is in usage or not.		While QSTicks < 2 Then
    		     QSTicks += 1
    		      Exit Sub
    		End While
    
    
                    QSTicks = 0
                    AllowedToShoot = True
            End If
    
    
            Dim hWnd As IntPtr = FindWindow(AVAWindowClass, Nothing)  'Gets handle of AVA Window.
            Dim ForeGroundWindow As IntPtr = GetForegroundWindow()     'Gets handle of currently Active Window.
    
    
            If hWnd = ForeGroundWindow Then ' If AVA Window is in usage, it will do the QS, otherwise, it will skip the function.
                If AllowedToShoot = True Then
                    If QSHotkey = True Then
                        If QSHotkey = True Then
                                If QSS12.Checked = True Then   'These are radio buttons from the form. Adapt the code to fit your own assembly.
                                                                          
                                    SendKeys.Send("2")              'Here I'm using the SendKeys.Send() method. 
    
                                    SendKeys.Send("1")              'Alternative: Reference InputSimulator.dll and Import WindowInput.
    
    
                                ElseIf QSS13.Checked = True Then
                                    SendKeys.Send("3")
                                    SendKeys.Send("1")
                                ElseIf QSS14.Checked = True Then
                                    SendKeys.Send("4")
                                    SendKeys.Send("1")
                                ElseIf QSSQQ.Checked = True Then
                                    SendKeys.Send("q")
                                    SendKeys.Send("q")
                                ElseIf QSSQ2.Checked = True Then
                                    SendKeys.Send("2")
                                    SendKeys.Send("q")
                                ElseIf QSS3Q.Checked = True Then
                                    SendKeys.Send("3")
                                    SendKeys.Send("q")
                                ElseIf QSS4Q.Checked = True Then
                                    SendKeys.Send("4")
                                    SendKeys.Send("q")
                                End If
                        AllowedToShoot = False               'Turns it false to trigger the anti-bug function above.
                    End If
                End If
            End If
    End Sub
    On Form(Macro):

    Code:
    [...]
    'If you want add a textbox so the user can customize the interval between ticks.
        Private Sub MacroTMR_Tick(sender As Object, e As EventArgs) Handles MacroTMR.Tick
            Dim hotkey As Boolean = GetKeyState(Keys.LButton)
    
    
            Dim hWnd As IntPtr = FindWindow(AVAWindowClass, Nothing)  'Gets handle of AVA Window.
            Dim ForeGroundWindow As IntPtr = GetForegroundWindow()    'Gets handle of the current Active Window.
    
    
            If hWnd = ForeGroundWindow Then                                   'Checks if AVA Window is the active window. If true, then checks if LButton is currently in usage, if it is, then the macro function is called(Macros usually use the MiddleClick Function)
                If hotkey = True Then
                    Try
                        Call MiddleClick()
                    Catch ex As Exception
                    Messagebox.show(ex.message)
                    End Try
                End If
            End If
        End Sub
    I placed here nearly everything you'll need to make your own macros & quickswitches. The rest is totally up to you, to edit and adapt to your needs.
    If you use this code, all I'm gonna ask is for you to give me credits, even though it's totally up to you.

    Any questions, comment below and someone will help you out, being that me or anyone from MPGH, really.

    PS: I'll put a project in the attachments later on, if you wish to use it ofc.



    FYI, I've been getting a lot of buddy request asking me to helping you out making hacks or macros or whatever. I don't mind helping out, as long as you know what you are doing. If you come here, without any knowledge of the language whatsoever trying to code a macro or a hack or whatever, you'll face some really big challenges and you'll most likely giveup, or worse, not knowing what you're doing, and just copy&paste code from other people. If you wish to learn the language, take a look at some tutorials, learn step-by-step, and if you have any doubts, a lot of members will willingly provide some help.
    Last edited by Hunter; 11-09-2015 at 12:30 PM.

  2. The Following 4 Users Say Thank You to R3DDOT For This Useful Post:

    100MB (07-26-2014),agora555 (08-15-2014),Haxxxer007 (04-10-2014),omeryamin (04-16-2014)

  3. #2
    Haxxxer007's Avatar
    Join Date
    Mar 2014
    Gender
    male
    Location
    (⊙.⊙(☉_☉)⊙.⊙)
    Posts
    232
    Reputation
    10
    Thanks
    94
    My Mood
    Yeehaw
    @R3DDOT Thanks a lot for this release bro !

  4. #3
    R3DDOT's Avatar
    Join Date
    Dec 2013
    Gender
    male
    Location
    C://Windows/system32
    Posts
    347
    Reputation
    38
    Thanks
    2,351
    My Mood
    Cheerful
    I forgot to put this in the main thread, anyway:
    Check out this thread also, it'll be helpful.

    How to make Virtual Keystrokes! - by R3DDOT;
    http://www.mpgh.net/forum/showthread.php?t=783583

  5. The Following User Says Thank You to R3DDOT For This Useful Post:

    leditirane (10-11-2014)

  6. #4
    1SharP's Avatar
    Join Date
    Apr 2014
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    2
    thank you )

  7. #5
    Unbalanced's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Location
    Canada
    Posts
    279
    Reputation
    17
    Thanks
    1,301
    My Mood
    Tired
    Thanks for the source. I understand what you mean by helping people out, as long as they know the language. If they no next to nothing about the language,and you help them, it's basically you coding the macro, not them.


    Member Since February 6th, 2013
    Donator Since November 2nd, 2013


  8. #6
    leditirane's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    241
    Reputation
    10
    Thanks
    28
    My Mood
    Amazed
    thnx you bro

  9. #7
    jaydeeph's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    153
    My Mood
    Blah
    Thanks R3DDOT. This is an excellent. One thing confuses me though is why do you have "[...]"?
    Also is it possible for you upload the source code? If I do create anything using your work, I will include credits, since I hate leeching. Thanks.

  10. #8
    saichan's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    0
    how to make a source code to a hack ? Can anyone help me to start coding?Please

  11. #9
    Scythen's Avatar
    Join Date
    Aug 2014
    Gender
    male
    Location
    delusional
    Posts
    434
    Reputation
    31
    Thanks
    594
    My Mood
    Cheerful
    Thanks, @R3DDOT



  12. #10
    pipaul's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    Hello

    can you post the src of your macro VB.net project ?

    I would try it to compile for win xp plateform with .net 3.5.

    Thanks

  13. #11
    agora555's Avatar
    Join Date
    Mar 2013
    Gender
    male
    Posts
    241
    Reputation
    23
    Thanks
    3,717
    My Mood
    Cool
    how can i add the textbox to change the delay of the QuickSwitch??
    can someone help me plz @R3DDOT
    Dim AllowedToShoot as Boolean
    Dim QSTicks as Integer

    [...]

    'Find your own interval for your timer. Do it through trial and error, and you'll get there.
    'Alternative: Add textbox so user can customize the interval between ticks.

    Private Sub QuickSwitchTMR_Tick(sender As Object, e As EventArgs) Handles QuickSwitchTMR.Tick
    Dim QSHotkey As Boolean = GetKeyState(Keys.LButton)


    If AllowedToShoot = False Then 'Anti-bug function. Skips 1 tick, regardless if LButton is in usage or not. While QSTicks < 2 Then
    QSTicks += 1
    Exit Sub
    End While


    QSTicks = 0
    AllowedToShoot = True
    End If


    Dim hWnd As IntPtr = FindWindow(AVAWindowClass, Nothing) 'Gets handle of AVA Window.
    Dim ForeGroundWindow As IntPtr = GetForegroundWindow() 'Gets handle of currently Active Window.


    If hWnd = ForeGroundWindow Then ' If AVA Window is in usage, it will do the QS, otherwise, it will skip the function.
    If AllowedToShoot = True Then
    If QSHotkey = True Then
    If QSHotkey = True Then
    If QSS12.Checked = True Then 'These are radio buttons from the form. Adapt the code to fit your own assembly.

    SendKeys.Send("2") 'Here I'm using the SendKeys.Send() method.

    SendKeys.Send("1") 'Alternative: Reference InputSimulator.dll and Import WindowInput.


    ElseIf QSS13.Checked = True Then
    SendKeys.Send("3")
    SendKeys.Send("1")
    ElseIf QSS14.Checked = True Then
    SendKeys.Send("4")
    SendKeys.Send("1")
    ElseIf QSSQQ.Checked = True Then
    SendKeys.Send("q")
    SendKeys.Send("q")
    ElseIf QSSQ2.Checked = True Then
    SendKeys.Send("2")
    SendKeys.Send("q")
    ElseIf QSS3Q.Checked = True Then
    SendKeys.Send("3")
    SendKeys.Send("q")
    ElseIf QSS4Q.Checked = True Then
    SendKeys.Send("4")
    SendKeys.Send("q")
    End If
    AllowedToShoot = False 'Turns it false to trigger the anti-bug function above.
    End If
    End If
    End If
    End Sub

Similar Threads

  1. [Outdated] Quickswitch Sourcecode VB.NET by MarvLie (Opensource)
    By MarvLie in forum Alliance of Valiant Arms (AVA) Coding / Source Code
    Replies: 4
    Last Post: 09-27-2013, 03:52 AM
  2. [Preview] QuickSwitch + Macro !
    By Mohaimen Hassan in forum Alliance of Valiant Arms (AVA) Discussions
    Replies: 12
    Last Post: 08-22-2012, 04:19 PM
  3. Sniper Quickswitch / Rifle - Pointman Macro
    By i9GAG in forum Alliance of Valiant Arms (AVA) Help
    Replies: 18
    Last Post: 08-07-2012, 02:57 AM
  4. [Discussion] Quickswitch trick found not a macro
    By RIP13 in forum Alliance of Valiant Arms (AVA) Discussions
    Replies: 14
    Last Post: 07-31-2012, 03:34 PM
  5. Sniper macro quickswitch code
    By rahaga99 in forum Alliance of Valiant Arms (AVA) Help
    Replies: 1
    Last Post: 03-05-2012, 05:28 AM