Hi, it's been a while. I recently decided to play Heroes & generals and tried to use my old anti-recoil program. It did not work in the game and i have tried multiple ways and in different scripting languages like autoit. I only have found one script that works in game. A lot of the codes i tried still worked on the desktop, but in game it just went to a corner or something weird. i don't think mousesetpos still works. This is what i have so far. Like i said works when it's not in game and i tried other people stuff and only one worked.


Code:
If $sactive = 1 Then
		If (_ispressed(1)) AND (_ispressed($fire)) Then
			If $s < 1 Then
				DllCall("User32.dll", "none", "mouse_event", "int", $mouseeventf_move, "int", -$sspeed, "int", +$mposspeed + $init, "int", 0, "int", 0)
				$s = $s + 1
				$amountdown += $mposspeed + $init
				$amountside += $sspeed
				$f = $f + 1
			Else
				DllCall("User32.dll", "none", "mouse_event", "int", $mouseeventf_move, "int", -$sspeed, "int", +$mposspeed, "int", 0, "int", 0)
				$amountdown += $mposspeed
				$amountside += $sspeed
				$f = $f + 1
				Sleep(40)
			EndIf
		Else
			$s = 0
			$l = 0
			If $flip = 1 AND $amountdown > 0 Then
				Sleep(1)
				DllCall("User32.dll", "none", "mouse_event", "int", $mouseeventf_move, "int", $amountside / 3, "int", -$amountdown / 3, "int", 0, "int", 0)
				Sleep(1)
				DllCall("User32.dll", "none", "mouse_event", "int", $mouseeventf_move, "int", $amountside / 3, "int", -$amountdown / 3, "int", 0, "int", 0)
				Sleep(1)
				DllCall("User32.dll", "none", "mouse_event", "int", $mouseeventf_move, "int", $amountside / 3, "int", -$amountdown / 3, "int", 0, "int", 0)
				Sleep(1)
				$amountdown = 0
				$amountside = 0
			EndIf


Code:
Friend Class Form1
	Inherits System.Windows.Forms.Form
	Private Declare Function GetCursorPos Lib "user32" (ByRef lpPoint As POINTAPI) As Integer

	Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
    Private Declare Sub mouse_event Lib "user32.dll" ( _
    ByVal dwFlags As Int32, _
    ByVal dx As Int32, _
    ByVal dy As Int32, _
    ByVal cButtons As Int32, _
    ByVal dwExtraInfo As Int32 _
    )

    Private Declare Function SetCursorPos Lib "user32.dll" ( _
    ByVal X As Int32, _
    ByVal Y As Int32 _
    ) As Boolean
    Private Const MOUSEEVENTF_ABSOLUTE = &H8000
    Private Const MOUSEEVENTF_LEFTDOWN = &H2
    Private Const MOUSEEVENTF_LEFTUP = &H4
    Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
    Private Const MOUSEEVENTF_MIDDLEUP = &H40
    Private Const MOUSEEVENTF_RIGHTDOWN = &H8
    Private Const MOUSEEVENTF_RIGHTUP = &H10
    Private Const MOUSEEVENTF_MOVE = &H1
	Private Const VK_LBUTTON As Integer = &H1
	Private Const VK_PGDN As Integer = &H22
	Private Const VK_PGUP As Integer = &H21
	Private Const VK_END As Integer = &H23
	Private Const VK_HOME As Integer = &H24
	Private Const VK_PLUS As Integer = &HBB
    Private Const VK_MINUS As Integer = &HBD
    Dim Pixel As Integer
    Dim Speed As Integer
	
    Public Structure POINTAPI
        Dim X As Integer
        Dim Y As Integer
    End Structure

    Public Function GetCurrentX() As Integer
        Dim Position As POINTAPI
        GetCursorPos(Position)
        GetCurrentX = Position.X
    End Function

    Public Function GetCurrentY() As Integer
        Dim Position As POINTAPI
        GetCursorPos(Position)
        GetCurrentY = Position.Y
    End Function

    Public Function GetMousePos() As Integer
        GetCurrentX()
        GetCurrentY()
    End Function

    Public Sub Lef***ick()
        LeftUp()
        LeftDown()
    End Sub

    Public Sub LeftDown()
        mouse_event(MOUSEEVENTF_LEFTDOWN, GetCurrentX(), GetCurrentY() + Pixel, 0, 0)
    End Sub

    Public Sub LeftUp()
        mouse_event(MOUSEEVENTF_LEFTUP, GetCurrentX(), GetCurrentY() + Pixel, 0, 0)
    End Sub


   
    Public Sub MoveMouse(ByVal xMove As Long, ByVal yMove As Long)
        mouse_event(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE, xMove, yMove, 0, 0)
    End Sub

    Function PixelPlus()
        Pixel = Pixel + 1
        If Pixel = 101 Then
            Pixel = 100
        End If
        Label2.Text = " Pixels:" & Pixel
    End Function
    Function PixelMinus()
        Pixel = Pixel - 1
        If Pixel = 0 Then
            Pixel = 1
        End If
        Label2.Text = " Pixels:" & Pixel
    End Function
    Function CoilPlus()
        Speed = Timer1.Interval
        Speed = Speed + 1
        If Speed = 101 Then
            Speed = 100
        End If
        Timer1.Interval = Speed
        Label1.Text = " Recoil Speed:" & Speed
    End Function
    Function CoilMinus()
        Pixel = Pixel + 1
        If Pixel = 101 Then
            Pixel = 100
        End If
        Label2.Text = " Pixels:" & Pixel
    End Function

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
               If GetAsyncKeyState(VK_LBUTTON) < 0 Then
 GetMousePos()
            'MoveMouse(GetCurrentX() * 65535 / (Screen.PrimaryScreen.Bounds.Width), GetCurrentY() * 65535 / (Screen.PrimaryScreen.Bounds.Height + Pixel))
            SetCursorPos(GetCurrentX(), GetCurrentY() + Pixel)
            Lef***ick()
        End If
        If GetAsyncKeyState(VK_END) = -32767 Then
            If Timer1.Enabled = True Then
                Timer1.Enabled = False
            End If

        End If
        If GetAsyncKeyState(VK_PLUS) = -32767 Then
            PixelPlus()
        End If
        If GetAsyncKeyState(VK_MINUS) = -32767 Then
            PixelMinus()
        End If
        If GetAsyncKeyState(VK_PGDN) = -32767 Then

            CoilMinus()
        End If
        If GetAsyncKeyState(VK_PGUP) = -32767 Then
            CoilPlus()
        End If
    End Sub

    Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click
        Pixel = 1
        Timer1.Enabled = True
        Label1.Text = " Recoil Speed:" & Timer1.Interval
        Label2.Text = " Pixels:" & Pixel
    End Sub
End Class