Post[Code]Anti-recoil + RapidFire

Posts 112 of 12 · Page 1 of 1
[Code]Anti-recoil + RapidFire
This is my anti-recoil code with in rapid fire that still needs testing/reporgrammed
Code:
 Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Private Const MOUSELEFTDOWN = &H2
Private Const MOUSELEFTUP = &H4
Private Const VK_LBUTTON = &H1
Private Const VK_PGDN = &H22
Private Const VK_PGUP = &H21
Private Const VK_END = &H23
Private Const VK_HOME = &H24
Private Const VK_PLUS = &HBB
Private Const VK_MINUS = &HBD
 
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim Coil As POINTAPI
Dim EX As Long
Dim WHY As Long
Dim Pixel As String

Sub CoilMinus()
Dim Speed
Speed = Timer1.Interval
Speed = Speed - 1
If Speed = 0 Then
Speed = 1
End If
Timer1.Interval = Speed
Label1.Caption = " Recoil Speed:" & Speed
End Sub

Sub CoilPlus()
Dim Speed
Speed = Timer1.Interval
Speed = Speed + 1
If Speed = 101 Then
Speed = 100
End If
Timer1.Interval = Speed
Label1.Caption = " Recoil Speed:" & Speed
End Sub

Sub PixelPlus()
Pixel = Pixel + 1
If Pixel = 101 Then
Pixel = 100
End If
Label2.Caption = " Pixels:" & Pixel
End Sub

Sub PixelMinus()
Pixel = Pixel - 1
If Pixel = 0 Then
Pixel = 1
End If
Label2.Caption = " Pixels:" & Pixel
End Sub

Private Sub Mouse()
AntiRecoil = GetCursorPos(Coil)
EX = Coil.X
WHY = Coil.Y
Call SetCursorPos(EX, WHY + Pixel)
mouse_event MOUSELEFTUP, EX, WHY + Pixel, 0, 0
Call SetCursorPos(EX, WHY + Pixel)
 mouse_event MOUSELEFTDOWN, EX, WHY + Pixel, 0, 0

End Sub

Private Sub Command1_Click()
Pixel = 1
Timer1.Enabled = True
Label1.Caption = " Recoil Speed:" & Timer1.Interval
Label2.Caption = " Pixels:" & Pixel
End Sub

Private Sub Form_Load()
Label1.Caption = " Recoil Speed:0"
Label2.Caption = " Pixels:" & 0
End Sub

Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_HOME) = -32767 Then
Pixel = 1
Speed = 1
Timer1.Enabled = True
Label1.Caption = " Recoil Speed:" & Timer1.Interval
Label2.Caption = " Pixels:" & Pixel
End If
If GetAsyncKeyState(VK_END) = -32767 Then
Pixel = 0
Speed = 0
Timer1.Enabled = False
Label1.Caption = " Recoil Speed:" & "0"
Label2.Caption = " Pixels:" & "0"
End If
If GetAsyncKeyState(VK_LBUTTON) < 0 Then
Mouse
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
Quote Originally Posted by X-sploiT View Post
This is my anti-recoil code with in rapid fire that still needs testing/reporgrammed
Code:
 Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Private Const MOUSELEFTDOWN = &H2
Private Const MOUSELEFTUP = &H4
Private Const VK_LBUTTON = &H1
Private Const VK_PGDN = &H22
Private Const VK_PGUP = &H21
Private Const VK_END = &H23
Private Const VK_HOME = &H24
Private Const VK_PLUS = &HBB
Private Const VK_MINUS = &HBD
 
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim Coil As POINTAPI
Dim EX As Long
Dim WHY As Long
Dim Pixel As String

Sub CoilMinus()
Dim Speed
Speed = Timer1.Interval
Speed = Speed - 1
If Speed = 0 Then
Speed = 1
End If
Timer1.Interval = Speed
Label1.Caption = " Recoil Speed:" & Speed
End Sub

Sub CoilPlus()
Dim Speed
Speed = Timer1.Interval
Speed = Speed + 1
If Speed = 101 Then
Speed = 100
End If
Timer1.Interval = Speed
Label1.Caption = " Recoil Speed:" & Speed
End Sub

Sub PixelPlus()
Pixel = Pixel + 1
If Pixel = 101 Then
Pixel = 100
End If
Label2.Caption = " Pixels:" & Pixel
End Sub

Sub PixelMinus()
Pixel = Pixel - 1
If Pixel = 0 Then
Pixel = 1
End If
Label2.Caption = " Pixels:" & Pixel
End Sub

Private Sub Mouse()
AntiRecoil = GetCursorPos(Coil)
EX = Coil.X
WHY = Coil.Y
Call SetCursorPos(EX, WHY + Pixel)
mouse_event MOUSELEFTUP, EX, WHY + Pixel, 0, 0
Call SetCursorPos(EX, WHY + Pixel)
 mouse_event MOUSELEFTDOWN, EX, WHY + Pixel, 0, 0

End Sub

