Code:
#NoEnv
#SingleInstance force
#Persistent
#KeyHistory, 0
SetBatchLines,-1
ListLines, Off
SetFormat, IntegerFast, d
ScreenSizeW := A_ScreenWidth
ScreenSizeH := A_ScreenHeight
MiddleOfScreenX := A_ScreenWidth / 2
MiddleOfScreenY := A_ScreenHeight / 2
ShortOffsetY := round(ScreenSizeH*85/1080)
ShortOffsetX := round(ScreenSizeW*58/1920)
LongOffsetY := round(ScreenSizeH*66/1080)
LongOffsetX := round(ScreenSizeW*45/1920)
LeftBias := round(ScreenSizeW*40/1920)
guif:
Gui, Add, Text, x162 y9 w130 h20 , Run [F2]
Gui, Add, Text, x162 y29 w110 h20 , Restart Program [F3]
Gui, Add, GroupBox, x162 y59 w170 h80 , Aim Speed(0-1)
Gui, Add, GroupBox, x12 y9 w130 h50 , Selection
Gui, Add, Checkbox, x22 y29 w60 h20 vLMouse, LButton
Gui, Add, Checkbox, x82 y29 w60 h20 vRMouse, Rbutton
Gui, Add, Text, x22 y149 w90 h20 , LeftBias:(In Pixels)
Gui, Add, Edit, x112 y149 w30 h20 vLeftBias, %LeftBias%
Gui, Add, Text, x172 y79 w120 h20 , Short Range Sens:
Gui, Add, Edit, x292 y79 w30 h20 vShortRangeSens, 0.5
Gui, Add, Text, x172 y109 w110 h20 , Long Range Sens:
Gui, Add, Edit, x292 y109 w30 h20 vLongRangeSens, 0.5
Gui, Add, GroupBox, x12 y69 w140 h110 , Search Box Size(0-1)
Gui, Add, Text, x22 y89 w90 h20 , x-axis / of screen:
Gui, Add, Edit, x112 y89 w30 h20 vBoxSizeW, 0.46
Gui, Add, Text, x22 y119 w90 h20 , y-axis / of screen:
Gui, Add, Edit, x112 y119 w30 h20 vBoxSizeH, 0.2
Gui, Add, GroupBox, x12 y189 w160 h110 , Aim Offsets
Gui, Add, Text, x22 y209 w60 h20 , Short Range
Gui, Add, Text, x92 y229 w30 h20 , y-axis:
Gui, Add, Edit, x122 y229 w30 h20 vShortOffsetY, %ShortOffsetY%
Gui, Add, Text, x22 y229 w30 h20 , x-axis:
Gui, Add, Edit, x52 y229 w30 h20 vShortOffsetX, %ShortOffsetX%
Gui, Add, Text, x22 y249 w60 h20 , Long Range
Gui, Add, Text, x92 y269 w30 h20 , y-axis:
Gui, Add, Edit, x122 y269 w30 h20 vLongOffsetY, %LongOffsetY%
Gui, Add, Text, x22 y269 w30 h20 , x-axis:
Gui, Add, Edit, x52 y269 w30 h20 vLongOffsetX, %LongOffsetX%
Gui, Add, GroupBox, x162 y59 w170 h80 , Aim Speed(0-1)
Gui, Add, Text, x162 y140 w170 h190 , Box Size is a percentage of screen with 0.2 is 80 Percent of the screen, centered and 0.8 is 20 Percent of the Screen, centered. AimSpeed 0 is Nothing 1 is full snap to the target. Shakes will occur more if you Use a large search box. Health bars at the same height inside the search box causes mixed results. Especially with higher aim speeds. LeftBais Shifts the box more to the left as Healthbars drain from the right to left.
Gui, Show, w352 h332, Chrome
return
GuiClose:
ExitApp
F2::
Loop,
{
Gui, Submit, Nohide
imageSearch, HealthBarLocationX, HealthBarLocationY, ScreenSizeW * BoxSizeW - LeftBias, ScreenSizeH * BoxSizeH, ScreenSizeW - ScreenSizeW * BoxSizeW, ScreenSizeH - ScreenSizeH * BoxSizeH, img2.bmp
AimX := HealthBarLocationX - MiddleOfScreenX + ShortOffsetX
AimY := HealthBarLocationY - MiddleOfScreenY + ShortOffsetY
MoveX := AimX * ShortRangeSens
MoveY := AimY * ShortRangeSens
if(ErrorLevel = 1)
{
imageSearch, HealthBarLocationX, HealthBarLocationY, ScreenSizeW * BoxSizeW - LeftBias, ScreenSizeH * BoxSizeH, ScreenSizeW - ScreenSizeW * BoxSizeW, ScreenSizeH - ScreenSizeH * BoxSizeH, img.bmp
AimX := HealthBarLocationX - MiddleOfScreenX + LongOffsetX
AimY := HealthBarLocationY - MiddleOfScreenY + LongOffsetY
MoveX := AimX * LongRangeSens
MoveY := AimY * LongRangeSens
}
if(LMouse == 1)
{
GetKeyState, Mouse0, LButton, P
MovingMouse(Mouse0, MoveX, MoveY)
}
if(RMouse == 1)
{
GetKeyState, Mouse0, RButton, P
MovingMouse(Mouse0, MoveX, MoveY)
}
}
MovingMouse(MouseState, XCord, YCord)
{
If(MouseState == "D")
{
DllCall("mouse_event", "uint", 0x0001, "int", XCord, "int", YCord, "uint", 0, "int", 0)
}
}
F3::
Reload
return
img.bmp is a colored 1x4 255/0/19 [RGB]