Professional Documents
Culture Documents
InteropServices
Public MinRed As Single = 110 'minimum red value of pixel - set lower for
darker maps (0-255)
Public MaxSatToBriRatio As Single = 0.6 'Max ratio of saturation to brightness
allowed (0-1.00)
Public MaxBritoSatRatio As Single = 0.35 'Max ratio of brightness to saturation
allowed (0-1.00)
Public RedOrangeRange As Single = 15 ' adjust down to decrease targeting orange
(0-30)
Public RedVioletRange As Single = 343 ' adjust up to decrease targeting violet
(330-360)
Public DistanceFromTargetBeforeFiringX As Long = 6 ' maximum distance from
target in x to fire (1-100)
Public DistanceFromTargetBeforeFiringY As Long = 6 ' maximum distance from
target in y to fire (1-100)
Public NonWhiteCrosshair As Long = 1 ' change this to 1 to stop widow from auto
firing while in zoom. Crosshair cannot be a pure white for it to work if unzoomed.
Public AdjustDown As Integer = -1 'optional - move scanning up/down depending
on where window is - negative values allowed
Public AdjustRight As Integer = -1 'optional - move scanning left/right
depending on where window is - negative values allowed
<DllImport("user32.dll")>
Shared Function GetAsyncKeyState(ByVal vKey As System.Windows.Forms.Keys) As
Short
End Function
<DllImport("user32.dll")>
Private Shared Function ReleaseDC(ByVal hWnd As IntPtr, ByVal hDc As IntPtr) As
IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True)>
Private Shared Function GetActiveWindow() As IntPtr
End Function
<DllImport("gdi32")>
Public Shared Function BitBlt(ByVal hDestDC As IntPtr, ByVal X As Integer,
ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC
As IntPtr, ByVal SrcX As Integer, ByVal SrcY As Integer, ByVal Rop As Integer) As
Boolean
End Function
Dim GCH As GCHandle = GCHandle.Alloc(Pixels, GCHandleType.Pinned)
<DllImport("user32.dll")>
Private Shared Function GetWindowDC(ByVal hwnd As IntPtr) As IntPtr
End Function
Dim YW As Single
Dim X As Single
Dim Y As Single
Dim g As Graphics
Dim hdcDest As IntPtr = IntPtr.Zero
Dim desktopHandleDC As IntPtr = IntPtr.Zero
Dim desktopHandle As IntPtr
SetScanRange()
desktopHandle = GetActiveWindow()
g = Graphics.FromImage(Bmp)
desktopHandleDC = GetWindowDC(desktopHandle)
hdcDest = g.GetHdc
Dim gf As Integer
Dim GH As Rectangle
gf = GetWindowRect(desktopHandle, GH)
g.ReleaseHdc(hdcDest)
ReleaseDC(desktopHandle, desktopHandleDC)
Bmp.Dispose()
g.Dispose() : g = Nothing
For X = 3 To ScanRange - 4
YW = X * ScanRange
For Y = 3 To ScanRange - 4
YWY = YW + Y
myColor = Color.FromArgb((Pixels(YWY)))
Pixels_Hue(YWY) = myColor.GetHue
Pixels_Brightness(YWY) = myColor.GetBrightness
Pixels_Saturation(YWY) = myColor.GetSaturation
Pixels_R(YWY) = myColor.R
If NonWhiteCrosshair = 1 Then
'sniper zoom fix
If Pixels_Hue(YWY) = 0 And Pixels_Saturation(YWY) = 0 And
Pixels_Brightness(YWY) = 1 And CheckRightMouse() = 1 And (LastFireTick +
FireDelayRightMouseDown) <= GetTickCount Then
AmountOfPureWhiteFound = AmountOfPureWhiteFound + 1
If AmountOfPureWhiteFound > 20 Then
'fix for sniper red in zoom with large scan range =/
'DEBUG
' RichTextBox1.AppendText("HUE=" &
(myColor.GetHue()).ToString & vbTab & "SAT=" & myColor.GetSaturation().ToString &
vbTab & "BGT=" & (myColor.GetBrightness()).ToString & vbTab & myColor.R &
vbNewLine)
'advanced comparison
For X2 = (X - 3) To (X + 3)
YW2 = X2 * ScanRange
For Y2 = (Y - 3) To (Y + 3)
YW2Y2 = YW2 + Y2
'x2=0 and y2=0 produces additional triggered pixel
Next Y2
Next X2
'target x/y
If CheckRightMouse() = 0 Then
If AmountfoundCC1 >= 1 And AmountfoundCC1 <= 13 Then
TargetY = TargetY + Y 'settings for right mouse up
TargetX = TargetX + X
CheckXYRange(X, Y)
TargetAmountFound = TargetAmountFound + 1
avgBrightnessFound = avgBrightnessFound +
Pixels_Brightness(YWY)
avgsaturationFound = avgsaturationFound +
Pixels_Saturation(YWY)
End If
'Next I
Else
' For I = 2 To 19
If AmountfoundCC1 >= 2 And AmountfoundCC1 <= 19 Then
TargetY = TargetY + Y 'settings for right mouse
down
TargetX = TargetX + X
CheckXYRange(X, Y)
TargetAmountFound = TargetAmountFound + 1
CCAmount(AmountfoundCC1) = CCAmount(AmountfoundCC1) + 1
AmountfoundCC1 = 0
End If
End If
NExtY:
Next Y
Next X
'combine line figures together
If CheckRightMouse() = 0 Then
For I = 1 To 13
CombinedLineFigure = CombinedLineFigure + CCAmount(I) 'settings
for right mouse up
Next I
Else
For I = 2 To 19
CombinedLineFigure = CombinedLineFigure + CCAmount(I) 'settings
for right mouse down
Next I
End If
End If
If avgHUE > 2 And avgHUE < 14 And avgBrightness < 0.45 And avgsaturation <
0.45 Then
' FireTriggered = 0 ' don't fire
End If
End If
If CheckKeyENTER() = 1 Then
LastFireTick = GetTickCount + 1500 'disable aimbot while chatting
End If
If FireTriggered = 1 Then
Fire()
End If
' RichTextBox1.Text = ("avgHUE=" & avgHUE & vbTab & "avgSAT=" &
avgsaturation & vbTab & "avgBGT=" & avgBrightness & vbNewLine)
' avgHueFound = avgHueFound Mod 360
' RichTextBox1.AppendText("MinBrightness=" & MinBrightness & vbTab &
"MinSaturation=" & MinSaturation & vbNewLine)
' RichTextBox1.AppendText("avgHUEfound=" & avgHueFound & vbTab &
"avgSATfound=" & avgsaturationFound & vbTab & "avgBGTfound=" & avgBrightnessFound &
vbNewLine)
'RichTextBox1.AppendText(ChartQuad(1) & " " & ChartQuad(2) & " " &
ChartQuad(3) & " " & ChartQuad(4) & vbNewLine)
'RichTextBox1.AppendText(Math.Round((screenheight / 2) + (TargetX /
TargetAmountFound) - ScanRange / 2) + AdjustRight & vbNewLine)
End If
Array.Clear(ChartQuad, 0, ChartQuad.Length)
End Sub
Public Sub Fire()
If (LastFireTick + FireDelayRightMouseDown) <= GetTickCount And
CheckRightMouse() = 1 Then GoTo Fire
If (LastFireTick + FireDelayRightMouseUp) <= GetTickCount And
CheckRightMouse() = 0 Then
Fire:
If CheckLeftMouse() = 0 Then 'don't fire while the mouse is being
manually clicked
SendKeys.Send("k") 'Using the mouse to click might result in
screenlock
End Sub
End Sub
Public Function QuadrantCheck3() As Long
Dim i As Long
Dim QuadNumber As Long
For i = 1 To 4
If ChartQuad(i) >= MinQuad3 Then
QuadNumber = QuadNumber + 1
End If
Next i
For i = 1 To 4
If ChartQuad(i) >= MinQuad4 Then
QuadNumber = QuadNumber + 1
End If
Next i
End Sub
End Sub
Private Sub TrackBarSensitivity_Scroll(sender As Object, e As EventArgs)
LblSensitivity.Text = TrackBarSensitivity.Value
AdjustSensitivity(TrackBarSensitivity.Value)
End Sub
AdjustDown = TrackBarY.Value - 25
LblTrackBarY.Text = "Y = " & AdjustDown
End Sub
Private Sub TrackBarX_Scroll(sender As Object, e As EventArgs)
If ChkBluebox.CheckState = CheckState.Unchecked Then
ChkBluebox.CheckState = CheckState.Checked
Call Chkbluebox_Click(Nothing, EventArgs.Empty)
End If
AdjustRight = TrackBarX.Value - 50
LblTrackBarX.Text = "X = " & AdjustRight
End Sub
End Sub
Application.DoEvents()
Using g As Graphics = Graphics.FromHwnd(IntPtr.Zero)
For i = 0 To 2000
SetScanRange()
Dim rect As Rectangle = New
Rectangle((Screen.PrimaryScreen.Bounds.Width / 2) - (ScanRange / 2) + AdjustRight,
(Screen.PrimaryScreen.Bounds.Height / 2) - (ScanRange / 2) + AdjustDown, ScanRange,
ScanRange)
Dim rectalpha As Rectangle = New
Rectangle((Screen.PrimaryScreen.Bounds.Width / 2) - (1) + AdjustRight,
(Screen.PrimaryScreen.Bounds.Height / 2) - (1) + AdjustDown, 1, 1)
If i Mod 2 = 1 Then
Using lgb As New Drawing2D.LinearGradientBrush(rect,
Color.Blue, Color.Blue, 90, True)
g.FillRectangle(lgb, rect)
End Using
Else
Using lgba As New Drawing2D.LinearGradientBrush(rectalpha,
Color.White, Color.White, 90, True)
g.FillRectangle(lgba, rectalpha)
End Using
End If
Application.DoEvents()
If IsFormClosing = True Then Exit Sub
If ChkBluebox.CheckState = CheckState.Unchecked Then
Me.Refresh()
Exit Sub
End If
Next i
End Using
ChkBluebox.CheckState = CheckState.Unchecked
Me.Refresh()
End Sub
End Class