Private Sub Command1_Click()
Pixel = 1
Timer1.Enabled = True
Label1.Caption = " Recoil Speed:" & Timer1.Interval
Label2.Caption = " Pixels:" & Pixel
End Sub

Private Sub Form_Load()
Label1.Caption = " Recoil Speed:0"
Label2.Caption = " Pixels:" & 0
End Sub

Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_HOME) = -32767 Then
Pixel = 1
Speed = 1
Timer1.Enabled = True
Label1.Caption = " Recoil Speed:" & Timer1.Interval
Label2.Caption = " Pixels:" & Pixel
End If
If GetAsyncKeyState(VK_END) = -32767 Then
Pixel = 0
Speed = 0
Timer1.Enabled = False
Label1.Caption = " Recoil Speed:" & "0"
Label2.Caption = " Pixels:" & "0"
End If
If GetAsyncKeyState(VK_LBUTTON) < 0 Then
Mouse
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
What does it do ???
Uhh. Anti-recoil with rapidfire??
is it me or does this looks like VB6.0 to me :|

and lulz whut do you mean with this:

Code:
Dim Pixel As String

...

Pixel = Pixel + 1
If Pixel = 101 Then
Pixel = 100
End If
so u want to use a integer but u define it a string. and this code works???

k ull need a string for this line though but why not convert it?
Label2.Caption = " Pixels:" & Pixel
Deff VB6 , Thanks for sharing, but to outdated for this section (IMO)

Versions of VB past 6 = 7 ,7.5,8,9,10 , all of which are built for and on the .net framework.

Example of how outdated this is, A book was released called Hardcore Visual basic, which was essentially a hackers guide to vb6, but with vb 7 the whole entire book, every chapter became useless, every hidden feature , memory access, low level hooks etc etc, all became the norm in vb.net , intellesence included
oh so now with vb.net you need no skill to code sweet....just auto completes for you,vb.net is just ugly and just pure shit IMO,even thought vb6 is old its still better than .net,because you don't need .net framework and now any n00b can program,i can do anything you can in .net
Quote Originally Posted by X-sploiT View Post
oh so now with vb.net you need no skill to code sweet....just auto completes for you,vb.net is just ugly and just pure shit IMO,even thought vb6 is old its still better than .net,because you don't need .net framework and now any n00b can program,i can do anything you can in .net
wow.....................

no comment lol
I will go ahead and comment then....

A. Vb6 is to Vb.net as Windows 95 is to Windows 7

There is no comparison, VB6 is not > VB.net

VB6 is old and outdated, there is nothing you can do about that.

oh so now with vb.net you need no skill to code sweet
What developer is in shock when code get's "simplified"

And it isn't the language that simplified things, it is the framework that simplified things.

Just auto completes for you,vb.net is just ugly and just pure shit IMO
Uh...intellesense is nothing knew to vb at all.... have you ever even opened a visual basic program?

I program commercially in more languages then you have brain cells, so I hope that wasn't an attempt to try and put me down, or vb.net users....

Note: You can know everything there is to know about the IBM PC Jr, but if you don't know windows 7, your still the noob. , so in the same sense, You can know all there is to know about vb6 (which I have to doubt for my own reasons) but if you don't grow with technology, your still the noob.


Vb.net is simplified B.A.S.I.C which is simplified assembly. So I can call you a noob for working in VB and not B.A.S.I.C , but simplified code does not mean less powerful, ugly or easier for that matter, we have greater access to everything.

VB.net's developer interface is much better than VB6.

I still have VS6, and on occastion I will open it up just for refreshers, however, it is by no means better, unless you are developing for older OS's,.

The .net language is a much more sophisticated, more powerful language, it's time to upgrade dude, in computer to Human years vb 6 is about 700 yrs old.
Vb6 has done everything i needed it too,i just thought i would share my source,i know vb6 is old but just convert it to .net. I don't even program anymore,haven't for years,.net was just coming out and the stuff i programmed(trojans/worms etc) so i couldn't rely on the fact that they have .net framework. Anyways vb/.net as a language is crap anyways,if i were to program again,i'd learn a real language worth the time,C FTW

And yes i should have not freaked out.
VB.net is as much of a real language as C , In fact they are both high level programming languages that compile at the lowest level.

A real developer understands this fact. But in either case, Thank you for sharing, I just don't feel it is useful.

and considering everyone in this section uses ,net, the next time you talk about it in that nature, I will consider it trolling.

not that I dislike vs6, just isn't useful now
Converted there everyone happy,this works for me,back when i used .net when it first came out didn't seem to be as good,and yes i figured out that it calls c++ directly pretty much,vb.net is alot better then it was like 4-5 years ago or so etc. So .net was new to me, so i never really bothered, because it was literally just coming out.
Yes i just slapped this together best i could so bear me
Code:
Option Strict Off
Option Explicit On
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
Looks good, that's more like it, Much better, Looks good

Only things to change would be

You can remove Option Explicit and Strict

and it would be (for practical purposes) Public Class

otherwise, looks good
Posts 112 of 12 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?