Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;
- ;; INITIALIZATION ;;
- ;;;;;;;;;;;;;;;;;;;;
- ;Updated 09/26/22
- #NoEnv
- #Persistent
- #SingleInstance, Force
- #MaxHotkeysPerInterval 99000000
- #HotkeyInterval 99000000
- #KeyHistory 0
- #InstallKeybdHook
- #UseHook
- #MenuMaskKey vk07
- ListLines Off
- SetBatchLines, -1
- SetKeyDelay, -1, -1
- SetMouseDelay, -1
- SetDefaultMouseSpeed , 0
- SetWinDelay, -1
- SetControlDelay, -1
- ;SendMode Input
- DllCall("ntdll\ZwSetTimerResolution","Int",5000,"Int",1,"Int*",MyCurrentTimerResolution) ;setting the Windows Timer Resolution to 0.5ms, THIS IS A GLOBAL CHANGE
- SetTitleMatchMode, 2
- SetTitleMatchMode, fast
- ;Set Icon
- IfExist, %A_ScriptDir%\graphics\Icon.png
- {
- Menu,Tray,Icon, %A_ScriptDir%\graphics\Icon.png
- }
- ;;;;;;;;;;;;;;;;;;;
- ;;GLOBAL SETTINGS;;
- ;;;;;;;;;;;;;;;;;;;
- ;Set default variables to globals
- SetDefaults(){
- global
- }
- ;Time intervals
- global framesPerSecond := "60" ;Game's FPS
- global gameTick := ((1/framesPerSecond)*1000) ;One gametick / frame
- ;TOGGLES - Features
- global firingMode := "Default" ;Currently active firing mode
- global firingModeHip := "Default" ;Firing mode from the hip
- global firingModeADS := "Default" ;Firing mode while ADS
- global enableBHop := "1" ;Enable space bar spam
- global enableHoldProne := "1" ;Enable hold prone
- global enableHoldToMelee := "1" ;Enable hold quick melee to switch to melee weapon
- global enableHoldToProne := "0" ;Enable hold crouch to prone (only if toggle crouch)
- global enableAutoBreath := "0" ;Enable auto breath hold for snipers
- global enableAutoMark := "0" ;Enable AutoMark system
- ;DEBUGGNG
- global debugRet := "1"
- ;TOGGLES - UI display
- global showUI := "1" ;Display the UI
- global showUI_Inputs := "0" ;Display the input UI
- global showUI_Directionals := "0" ;Display the directional input UI
- global showUI_InputBG := "0" ;Display the input UI backdrop
- global showUI_firingMode := "1" ;Display the firing mode
- global showUI_Ret := "1" ;Display the crosshair
- global showUI_RetCross := "1" ;Display the crosshair cross
- global showUI_RetDot := "1" ;Display the crosshair dot
- global showUI_RetCircle := "1" ;Display the crosshair circle
- global showUI_RetAnimate := "1" ;Display the crosshair animiations
- global retOffsetX := "0" ;Ret offset X
- global retOffsetY := "0" ;Ret offset Y
- ;AutoMark system
- global markOut := "0" ;AutoMark is out
- global autoMarkCooldown := "300" ;AutoMark Cooldown in ticks
- ;Burst fire system 1
- global burst1Ticks := "4" ;The number of times burstfire will loop
- global burst1FireMax := "3" ;The number of times burstfire will loop
- global burst1FireCount := "0" ;The number of times burstfire has looped
- global isBursting1 := "0" ;The player is firing a burstfire shot
- ;Burst fire system 2
- global burst2Ticks := "2" ;The number of times burstfire will loop
- global burst2FireMax := "3" ;The number of times burstfire will loop
- global burst2FireCount := "0" ;The number of times burstfire has looped
- global isBursting2 := "0" ;The player is firing a burstfire shot
- ;Input systems
- global isBHopping := "0" ;The player is bhopping
- global bHopFirstHop := "0" ;Handles the first hop before beginning bhop spam
- global bHopSwitch := "0" ;Bhop down/up flipper
- global isHoldingAim := "0" ;The player is holding aim
- global isHoldingCrouch := "0" ;The player is holding crouch
- global isHoldingProne := "0" ;The player is holding prone
- global chargedProne := "0" ;(Hold to Prone) The player has charged prone
- global isProning := "0" ;(Hold to Prone) The player is proning
- global proneCount := "0" ;(Hold to Prone) Prone Counter
- global proneCountMax := "6" ;(Hold to Prone) Maximum number of prones to spam
- global unProneCount := "0" ;(Hold to Prone) UnProne Counter
- global unProneCountMax := "6" ;(Hold to Prone) Maximum number of unprones to spam
- global isHoldingMelee := "0" ;The player is holding melee
- global chargedMelee := "0" ;The player has charged melee
- global cancelMelee := "0" ;Cancel the melee
- global isHoldingFiringMode := "0" ;The player is holding firing mode switch
- global chargedFiringMode := "0" ;The player has charged firing mode switch
- global cancelFiringMode := "0" ;Cancel the firing mode switch
- global firingModeSound := "" ;The firing mode sound to play
- global isHoldingFire := "0" ;The player is holding fire
- global isHoldingSprint := "0" ;The player is holding sprint
- global isHoldingJump := "0" ;The player is holding jump
- ;UI systems
- global scrX := A_ScreenWidth
- global scrY := A_ScreenHeight
- global GUISizeRet := "200" ;Width/Height of ret window
- global inputUIGap := "50" ;movement key display UI gap
- global windowSelected := "1" ;Expected game window is in focus
- ;UI Crosshair animation system
- global PI := "3.14" ;... it's pi
- global sRetAction := "None" ;Debug string for current ret action
- global sRetMotion := "None" ;Debug string for current ret motion
- global retAniProgress := "0" ;0-1 of Ret progress
- global retAniCurved := "0" ;Ret progress with applied ease curve
- global aniStepsGrow := "0" ;steps in ticks ret will animate from 0 to 1
- global aniStepsDecay := "0" ;steps in ticks ret will animate from 1 to 0
- global doneGrow := "0" ;Ret animation is finished growing
- global doneDecay := "0" ;Ret animation is finised decaying
- global aniFrameRate := "0" ;Ret framerate subdivision
- global aniOnResetShowCross := "0" ;Show the cross on animation reset
- global aniOnResetShowDot := "0" ;Show the dot on animaton reset
- global retWidthOutline := "0" ;Ret cross outline width
- global retLengthOutline := "0" ;Ret cross outline length
- global retDotOutlineSize := "0" ;Ret dot outline size
- global retGap := "0" ;Ret crosshair center gap size
- global retLength := "0" ;Ret crosshair bar lengths
- global retWidth := "0" ;Ret crosshair bar widths
- global retOutline := "0" ;Ret crosshair bar outline size
- global retDotSize := "0" ;Ret dot size
- global retDotOutline := "0" ;Ret dot outline size
- global retCircleRadius := "0" ;Ret circle radius
- global retCircleThickness := "0" ;Ret circle thickness
- global retCircleOutline := "0" ;Ret circle outline size
- global retCircleGap := "0" ;Ret circle outline size
- global aniRateGrowGap := "0" ;Grow rate for ret crosshair center gap
- global aniRateGrowLength := "0" ;Grow rate for ret crosshair bar length
- global aniRateGrowWidth := "0" ;Grow rate for ret crosshair bar widths
- global aniRateGrowOutline := "0" ;Grow rate for ret crosshair bar outlin
- global aniRateGrowDotSize := "0" ;Grow rate for ret dot size
- global aniRateGrowDotOutline := "0" ;Grow rate for ret dot outline size
- global aniRateGrowCircleRadius := "0" ;Grow rate for ret circle radius
- global aniRateGrowCircleThickness := "0" ;Grow rate for ret circle thickness
- global aniRateGrowCircleOutline := "0" ;Grow rate for ret circle outline size
- global aniRateGrowCircleGap := "0" ;Ret circle outline size
- global aniRateDecayGap := "0" ;Decay rate for ret crosshair center gap
- global aniRateDecayLength := "0" ;Decay rate for ret crosshair bar length
- global aniRateDecayWidth := "0" ;Decay rate for ret crosshair bar widths
- global aniRateDecayOutline := "0" ;Decay rate for ret crosshair bar outlin
- global aniRateDecayDotSize := "0" ;Decay rate for ret dot size
- global aniRateDecayDotOutline := "0" ;Decay rate for ret dot outline size
- global aniRateDecayCircleRadius := "0" ;Decay rate for ret circle radius
- global aniRateDecayCircleThickness := "0" ;Decay rate for ret circle thickness
- global aniRateDecayCircleOutline := "0" ;Decay rate for ret circle outline size
- global aniRateDecayCircleGap := "0" ;Ret circle outline size
- global aniMinGap := "0" ;Minimum value for ret crosshair center gap
- global aniMinLength := "0" ;Minimum value for ret crosshair bar length
- global aniMinWidth := "0" ;Minimum value for ret crosshair bar widths
- global aniMinOutline := "0" ;Minimum value for ret crosshair bar outlin
- global aniMinDotSize := "0" ;Minimum value for ret dot size
- global aniMinDotOutline := "0" ;Minimum value for ret dot outline size
- global aniMinCircleRadius := "0" ;Minimum value for ret circle radius
- global aniMinCircleThickness := "0" ;Minimum value for ret circle thickness
- global aniMinCircleOutline := "0" ;Minimum value for ret circle outline size
- global aniMinCircleGap := "0" ;Ret circle outline size
- global aniMaxGap := "0" ;Maximum value for ret crosshair center gap
- global aniMaxLength := "0" ;Maximum value for ret crosshair bar length
- global aniMaxWidth := "0" ;Maximum value for ret crosshair bar widths
- global aniMaxOutline := "0" ;Maximum value for ret crosshair bar outlin
- global aniMaxDotSize := "0" ;Maximum value for ret dot size
- global aniMaxDotOutline := "0" ;Maximum value for ret dot outline size
- global aniMaxCircleRadius := "0" ;Maximum value for ret circle radius
- global aniMaxCircleThickness := "0" ;Maximum value for ret circle thickness
- global aniMaxCircleOutline := "0" ;Maximum value for ret circle outline size
- global aniMaxCircleGap := "0" ;Ret circle outline size
- global aniSnapStep := "0" ;Snap ammount
- ;Image files
- global imgB := A_ScriptDir . "\graphics\pixel_BLACK.png" ;1x1 pixel black
- global imgW := A_ScriptDir . "\graphics\pixel_WHITE.png" ;1x1 pixel white
- global imgFiringModeOff := A_ScriptDir . "\graphics\Modes\off.png" ;Firing Mode - Off (I.E. resetting to defaults)
- global imgFiringModeAuto1 := A_ScriptDir . "\graphics\Modes\auto1.png" ;Firing Mode - Auto1 (Default)
- global imgFiringModeAuto2 := A_ScriptDir . "\graphics\Modes\auto2.png" ;Firing Mode - Auto2 (Off/On switch)
- global imgFiringModeBurst1 := A_ScriptDir . "\graphics\Modes\burst1.png" ;Firing Mode - burst1 (Timer-based)
- global imgFiringModeBurst2 := A_ScriptDir . "\graphics\Modes\burst2.png" ;Firing Mode - burst2 (Looped shots)
- global imgFiringModeSemi := A_ScriptDir . "\graphics\Modes\semi.png" ;Firing Mode - Semi-Auto
- ;UI colors
- global UIRGB := "111111" ;Default (transparent)
- global UIKeyOff := "111111" ;Input key off color
- global UIKeyOn := "00FF00" ;Input key on color
- ;UI initialization
- loadUI()
- retState("1")
- checkWindow()
- ;;;;;;;;;;;;;;;;;;;;
- ;; TIME INTERVALS ;;
- ;;;;;;;;;;;;;;;;;;;;
- tick(t:="1"){ ;Tick(ticks)
- ticks := gameTick*t
- return ticks
- }
- wait(t:="1"){ ;Wait(ticks) ;Try to avoid waits/sleeps over subroutine labels
- ticks := (tick*t)
- DllCall("Sleep","UInt", %ticks%)
- return
- }
- ;;;;;;;;;;;;;;;;;;;;
- ;; USER INTERFACE ;;
- ;;;;;;;;;;;;;;;;;;;;
- if showUI_Ret{ ;Reticle
- if showUI_RetCircle{ ;Globalize HWNDs and coodrinates
- global HWNDCircleB := "0"
- global HWNDCircleW := "0"
- global CircleB_Outer := "0"
- global CircleB_Inner := "0"
- global CircleW_Outer := "0"
- global CircleW_Inner := "0"
- global Circle_UL := "0"
- global Circle_DR := "0"
- global CircleW_Outer_UL := "0"
- global CircleW_Outer_DR := "0"
- global CircleB_Outer_UL := "0"
- global CircleB_Outer_DR := "0"
- global CircleB_Inner_UL := "0"
- global CircleB_Inner_DR := "0"
- global CircleW_GapTL := "0"
- global CircleW_GapBR := "0"
- global CircleW_GapH := "0"
- global CircleW_GapV := "0"
- global CircleB_GapTL := "0"
- global CircleB_GapBR := "0"
- global CircleB_GapH := "0"
- global CircleB_GapV := "0"
- }
- if showUI_RetCross{ ;Globalize height/width HWNDs and coordinates
- global retUp_blackH := "0"
- global retDown_blackH := "0"
- global retLeft_blackH := "0"
- global retRight_blackH := "0"
- global retUp_blackV := "0"
- global retDown_blackV := "0"
- global retLeft_blackV := "0"
- global retRight_blackV := "0"
- global retUp_white := "0"
- global retDown_white := "0"
- global retLeft_white := "0"
- global retRight_white := "0"
- global U_blackHX := "0"
- global U_blackHY := "0"
- global D_blackHX := "0"
- global D_blackHY := "0"
- global L_blackHX := "0"
- global L_blackHY := "0"
- global R_blackHX := "0"
- global R_blackHY := "0"
- global U_blackVX := "0"
- global U_blackVY := "0"
- global D_blackVX := "0"
- global D_blackVY := "0"
- global L_blackVX := "0"
- global L_blackVY := "0"
- global R_blackVX := "0"
- global R_blackVY := "0"
- global U_whiteX := "0"
- global U_whiteY := "0"
- global D_whiteX := "0"
- global D_whiteY := "0"
- global L_whiteX := "0"
- global L_whiteY := "0"
- global R_whiteX := "0"
- global R_whiteY := "0"
- }
- if showUI_RetDot{ ;Globalize height/width HWNDs and coodrinates
- global retCenter_blackH := "0"
- global retCenter_blackV := "0"
- global retCenter_white := "0"
- global M_blackHX := "0"
- global M_blackHY := "0"
- global M_blackVX := "0"
- global M_blackVY := "0"
- global M_whiteX := "0"
- global M_whiteY := "0"
- }
- }
- createGUI_ret()
- createGUI_ret(){ ;Create ret GUI windows
- if showUI_Ret{
- if debugRet{
- createGUI_retUI_debug()
- }
- createGUI_retUI_CROSSB()
- createGUI_retUI_DOTB()
- createGUI_retUI_CIRCLEB()
- createGUI_retUI_CROSSW()
- createGUI_retUI_DOTW()
- createGUI_retUI_CIRCLEW()
- }
- }
- createGUI_retUi_debug(){ ;Ret debug
- GLOBAL RetVariables
- GLOBAL RetValues
- Gui, retUI_DEBUG: New
- Gui, retUI_DEBUG: Color, FFFFFF
- Gui, retUI_DEBUG: Add, Text, vRetVariables x0 y0 w100, Variables`n`nsRetMotion`nsRetAction`nretAniProgress`nretAniCurved`nretGap`nretLength`nretWidth`nretOutline`nretDotSize`nretDotOutline`nretCircleRadius`nretCircleThickness`nretCircleOutline`nretCircleGap
- Gui, retUI_DEBUG: Add, Text, vRetValues x100 y0 w100, Values`n`n%sRetMotion%`n%sRetAction%`n%retAniProgress%`n%retAniCurved%`n%retGap%`n%retLength%`n%retWidth%`n%retOutline%`n%retDotSize%`n%retDotOutline%`n%retCircleRadius%`n%retCircleThickness%`n%retCircleOutline%`n%retCircleGap%
- Gui, retUI_DEBUG: Show, AutoSize
- updateRetDebugText()
- return
- }
- updateRetDebugText(){ ;Update ret debug text
- GuiControl retUI_DEBUG:,RetValues,Values`n`n%sRetMotion%`n%sRetAction%`n%retAniProgress%`n%retAniCurved%`n%retGap%`n%retLength%`n%retWidth%`n%retOutline%`n%retDotSize%`n%retDotOutline%`n%retCircleRadius%`n%retCircleThickness%`n%retCircleOutline%`n%retCircleGap%
- }
- createGUI_retUI_CROSSB(){
- if showUI_RetCross{ ;Ret cross
- Gui, retUI_CROSSB: Destroy
- Gui, retUI_CROSSB: Color, %UIRGB%
- Gui retUI_CROSSB: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20; +E0x02000000 +E0x00080000
- Gui, retUI_CROSSB: Add, Picture, hwndretU_blackH +BackgroundTrans, %imgB%
- Gui, retUI_CROSSB: Add, Picture, hwndretD_blackH +BackgroundTrans, %imgB%
- Gui, retUI_CROSSB: Add, Picture, hwndretL_blackH +BackgroundTrans, %imgB%
- Gui, retUI_CROSSB: Add, Picture, hwndretR_blackH +BackgroundTrans, %imgB%
- Gui, retUI_CROSSB: Add, Picture, hwndretU_blackV +BackgroundTrans, %imgB%
- Gui, retUI_CROSSB: Add, Picture, hwndretD_blackV +BackgroundTrans, %imgB%
- Gui, retUI_CROSSB: Add, Picture, hwndretL_blackV +BackgroundTrans, %imgB%
- Gui, retUI_CROSSB: Add, Picture, hwndretR_blackV +BackgroundTrans, %imgB%
- WinSet, TransColor, %UIRGB% 255
- retUp_blackH := retU_blackH
- retDown_blackH := retD_blackH
- retLeft_blackH := retL_blackH
- retRight_blackH := retR_blackH
- retUp_blackV := retU_blackV
- retDown_blackV := retD_blackV
- retLeft_blackV := retL_blackV
- retRight_blackV := retR_blackV
- }
- return
- }
- createGUI_retUI_DOTB(){
- if showUI_RetDot{ ;Dot black outline
- Gui, retUI_DOTB: Destroy
- Gui, retUI_DOTB: Color, %UIRGB%
- Gui retUI_DOTB: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20; +E0x02000000 +E0x00080000
- Gui, retUI_DOTB: Add, Picture, hwndretM_blackH +BackgroundTrans, %imgB%
- Gui, retUI_DOTB: Add, Picture, hwndretM_blackV +BackgroundTrans, %imgB%
- WinSet, TransColor, %UIRGB% 255
- retCenter_blackH := retM_blackH
- retCenter_blackV := retM_blackV
- }
- return
- }
- createGUI_retUI_CIRCLEB(){
- if showUI_RetCircle{ ;Circle black outline
- Gui, retUI_CIRCLEB: Hide
- Gui, retUI_CIRCLEB: Destroy
- Gui, retUI_CIRCLEB: Color, 000000
- Gui retUI_CIRCLEB: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20; +E0x02000000 +E0x00080000
- WinGet, UICircleB
- HWNDCircleB := UICircleB
- }
- return
- }
- createGUI_retUI_CROSSW(){
- if showUI_RetCross{ ;Cross white body
- Gui, retUI_CROSSW: Destroy
- Gui, retUI_CROSSW: Color, %UIRGB%
- Gui retUI_CROSSW: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20; +E0x02000000 +E0x00080000
- Gui, retUI_CROSSW: Add, Picture, hwndretU_white +BackgroundTrans, %imgW%
- Gui, retUI_CROSSW: Add, Picture, hwndretD_white +BackgroundTrans, %imgW%
- Gui, retUI_CROSSW: Add, Picture, hwndretL_white +BackgroundTrans, %imgW%
- Gui, retUI_CROSSW: Add, Picture, hwndretR_white +BackgroundTrans, %imgW%
- WinSet, TransColor, %UIRGB% 255
- retUp_white := retU_white
- retDown_white := retD_white
- retLeft_white := retL_white
- retRight_white := retR_white
- }
- return
- }
- createGUI_retUI_DOTW(){
- if showUI_RetDot{ ;Dot white body
- Gui, retUI_DOTW: Destroy
- Gui, retUI_DOTW: Color, %UIRGB%
- Gui retUI_DOTW: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20; +E0x02000000 +E0x00080000
- Gui, retUI_DOTW: Add, Picture, hwndretM_white +BackgroundTrans, %imgW%
- WinSet, TransColor, %UIRGB% 255
- retCenter_white := retM_white
- }
- return
- }
- createGUI_retUI_CIRCLEW(){
- if showUI_RetCircle{ ;Circle white body
- Gui, retUI_CIRCLEW: Hide
- Gui, retUI_CIRCLEW: Destroy
- Gui, retUI_CIRCLEW: Color, FFFFFF
- Gui retUI_CIRCLEW: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20; +E0x02000000 +E0x00080000
- WinGet, UICircleW
- HWNDCircleW := UICircleW
- }
- return
- }
- if showUI_Inputs{ ;Inputs
- if showUI_InputBG{
- Gui, inputBGUI: Color, %UIRGB% ;Input background
- Gui inputBGUI: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, inputBGUI: Font, s36, Arial
- if showUI_Directionals{ ;Input background directional arrows
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)-25 . " y" . ((scrY/2)-59)-inputUIGap . " w50", ^
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . ((scrX/2)-67)-inputUIGap . " y" . (scrY/2)-28 . " w50", <
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . ((scrX/2)+17)+inputUIGap . " y" . (scrY/2)-28 . " w50", >
- Gui, inputBGUI: Font, s31, Arial
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)-24 . " y" . ((scrY/2)+14)+inputUIGap . " w50", v
- }
- Gui, inputBGUI: Font, s24, Arial
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)-40 . " y" . (scrY/2)+40 . " w50", Jump
- Gui, inputBGUI: Font, s20, Arial
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)-40 . " y" . (scrY/2)-135 . " w50", Melee
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)-90 . " y" . (scrY/2)-105 . " w50", Fire
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)+40 . " y" . (scrY/2)-105 . " w50", Aim
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)-115. " y" . (scrY/2)+70 . " w50", Crouch
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)-105. " y" . (scrY/2)+100 . " w50", Prone
- Gui, inputBGUI: Add, Text, % "center 0x201 BackGroundTrans c00FF00 x" . (scrX/2)+25. " y" . (scrY/2)+85 . " w50", Sprint
- WinSet, TransColor, %UIRGB% 31
- }
- Gui, inputUI: Color, %UIRGB% ;Inputs
- Gui inputUI: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, inputUI: Font, s36, Arial
- if showUI_Directionals{ ;Directonal arrows
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vmoveForwardText c" . UIKeyOff . " x" . (scrX/2)-25 . " y" . ((scrY/2)-59)-inputUIGap . " w50", ^
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vmoveLeftText c" . UIKeyOff . " x" . ((scrX/2)-67)-inputUIGap . " y" . (scrY/2)-28 . " w50", <
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vmoveRightText c" . UIKeyOff . " x" . ((scrX/2)+17)+inputUIGap . " y" . (scrY/2)-28 . " w50", >
- Gui, inputUI: Font, s31, Arial
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vmoveBackwardText c" . UIKeyOff . " x" . (scrX/2)-24 . " y" . ((scrY/2)+14)+inputUIGap . " w50", v
- }
- Gui, inputUI: Font, s24, Arial
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vjumpText c" . UIKeyOff . " x" . (scrX/2)-40 . " y" . (scrY/2)+40 . " w50", Jump
- Gui, inputUI: Font, s20, Arial
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vmeleeText c" . UIKeyOff . " x" . (scrX/2)-40 . " y" . (scrY/2)-135 . " w50", Melee
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vfireText c" . UIKeyOff . " x" . (scrX/2)-90 . " y" . (scrY/2)-105 . " w50", Fire
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vaimText c" . UIKeyOff . " x" . (scrX/2)+40 . " y" . (scrY/2)-105 . " w50", Aim
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vcrouchText c" . UIKeyOff . " x" . (scrX/2)-115. " y" . (scrY/2)+70 . " w50", Crouch
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vproneText c" . UIKeyOff . " x" . (scrX/2)-105. " y" . (scrY/2)+100 . " w50", Prone
- Gui, inputUI: Add, Text, % "center 0x201 BackGroundTrans vsprintText c" . UIKeyOff . " x" . (scrX/2)+25. " y" . (scrY/2)+85 . " w50", Sprint
- WinSet, TransColor, %UIRGB% 255
- }
- if showUI_firingMode{
- Gui, firingModeHip: Color, %UIRGB% ;Hipfire Firing Mode
- Gui firingModeHip: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, firingModeHip: Add, Picture, vfiringModeHipImageOff +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeOff%
- Gui, firingModeHip: Add, Picture, vfiringModeHipImageSemi +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeSemi%
- Gui, firingModeHip: Add, Picture, vfiringModeHipImageBurst2 +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeBurst2%
- Gui, firingModeHip: Add, Picture, vfiringModeHipImageBurst1 +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeBurst1%
- Gui, firingModeHip: Add, Picture, vfiringModeHipImageAuto +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeAuto2%
- Gui, firingModeHip: Add, Picture, vfiringModeHipImageDefault +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeAuto1%
- WinSet, TransColor, %UIRGB% 255
- Gui, firingModeADS: Color, %UIRGB% ;ADS Firing Mode
- Gui firingModeADS: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, firingModeADS: Add, Picture, vfiringModeADSImageOff +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeOff%
- Gui, firingModeADS: Add, Picture, vfiringModeADSImageSemi +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeSemi%
- Gui, firingModeADS: Add, Picture, vfiringModeADSImageBurst2 +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeBurst2%
- Gui, firingModeADS: Add, Picture, vfiringModeADSImageBurst1 +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeBurst1%
- Gui, firingModeADS: Add, Picture, vfiringModeADSImageAuto +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeAuto2%
- Gui, firingModeADS: Add, Picture, vfiringModeADSImageDefault +BackgroundTrans X0 Y0 W64 H64, %imgFiringModeAuto1%
- WinSet, TransColor, %UIRGB% 255
- Gui, firingModeHipDark: Color, 0x000000 ; HipFire darkening
- Gui firingModeHipDark: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- WinSet, Transparent, 127
- Gui, firingModeADSDark: Color, 0x000000 ; ADS darkening
- Gui firingModeADSDark: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- WinSet, Transparent, 127
- }
- setRetCoords(){ ;UI - Crosshair - re-calculate crosshair coordinates (f this finnicky ass s)
- if showUI_Ret{
- debugRet()
- CircleB_Outer := "0"
- CircleB_Inner := "0"
- CircleW_Outer := "0"
- CircleW_Inner := "0"
- retLengthOutline := retLength+(retOutline*2)
- retDotOutlineSize := retDotSize+(retDotOutline*2)
- retWidthOutline := retWidth+(retOutline*2)
- U_whiteX :=Round((((GUISizeRet)-retWidth) /2))
- U_whiteY :=Round((((GUISizeRet)-retLength) /2) -(retLength/2) -retGap)
- D_whiteX :=Round((((GUISizeRet)-retWidth) /2))
- D_whiteY :=Round((((GUISizeRet)-retLength) /2) +(retLength/2) +retGap)
- L_whiteX :=Round((((GUISizeRet)-retLength) /2) -(retLength/2) -retGap)
- L_whiteY :=Round((((GUISizeRet)-retWidth) /2))
- R_whiteX :=Round((((GUISizeRet)-retLength) /2) +(retLength/2) +retGap)
- R_whiteY :=Round((((GUISizeRet)-retWidth) /2))
- M_whiteX :=Round((((GUISizeRet)-retDotSize) /2))
- M_whiteY :=Round((((GUISizeRet)-retDotSize) /2))
- U_blackHX :=Round((((GUISizeRet)-retWidth) /2) -retOutline)
- U_blackHY :=Round((((GUISizeRet)-retLength) /2) -(retLength/2) -retGap)
- D_blackHX :=Round((((GUISizeRet)-retWidth) /2) -retOutline)
- D_blackHY :=Round((((GUISizeRet)-retLength) /2) +(retLength/2) +retGap)
- L_blackHX :=Round((((GUISizeRet)-retLength) /2) -(retLength/2) -retGap)
- L_blackHY :=Round((((GUISizeRet)-retWidth) /2) -retOutline)
- R_blackHX :=Round((((GUISizeRet)-retLength) /2) +(retLength/2) +retGap)
- R_blackHY :=Round((((GUISizeRet)-retWidth) /2) -retOutline)
- U_blackVX :=Round((((GUISizeRet)-retWidth) /2))
- U_blackVY :=Round(((((GUISizeRet)-retLength) /2) -(retLength/2) -retGap) -retOutline)
- D_blackVX :=Round((((GUISizeRet)-retWidth) /2))
- D_blackVY :=Round(((((GUISizeRet)-retLength) /2) +(retLength/2) +retGap) -retOutline)
- L_blackVX :=Round(((((GUISizeRet)-retLength) /2) -(retLength/2) -retGap) -retOutline)
- L_blackVY :=Round((((GUISizeRet)-retWidth) /2))
- R_blackVX :=Round(((((GUISizeRet)-retLength) /2) +(retLength/2) +retGap) -retOutline)
- R_blackVY :=Round((((GUISizeRet)-retWidth) /2))
- M_blackHX :=Round((((GUISizeRet)-retDotSize) /2) -retDotOutline)
- M_blackHY :=Round((((GUISizeRet)-retDotSize) /2))
- M_blackVX :=Round((((GUISizeRet)-retDotSize) /2))
- M_blackVY :=Round((((GUISizeRet)-retDotSize) /2) -retDotOutline)
- Circle_UL :=Round((((GUISizeRet) /2) -(retCircleRadius*2)))
- Circle_DR :=Round((((GUISizeRet) /2) +(retCircleRadius*2) +1))
- CircleW_Inner :=Rgn_CreateEllipticRgn(Circle_UL, Circle_UL, Circle_DR, Circle_DR)
- CircleW_Outer_UL :=Circle_UL-Round(retCircleThickness)
- CircleW_Outer_DR :=Circle_DR+Round(retCircleThickness)
- CircleW_Outer :=Rgn_CreateEllipticRgn(CircleW_Outer_UL, CircleW_Outer_UL, CircleW_Outer_DR, CircleW_Outer_DR)
- CircleB_Inner_UL :=Circle_UL+Round(retCircleOutline)
- CircleB_Inner_DR :=Circle_DR-Round(retCircleOutline)
- CircleB_Inner :=Rgn_CreateEllipticRgn(CircleB_Inner_UL, CircleB_Inner_UL, CircleB_Inner_DR, CircleB_Inner_DR)
- CircleB_Outer_UL :=CircleW_Outer_UL-Round(retCircleOutline)
- CircleB_Outer_DR :=CircleW_Outer_DR+Round(retCircleOutline)
- CircleB_Outer :=Rgn_CreateEllipticRgn(CircleB_Outer_UL, CircleB_Outer_UL, CircleB_Outer_DR, CircleB_Outer_DR)
- CircleW_GapTL :=Round(((GUISizeRet)-retCircleGap) /2)
- CircleW_GapBR :=Round(((GUISizeRet)+retCircleGap) /2)
- CircleW_GapV :=Rgn_CreateRectRgn(CircleW_GapTL, 0, CircleW_GapBR, GUISizeRet)
- CircleW_GapH :=Rgn_CreateRectRgn(0, CircleW_GapTL, GUISizeRet, CircleW_GapBR)
- CircleB_GapTL :=CircleW_GapTL+Round(retCircleOutline)
- CircleB_GapBR :=CircleW_GapBR-Round(retCircleOutline)
- CircleB_GapV :=Rgn_CreateRectRgn(CircleB_GapTL, 0, CircleB_GapBR, GUISizeRet)
- CircleB_GapH :=Rgn_CreateRectRgn(0, CircleB_GapTL, GUISizeRet, CircleB_GapBR)
- drawCrosshair()
- }
- return
- }
- drawCrosshair(){ ;Draw the crosshar - Black to White, Cross, Dot, to Circle in that order
- GuiControl, Move, %retUp_blackH%, W%retWidthOutline% H%retLength% X%U_blackHX% Y%U_blackHY%
- GuiControl, Move, %retUp_blackV%, W%retWidth% H%retLengthOutline% X%U_blackVX% Y%U_blackVY%
- GuiControl, Move, %retDown_blackH%, W%retWidthOutline% H%retLength% X%D_blackHX% Y%D_blackHY%
- GuiControl, Move, %retDown_blackV%, W%retWidth% H%retLengthOutline% X%D_blackVX% Y%D_blackVY%
- GuiControl, Move, %retLeft_blackV%, W%retLengthOutline% H%retWidth% X%L_blackVX% Y%L_blackVY%
- GuiControl, Move, %retLeft_blackH%, W%retLength% H%retWidthOutline% X%L_blackHX% Y%L_blackHY%
- GuiControl, Move, %retRight_blackV%, W%retLengthOutline% H%retWidth% X%R_blackVX% Y%R_blackVY%
- GuiControl, Move, %retRight_blackH%, W%retLength% H%retWidthOutline% X%R_blackHX% Y%R_blackHY%
- GuiControl, Move, %retCenter_blackH%, W%retDotOutlineSize% H%retDotSize% X%M_blackHX% Y%M_blackHY%
- GuiControl, Move, %retCenter_blackV%, W%retDotSize% H%retDotOutlineSize% X%M_blackVX% Y%M_blackVY%
- GuiControl, Move, %retUp_white%, W%retWidth% H%retLength% X%U_whiteX% Y%U_whiteY%
- GuiControl, Move, %retDown_white%, W%retWidth% H%retLength% X%D_whiteX% Y%D_whiteY%
- GuiControl, Move, %retLeft_white%, W%retLength% H%retWidth% X%L_whiteX% Y%L_whiteY%
- GuiControl, Move, %retRight_white%, W%retLength% H%retWidth% X%R_whiteX% Y%R_whiteY%
- GuiControl, Move, %retCenter_white%, W%retDotSize% H%retDotSize% X%M_whiteX% Y%M_whiteY%
- Rgn_CombineRgn(CircleB_Outer, CircleB_Outer, CircleB_Inner, 3) ; Circle outline - Cut out inner circle
- Rgn_CombineRgn(CircleB_Outer, CircleB_Outer, CircleB_GapV, 4) ; Circle outline - Cut out vertical gap
- Rgn_CombineRgn(CircleB_Outer, CircleB_Outer, CircleB_GapH, 4) ; Circle outline - Cut out horizontal gap
- Rgn_CombineRgn(CircleW_Outer, CircleW_Outer, CircleW_Inner, 3) ; Circle - Cut out inner circle
- Rgn_CombineRgn(CircleW_Outer, CircleW_Outer, CircleW_GapV, 4) ; Circle - Cut out vertical gap
- Rgn_CombineRgn(CircleW_Outer, CircleW_Outer, CircleW_GapH, 4) ; Circle - Cut out horizontal gap
- Rgn_SetWindowRgn(HWNDCircleB, CircleB_Outer, true) ; Circle outline - Apply shape to window
- Rgn_SetWindowRgn(HWNDCircleW, CircleW_Outer, true) ; Circle - Apply shape to window
- Rgn_DeleteRgn(CircleB_Outer) ; Clear the created regions to free system memory
- Rgn_DeleteRgn(CircleB_Inner)
- Rgn_DeleteRgn(CircleW_Outer)
- Rgn_DeleteRgn(CircleW_Inner)
- Rgn_DeleteRgn(CircleB_GapV)
- Rgn_DeleteRgn(CircleB_GapH)
- Rgn_DeleteRgn(CircleW_GapV)
- Rgn_DeleteRgn(CircleW_GapH)
- return
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; CROSSHAIR CIRCLE DLL CALLS ;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;https://www.autohotkey.com/boards/viewtopic.php?t=30622#p143283
- Rgn_CreateEllipticRgn(Left, Top, Right, Bottom) { ;Create an elipse regoin
- Return DllCall("CreateEllipticRgn", "Int", Left, "Int", Top, "Int", Right, "Int", Bottom, "UPtr")
- }
- Rgn_CreateRectRgn(Left, Top, Right, Bottom) { ;Create a rectangle region
- Return DllCall("CreateRectRgn", "Int", Left, "Int", Top, "Int", Right, "Int", Bottom, "UPtr")
- }
- Rgn_CombineRgn(HRGNC, HRGN1, HRGN2, Mode) { ;Combine regions
- Return DllCall("CombineRgn", "Ptr", HRGNC, "Ptr", HRGN1, "Ptr", HRGN2, "Int", Mode, "Int")
- }
- Rgn_SetWindowRgn(HWND, HRGN, Redraw := True) { ;Set window region
- Return DllCall("SetWindowRgn", "Ptr", HWND, "Ptr", HRGN, "UInt", !!Redraw, "Int")
- }
- ;https://www.autohotkey.com/docs/commands/DllCall.htm#ExStructRect
- Rgn_DeleteRgn(HRGN) { ;Delete selected region to clear system memory
- Return DllCall("DeleteObject", "Ptr", HRGN, "UInt")
- }
- loadUI(){ ;Load the UI
- setTimer, loadUI1, % tick(90)
- return
- }
- loadUI1:
- {
- setTimer, loadUI1, off
- setTimer, loadUI2, % tick(90)
- updateFiringModeHipUI()
- updateFiringModeADSUI()
- retState()
- return
- }
- loadUI2:
- {
- UI_Show()
- UI_forceTop()
- setTimer, loadUI2, off
- return
- }
- checkWindow(){ ;Check to see if the game window is active
- setTimer, checkWindow, % tick(300)
- return
- }
- checkWindow:
- {
- setTimer, checkWindow, Off
- if (WinActive("ironsight")
- OR WinActive("Visual Studio")){
- if !windowSelected{
- windowSelected := "1"
- UI_Show()
- UI_forceTop()
- return
- }
- }
- else{
- windowSelected := "0"
- UI_hide()
- return
- }
- return
- }
- UI_show(){ ;Show the UI
- if (showUI){
- UI_showInputs()
- UI_showRet()
- UI_showFiringModes()
- UI_forceTop()
- }
- return
- }
- UI_showInputs(){ ;Show input overlay
- if showUI_Inputs{
- if showUI_InputBG{
- Gui, inputBGUI: Show,% "W" . scrX . " H" . scrY . " X0 Y0 NoActivate"
- }
- if showUI_Inputs{
- Gui, inputUI: Show,% "W" . scrX . " H" . scrY . " X0 Y0 NoActivate"
- }
- }
- Return
- }
- UI_showRet(){ ;Show reticle: Black to White, Cross, Dot to Circle in that order
- if showUI_Ret{
- if showUI_RetCross{
- Gui retUI_CROSSB: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, retUI_CROSSB: Show,% "W" . GUISizeRet . " H" . GUISizeRet . " X" . (((scrx-(GUISizeRet))/2)+retOffsetX) . " Y" . (((scry-(GUISizeRet))/2)+retOffsetY) . " NoActivate"
- }
- if showUI_RetDot{
- Gui retUI_DOTB: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, retUI_DOTB: Show,% "W" . GUISizeRet . " H" . GUISizeRet . " X" . (((scrx-(GUISizeRet))/2)+retOffsetX) . " Y" . (((scry-(GUISizeRet))/2)+retOffsetY) . " NoActivate"
- }
- if showUI_RetCircle{
- Gui retUI_CIRCLEB: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, retUI_CIRCLEB: Show,% "W" . GUISizeRet . " H" . GUISizeRet . " X" . (((scrx-(GUISizeRet))/2)+retOffsetX) . " Y" . (((scry-(GUISizeRet))/2)+retOffsetY) . " NoActivate"
- }
- if showUI_RetCross{
- Gui retUI_CROSSW: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, retUI_CROSSW: Show,% "W" . GUISizeRet . " H" . GUISizeRet . " X" . (((scrx-(GUISizeRet))/2)+retOffsetX) . " Y" . (((scry-(GUISizeRet))/2)+retOffsetY) . " NoActivate"
- }
- if showUI_RetDot{
- Gui retUI_DOTW: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, retUI_DOTW: Show,% "W" . GUISizeRet . " H" . GUISizeRet . " X" . (((scrx-(GUISizeRet))/2)+retOffsetX) . " Y" . (((scry-(GUISizeRet))/2)+retOffsetY) . " NoActivate"
- }
- if showUI_RetCircle{
- Gui retUI_CIRCLEW: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui, retUI_CIRCLEW: Show,% "W" . GUISizeRet . " H" . GUISizeRet . " X" . (((scrx-(GUISizeRet))/2)+retOffsetX) . " Y" . (((scry-(GUISizeRet))/2)+retOffsetY) . " NoActivate"
- }
- }
- return
- }
- UI_showFiringModes(){ ;Show Firing Modes
- if showUI_firingMode{
- Gui, firingModeHip: Show,W64 H64 X1692 Y869 NoActivate
- Gui, firingModeHipDark: Show,W64 H64 X1692 Y869 NoActivate
- Gui, firingModeADS: Show,W64 H64 X1756 Y869 NoActivate
- Gui, firingModeADSDark: Show,W64 H64 X1756 Y869 NoActivate
- }
- return
- }
- UI_hide(){ ;Hide UI
- UI_hideRet()
- UI_hideInputs()
- UI_hideFiringModes()
- return
- }
- UI_hideRet(){ ;Hide reticle
- Gui retUI_CIRCLEB: hide
- Gui retUI_CROSSB: hide
- Gui retUI_DOTB: hide
- Gui retUI_CIRCLEW: hide
- Gui retUI_CROSSW: hide
- Gui retUI_DOTW: hide
- return
- }
- UI_hideInputs(){ ;Hide Input Overlay
- Gui inputBGUI: hide
- Gui inputUI: hide
- return
- }
- UI_hideFiringModes(){ ;Hide Firing Modes
- Gui firingModeHip: hide
- Gui firingModeADS: hide
- Gui firingModeHipDark: hide
- Gui firingModeADSdark: hide
- }
- UI_forceTop(){ ;Force the UI to render over active window
- Gui retUI_DOTB: +AlwaysOnTop
- Gui retUI_CROSSB: +AlwaysOnTop
- Gui retUI_CIRCLEB: +AlwaysOnTop
- Gui retUI_DOTW: +AlwaysOnTop
- Gui retUI_CROSSW: +AlwaysOnTop
- Gui retUI_CIRCLEW: +AlwaysOnTop
- Gui inputBGUI: +AlwaysOnTop
- Gui inputUI: +AlwaysOnTop
- Gui firingModeHip: +AlwaysOnTop
- Gui firingModeADS: +AlwaysOnTop
- Gui firingModeHipDark: +AlwaysOnTop
- Gui firingModeADSdark: +AlwaysOnTop
- return
- }
- UI_refreshCircle(){ ;Refresh the crosshair circle
- Gui, retUI_CIRCLEB: Show, W1 H1 X1 Y1 NoActivate
- Gui, retUI_CIRCLEW: Show, W1 H1 X1 Y1 NoActivate
- createGUI_retUI_CIRCLEB()
- createGUI_retUI_CIRCLEW()
- Gui retUI_CIRCLEB: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- Gui retUI_CIRCLEW: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- drawCrosshair()
- Gui, retUI_CIRCLEB: Show,% "W" . GUISizeRet . " H" . GUISizeRet . " X" . (((scrx-(GUISizeRet))/2)+retOffsetX) . " Y" . (((scry-(GUISizeRet))/2)+retOffsetY) . " NoActivate"
- Gui, retUI_CIRCLEW: Show,% "W" . GUISizeRet . " H" . GUISizeRet . " X" . (((scrx-(GUISizeRet))/2)+retOffsetX) . " Y" . (((scry-(GUISizeRet))/2)+retOffsetY) . " NoActivate"
- return
- }
- retState(s:=0){ ;Reticle state settings
- aniFrameRate := "1"
- switch s{
- case 1:
- enableRetStateAnimation := "1"
- showUI_RetDot := "1"
- showUI_RetCross := "1"
- showUI_RetCircle := "1"
- aniOnResetShowCross := "1"
- aniOnResetShowDot := "1"
- aniStepsGrow := (36/aniFrameRate)
- aniStepsDecay := (aniStepsGrow/3)
- retGap := "15"
- retLength := "25"
- retWidth := "2"
- retOutline := "1"
- retDotSize := "2"
- retDotOutline := "0"
- retCircleRadius := "14"
- retCircleThickness := "2"
- retCircleOutline := "0"
- retCircleGap := "7"
- aniMaxGap := "40"
- aniMaxLength := "25"
- aniMaxWidth := "2"
- aniMaxOutline := "1"
- aniMaxDotSize := "4"
- aniMaxDotOutline := "1"
- aniMaxCircleRadius := "20"
- aniMaxCircleThickness := "2"
- aniMaxCircleOutline := "1"
- aniMaxCircleGap := "14"
- aniSnapStep := "0.275"
- case 2:
- enableRetStateAnimation := "1"
- showUI_RetDot := "1"
- showUI_RetCross := "1"
- showUI_RetCircle := "1"
- aniOnResetShowCross := "1"
- aniOnResetShowDot := "1"
- aniStepsGrow := (24/aniFrameRate)
- aniStepsDecay := (aniStepsGrow/3)
- retGap := "13"
- retLength := "5"
- retWidth := "2"
- retOutline := "1"
- retDotSize := "2"
- retDotOutline := "0"
- retCircleRadius := "8"
- retCircleThickness := "1"
- retCircleOutline := "0"
- retCircleGap := "5"
- aniMaxGap := "17"
- aniMaxLength := "3"
- aniMaxWidth := "4"
- aniMaxOutline := "1"
- aniMaxDotSize := "2"
- aniMaxDotOutline := "1"
- aniMaxCircleRadius := "10"
- aniMaxCircleThickness := "1"
- aniMaxCircleOutline := "1"
- aniMaxCircleGap := "8"
- aniSnapStep := "0.3"
- default:
- enableRetStateAnimation := "1"
- showUI_RetDot := "1"
- showUI_RetCross := "1"
- showUI_RetCircle := "1"
- aniOnResetShowCross := "1"
- aniOnResetShowDot := "1"
- aniStepsGrow := (24/aniFrameRate)
- aniStepsDecay := (aniStepsGrow/3)
- retGap := "1"
- retLength := "2"
- retWidth := "2"
- retOutline := "1"
- retDotSize := "2"
- retDotOutline := "1"
- retCircleRadius := "5"
- retCircleThickness := "1"
- retCircleOutline := "0"
- retCircleGap := "10"
- aniMaxGap := "2"
- aniMaxLength := "2"
- aniMaxWidth := "4"
- aniMaxOutline := "2"
- aniMaxDotSize := "4"
- aniMaxDotOutline := "2"
- aniMaxCircleRadius := "10"
- aniMaxCircleThickness := "2"
- aniMaxCircleOutline := "1"
- aniMaxCircleGap := "10"
- aniSnapStep := "0.2"
- }
- aniMinGap := retGap
- aniMinLength := retLength
- aniMinWidth := retWidth
- aniMinOutline := retOutline
- aniMinDotSize := retDotSize
- aniMinDotOutline := retDotOutline
- aniMinCircleRadius := retCircleRadius
- aniMinCircleThickness := retCircleThickness
- aniMinCircleOutline := retCircleOutline
- aniMinCircleGap := retCircleGap
- aniRateGrowGap := round((aniMaxGap -retGap) / aniStepsGrow)
- aniRateGrowLength := round((aniMaxLength -retLength) / aniStepsGrow)
- aniRateGrowWidth := round((aniMaxWidth -retWidth) / aniStepsGrow)
- aniRateGrowOutline := round((aniMaxOutline -retOutline) / aniStepsGrow)*8
- aniRateGrowDotSize := round((aniMaxDotSize -retDotSize) / aniStepsGrow)*8
- aniRateGrowDotOutline := round((aniMaxDotOutline -retDotOutline) / aniStepsGrow)*8
- aniRateGrowCircleRadius := round((aniMaxCircleRadius -retCircleRadius) / aniStepsGrow)
- aniRateGrowCircleThickness := round((aniMaxCircleThickness -retCircleThickness) / aniStepsGrow)*8
- aniRateGrowCircleOutline := round((aniMaxCircleOutline -retCircleOutline) / aniStepsGrow)*8
- aniRateGrowCircleGap := round((aniMaxCircleGap -retCircleGap) / aniStepsGrow)*8
- aniRateDecayGap := round((aniMaxGap -retGap) / aniStepsDecay)
- aniRateDecayLength := round((aniMaxLength -retLength) / aniStepsDecay)
- aniRateDecayWidth := round((aniMaxWidth -retWidth) / aniStepsDecay)
- aniRateDecayOutline := round((aniMaxOutline -retOutline) / aniStepsDecay)
- aniRateDecayDotSize := round((aniMaxDotSize -retDotSize) / aniStepsDecay)
- aniRateDecayDotOutline := round((aniMaxDotOutline -retDotOutline) / aniStepsDecay)
- aniRateDecayCircleRadius := round((aniMaxCircleRadius -retCircleRadius) / aniStepsDecay)
- aniRateDecayCircleThickness := round((aniMaxCircleThickness -retCircleThickness) / aniStepsDecay)
- aniRateDecayCircleOutline := round((aniMaxCircleOutline -retCircleOutline) / aniStepsDecay)
- aniRateDecayCircleGap := round((aniMaxCircleGap -retCircleGap) / aniStepsDecay)
- setRetCoords()
- return
- }
- ani_Snap(){ ;Reticle snap animation
- setTimer, ani_Decay, off
- setTimer, ani_Grow, off
- if showUI_RetAnimate
- {
- retAniProgress := (retAniProgress+(aniSnapStep))
- if (retAniProgress >= "1"){
- retAniProgress := "1"
- }
- setTimer, delayDecay, % tick(aniFrameRate)
- }
- return
- }
- easeOutSine(x){ ;https://easings.net/#easeOutSine
- sRetMotion := "Sine Ease Out"
- return (sin((x * PI) / 2))
- }
- easeInOutSine(x){ ;https://easings.net/#easeInOutSine
- sRetMotion := "Sine Ease In/Out"
- return -(cos(PI * x) - 1) / 2
- }
- Rounding(i1,i2) { ;Round i1 by intervals of i2 https://www.autohotkey.com/board/topic/97252-round-by-05/?p=619632
- return, % (i1-(floor(i1/i2)*i2) >= (i2/2)) ? (floor(i1/i2)*i2)+i2 : (floor(i1/i2)*i2)
- }
- ani_Grow(){ ;Reticle grow animation
- if showUI_RetAnimate{
- doneGrow := 0
- showUI_RetCross := 1
- showUI_RetDot := 1
- setTimer, ani_Decay, off
- setTimer, ani_Grow, % tick(aniFrameRate)
- goSub ani_Grow
- }
- return
- }
- delayDecay:
- {
- setTimer, delayDecay, off
- ani_Decay()
- return
- }
- ani_Decay(){ ;Reticle decay animation
- if showUI_RetAnimate{
- doneDecay := 0
- showUI_RetCross := 1
- showUI_RetDot := 1
- setTimer, ani_Grow, off
- setTimer, ani_Decay, % tick(aniFrameRate)
- goSub ani_Decay
- }
- return
- }
- ani_Grow:
- {
- if (retAniProgress >= "1"){
- doneGrow := "1"
- }
- if !doneGrow{
- retAniProgress := (retAniProgress+(1/aniStepsGrow))
- retAniCurved := (easeOutSine(retAniProgress))
- sRetAction := "Grow"
- setRetValues()
- setTimer, ani_Grow, % tick(aniFrameRate)
- }
- if doneGrow{
- retAniProgress := "1"
- retAniCurved := "1"
- setRetValuesMax()
- setTimer, ani_Grow, off
- }
- setRetValues()
- setRetCoords()
- return
- }
- ani_Decay:
- {
- if (retAniProgress <= "0"){
- doneDecay := "1"
- }
- if !doneDecay{
- retAniProgress := (retAniProgress-(1/aniStepsDecay))
- retAniCurved := (easeInOutSine(retAniProgress))
- sRetAction := "Decay"
- setRetValues()
- setTimer, ani_Decay, % tick(aniFrameRate)
- }
- if doneDecay{
- retAniProgress := "0"
- retAniCurved := "0"
- setRetValuesMin()
- setTimer, ani_Decay, off
- }
- setRetCoords()
- return
- }
- setRetValuesMin()
- {
- sRetMotion := "None"
- sRetAction := "None"
- retGap := aniMinGap
- retLength := aniMinLength
- retWidth := aniMinWidth
- retOutline := aniMinOutline
- retDotSize := aniMinDotSize
- retDotOutline := aniMinDotOutline
- retCircleRadius := aniMinCircleRadius
- retCircleThickness := aniMinCircleThickness
- retCircleOutline := aniMinCircleOutline
- retCircleGap := aniMinCircleGap
- }
- setRetValuesMax()
- {
- sRetMotion := "None"
- sRetAction := "None"
- retGap := aniMaxGap
- retLength := aniMaxLength
- retWidth := aniMaxWidth
- retOutline := aniMaxOutline
- retDotSize := aniMaxDotSize
- retDotOutline := aniMaxDotOutline
- retCircleRadius := aniMaxCircleRadius
- retCircleThickness := aniMaxCircleThickness
- retCircleOutline := aniMaxCircleOutline
- retCircleGap := aniMaxCircleGap
- }
- setRetValues(){
- retGap := round(aniMinGap+((aniMaxGap-aniMinGap)*retAniCurved))
- retLength := round(aniMinLength+((aniMaxLength-aniMinLength)*retAniCurved))
- retWidth := Rounding((aniMinWidth+((aniMaxWidth-aniMinWidth)*retAniCurved)), 2)
- retOutline := round(aniMinOutline+((aniMaxOutline-aniMinOutline)*retAniCurved))
- retDotSize := Rounding((aniMinDotSize+((aniMaxDotSize-aniMinDotSize)*retAniCurved)), 2)
- retDotOutline := round(aniMinDotOutline+((aniMaxDotOutline-aniMinDotOutline)*retAniCurved))
- retCircleRadius := Rounding((aniMinCircleRadius+((aniMaxCircleRadius-aniMinCircleRadius)*retAniCurved)), 0.5)
- retCircleThickness := round(aniMinCircleThickness+((aniMaxCircleThickness-aniMinCircleThickness)*retAniCurved))
- retCircleOutline := round(aniMinCircleOutline+((aniMaxCircleOutline-aniMinCircleOutline)*retAniCurved))
- retCircleGap := Rounding((aniMinCircleGap+((aniMaxCircleGap-aniMinCircleGap)*retAniCurved)), 2)
- return
- }
- debugRet(){
- if debugRet{
- updateRetDebugText()
- }
- OutputDebug, CROSSHAIR / RETICULE DEBUG
- OutputDebug, RET DEBUG retAniProgress: %retAniProgress%
- OutputDebug, RET DEBUG retGap: %retGap%
- OutputDebug, RET DEBUG retLength: %retLength%
- OutputDebug, RET DEBUG retWidth: %retWidth%
- OutputDebug, RET DEBUG retOutline: %retOutline%
- OutputDebug, RET DEBUG retDotSize: %retDotSize%
- OutputDebug, RET DEBUG retDotOutline: %retDotOutline%
- OutputDebug, RET DEBUG retCircleRadius: %retCircleRadius%
- OutputDebug, RET DEBUG retCircleThickness: %retCircleThickness%
- OutputDebug, RET DEBUG retCircleOutline: %retCircleOutline%
- OutputDebug, RET DEBUG retCircleGap: %retCircleGap%
- return
- }
- updateInputUI(c:="",s:=""){ ;Update the input key text
- if showUI_Inputs{
- if ((c = "") || (c = UIKeyOff)){
- GuiControl, inputUI: +c%UIKeyOff%, %s%,
- gui, inputUI: color
- }
- else{
- GuiControl, inputUI: +c%c% +Redraw, %s%,
- }
- }
- return
- }
- hideFiringModeHip(){ ;Hide firing mode images - HipFire
- if showUI_firingMode{
- GuiControl, firingModeHip: Hide, firingModeHipImageOff
- GuiControl, firingModeHip: Hide, firingModeHipImageDefault
- GuiControl, firingModeHip: Hide, firingModeHipImageAuto
- GuiControl, firingModeHip: Hide, firingModeHipImageBurst1
- GuiControl, firingModeHip: Hide, firingModeHipImageBurst2
- GuiControl, firingModeHip: Hide, firingModeHipImageSemi
- }
- return
- }
- hideFiringModeADS(){ ;Hide firing mode images - ADS
- if showUI_firingMode{
- GuiControl, firingModeADS: Hide, firingModeADSImageOff
- GuiControl, firingModeADS: Hide, firingModeADSImageDefault
- GuiControl, firingModeADS: Hide, firingModeADSImageAuto
- GuiControl, firingModeADS: Hide, firingModeADSImageBurst1
- GuiControl, firingModeADS: Hide, firingModeADSImageBurst2
- GuiControl, firingModeADS: Hide, firingModeADSImageSemi
- }
- return
- }
- updateFiringModeHipUI(s:="default"){ ;Update the firing mode image - HipFire
- if showUI_firingMode{
- hideFiringModeHip()
- switch s{
- case "default":
- GuiControl, firingModeHip: Show, firingModeHipImageDefault
- case "auto":
- GuiControl, firingModeHip: Show, firingModeHipImageAuto
- case "burst1":
- GuiControl, firingModeHip: Show, firingModeHipImageBurst1
- case "burst2":
- GuiControl, firingModeHip: Show, firingModeHipImageBurst2
- case "semi":
- GuiControl, firingModeHip: Show, firingModeHipImageSemi
- default:
- msgbox ERROR in updateFiringModeHipUI() %firingModeHip%
- }
- }
- return
- }
- updateFiringModeADSUI(s:="default"){ ;Update the firing mode image - ADS
- if showUI_firingMode{
- hideFiringModeADS()
- switch s{
- case "default":
- GuiControl, firingModeADS: Show, firingModeADSImageDefault
- case "auto":
- GuiControl, firingModeADS: Show, firingModeADSImageAuto
- case "burst1":
- GuiControl, firingModeADS: Show, firingModeADSImageBurst1
- case "burst2":
- GuiControl, firingModeADS: Show, firingModeADSImageBurst2
- case "semi":
- GuiControl, firingModeADS: Show, firingModeADSImageSemi
- default:
- msgbox ERROR in updateFiringModeADSUI() %firingModeADS%
- }
- }
- return
- }
- ;;;;;;;;;;;;;;
- ;;INPUT KEYS;;
- ;;;;;;;;;;;;;;
- ~*f8::
- ani_Grow()
- return
- ~*f7::
- ani_Decay()
- return
- f9::
- ;Breakpoint
- OutputDebug, BREAK
- return
- #If WinActive("ahk_exe ironsight.exe")
- {
- *$~LBUTTON::
- gosub firePressed
- return
- *$~LBUTTON up::
- gosub fireReleased
- return
- if showUI_Directionals{ ;WASD directionals
- *$~W::
- updateInputUI(UIKeyOn, "moveForwardText")
- return
- *$~W up::
- updateInputUI(UIKeyOff, "moveForwardText")
- return
- *$~S::
- updateInputUI(UIKeyOn, "moveBackwardText")
- return
- *$~S up::
- updateInputUI(UIKeyOff, "moveBackwardText")
- return
- *$~A::
- updateInputUI(UIKeyOn, "moveLeftText")
- return
- *$~A up::
- updateInputUI(UIKeyOff, "moveLeftText")
- return
- *$~D::
- updateInputUI(UIKeyOn, "moveRightText")
- return
- *$~D up::
- updateInputUI(UIKeyOff, "moveRightText")
- return
- }
- *$~RBUTTON::
- gosub aimPressed
- return
- *$~RBUTTON up::
- gosub aimReleased
- return
- *$~XBUTTON2::
- gosub meleePressed
- return
- *$~XBUTTON2 up::
- gosub meleeReleased
- return
- *$~WHEELUP::
- *$~WHEELDOWN::
- gosub wheelScrolled
- return
- *$~LCTRL::
- gosub pronePressed
- return
- *$~LCTRL up::
- gosub proneReleased
- return
- *$~LSHIFT::
- gosub sprintPressed
- return
- *$~LSHIFT up::
- gosub sprintReleased
- return
- *$~LALT::
- gosub crouchPressed
- return
- *$~LALT up::
- gosub crouchReleased
- return
- *$~TAB::
- gosub tabPressed
- return
- *$~TAB up::
- return
- *$~Space::
- gosub jumpPressed
- return
- *$~Space up::
- gosub jumpReleased
- return
- *$~X::
- gosub firingModePressed
- return
- *$~X up::
- gosub firingModeRelease
- return
- }
- ;;;;;;;;;;;;;;;;;;;
- ;; FIRING SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;;
- firePressed: ;Fire pressed
- {
- if !isHoldingFire{
- isHoldingFire := 1
- switch firingMode{
- case "default":
- goSub fireDefault1
- case "auto":
- goSub fireAuto1
- case "burst1":
- if !isBursting1{
- goSub fireBurst1_1
- }
- case "burst2":
- if !isBursting2{
- goSub fireBurst2_1
- }
- case "semi":
- goSub fireSemi1
- default:
- msgBox ERROR in firePressed() %firingMode%
- }
- if enableAutoMark{
- gosub sendMark1
- }
- }
- return
- }
- fireReleased: ;Fire released
- {
- isHoldingFire := 0
- if !isBursting1{
- updateInputUI(UIKeyOff, "fireText")
- send {insert up}
- ani_Decay()
- }
- setTimer, fireSemi1, off
- setTimer, fireSemi2, off
- setTimer, fireAuto1, off
- setTimer, fireAuto2, off
- return
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;FIRING MODE SELECTION SYSTEM;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- firingModePressed: ;Firing Mode Switch pressed
- {
- if !isHoldingFiringMode{
- isHoldingFiringMode = 1
- cancelFiringMode := 0
- setTimer, resetFiringMode, % tick(20)
- }
- return
- }
- firingModeRelease: ;Firing Mode Switch released
- {
- isHoldingFiringMode := 0
- if !chargedFiringMode{
- if isHoldingAim{
- goSub switchFiringModeADS
- firingMode := firingModeADS
- updateFiringModeADSUI(firingModeADS)
- }
- if !isHoldingAim{
- goSub switchFiringModeHip
- firingMode := firingModeHip
- updateFiringModeHipUI(firingModeHip)
- }
- setTimer, resetFiringMode, off
- }
- if chargedFiringMode{
- firingModeSound := "audio\sound_default.AHK"
- updateFiringModeADSUI(firingModeADS)
- updateFiringModeHipUI(firingModeHip)
- }
- setTimer, playFiringModeSound, % tick(16)
- chargedFiringMode := 0
- return
- }
- switchFiringModeHip: ;Cycle firing modes - HipFire
- {
- switch firingModeHip{
- case "default":
- firingModeSound := "audio\sound_fullauto.AHK"
- firingModeHip := "auto"
- case "auto":
- firingModeSound := "audio\sound_burst.AHK"
- firingModeHip := "burst1"
- case "burst1":
- firingModeSound := "audio\sound_burst.AHK"
- firingModeHip := "burst2"
- case "burst2":
- firingModeSound := "audio\sound_semiauto.AHK"
- firingModeHip := "semi"
- case "semi":
- firingModeSound := "audio\sound_default.AHK"
- firingModeHip := "default"
- default:
- msgbox ERROR in switchFiringModeHip() firingModeHip: %firingModeHip%
- }
- return
- }
- switchFiringModeADS: ;Cycle firing modes - ADS
- {
- switch firingModeADS{
- case "default":
- firingModeSound := "audio\sound_fullauto.AHK"
- firingModeADS := "auto"
- case "auto":
- firingModeSound := "audio\sound_burst.AHK"
- firingModeADS := "burst1"
- case "burst1":
- firingModeSound := "audio\sound_burst.AHK"
- firingModeADS := "burst2"
- case "burst2":
- firingModeSound := "audio\sound_semiauto.AHK"
- firingModeADS := "semi"
- case "semi":
- firingModeSound := "audio\sound_default.AHK"
- firingModeADS := "default"
- default:
- msgbox ERROR in switchFiringModeADS() firingModeADS: %firingModeADS%
- }
- return
- }
- playFiringModeSound: ;Play firing mode switch audio
- {
- run %firingModeSound%
- setTimer, playFiringModeSound, off
- return
- }
- resetFiringMode: ;Reset the firing mode
- {
- if getKeyState("X", "p"){
- chargedFiringMode := 1
- firingMode := "default"
- firingModeHip := "default"
- firingModeADS := "default"
- hideFiringModeHip()
- hideFiringModeADS()
- GuiControl, firingModeHip: Show, firingModeHipImageOff
- GuiControl, firingModeADS: Show, firingModeADSImageOff
- }
- setTimer, resetFiringMode, off
- return
- }
- ;;;;;;;;;;;;;;;;;;
- ;; FIRING MODES ;;
- ;;;;;;;;;;;;;;;;;;
- fireDefault1: ;Default
- {
- send {insert down}
- ani_Grow()
- updateInputUI(UIKeyOn, "fireText")
- return
- }
- fireAuto1: ;Auto Phase 1
- {
- if isHoldingFire{
- send {insert down}
- updateInputUI(UIKeyOn, "fireText")
- ani_Snap()
- setTimer, fireAuto1, off
- setTimer, fireAuto2, % tick()
- return
- }
- else if !isHoldingFire{
- goSub fireReleased
- return
- }
- return
- }
- fireAuto2: ;Auto Phase 2
- {
- if isHoldingFire{
- send {insert up}
- updateInputUI("FF8800", "fireText")
- setTimer, fireAuto2, off
- setTimer, fireAuto1, % tick()
- return
- }
- else if !isHoldingFire{
- gosub fireReleased
- return
- }
- return
- }
- fireBurst1_1: ;Burst Fire 1 phase 1
- {
- isBursting1 := 1
- updateInputUI(UIKeyOn, "fireText")
- send {insert down}
- ani_Grow()
- setTimer, fireBurst1_1, off
- setTimer, fireBurst1_2, % ((tick(burst1Ticks))/burst1FireMax)*2
- setTimer, fireBurst1_3, % ((tick(burst1Ticks))*burst1FireMax)+tick()
- return
- }
- fireBurst1_2: ;Burst Fire 1 phase 2
- {
- updateInputUI("FF8800", "fireText")
- setTimer, fireBurst1_2, off
- setTimer, fireBurst1_2_2, % ((tick(burst1Ticks))/burst1FireMax)*2
- return
- }
- fireBurst1_2_2: ;Burst Fire 1 phase 2 and a half
- {
- updateInputUI(UIKeyOn, "fireText")
- setTimer, fireBurst1_2_2, off
- setTimer, fireBurst1_2, % ((tick(burst1Ticks))/burst1FireMax)*2
- return
- }
- fireBurst1_3: ;Burst Fire 1 phase 3
- {
- isBursting1 := 0
- updateInputUI(UIKeyOff, "fireText")
- if isHoldingFire{
- updateInputUI("FF8800", "fireText")
- }
- send {insert up}
- ani_Decay()
- setTimer, fireBurst1_3, off
- setTimer, fireBurst1_2, off
- setTimer, fireBurst1_2_2, off
- return
- }
- fireBurst2_1: ;Burst Fire 2 phase 1
- {
- isBursting2 := 1
- burst2FireCount ++
- send {insert down}
- updateInputUI(UIKeyOn, "fireText")
- ani_Snap()
- setTimer, fireBurst2_1, off
- setTimer, fireBurst2_2, % tick(burst2Ticks)
- return
- }
- fireBurst2_2: ;Burst Fire 2 phase 2
- {
- send {insert up}
- setTimer, fireBurst2_2, off
- if (burst2FireCount < burst2FireMax){
- updateInputUI("FF8800", "fireText")
- setTimer, fireBurst2_1, % tick(burst2Ticks)
- }
- else if (burst2FireCount >= burst2FireMax){
- burst2FireCount := 0
- isBursting2 := 0
- if isHoldingFire{
- updateInputUI("FF8800", "fireText")
- }
- else if !isHoldingFire{
- updateInputUI(UIKeyOff, "fireText")
- }
- setTimer, fireBurst2_1, off
- }
- return
- }
- fireSemi1: ;Semi Auto phase 1
- {
- if isHoldingFire{
- send {insert down}
- updateInputUI(UIKeyOn, "fireText")
- ani_Snap()
- setTimer, fireSemi2, % tick(2)
- setTimer, fireSemi1, off
- return
- }
- return
- }
- fireSemi2: ;Semi Auto phase 2
- {
- send {insert up}
- if isHoldingFire{
- updateInputUI("FF8800", "fireText")
- setTimer, fireSemi2, off
- }
- return
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; HOLD TO PRONE SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- crouchPressed: ;Crouch pressed
- {
- if !isHoldingCrouch{
- updateInputUI(UIKeyOn, "crouchText")
- isHoldingCrouch := 1
- send {PgUp down}
- if enableHoldToProne{
- setTimer, goProne1, % tick(16)
- }
- }
- goSub jumpReleased
- return
- }
- crouchReleased: ;Crouch released
- {
- isHoldingCrouch := 0
- updateInputUI(UIKeyOff, "crouchText")
- send {PgUp up}
- if !getKeyState("LCtrl", "p"){
- updateInputUI(UIKeyOff, "proneText")
- }
- setTimer, goProne1, off
- setTimer, goProne2, off
- return
- }
- goProne1: ;Go Prone phase 1
- {
- send {PgDn down}
- updateInputUI("FFFF00", "proneText")
- setTimer, goProne2, % tick(4)
- setTimer, goProne1, off
- return
- }
- goProne2: ;Go Prone phase 2
- {
- send {PgDn up}
- updateInputUI("FF8800", "proneText")
- setTimer, goProne1, % tick(4)
- setTimer, goProne2, off
- return
- }
- ;;;;;;;;;;;;;;;;;;
- ;; PRONE SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;
- pronePressed: ;Prone pressed
- {
- if !isHoldingProne{
- isholdingProne := 1
- if enableHoldProne{
- if !isProning{
- updateInputUI(UIKeyOn, "proneText")
- isProning := 1
- goSub proneSpam1
- setTimer, holdToProne, % tick(44)
- }
- }
- else if !enableHoldProne{
- updateInputUI(UIKeyOn, "proneText")
- }
- }
- goSub jumpReleased
- return
- }
- proneReleased: ;Prone released
- {
- isHoldingProne := 0
- if !enableHoldProne{
- updateInputUI(UIKeyOff, "proneText")
- isProning := 0
- return
- }
- if (enableHoldProne && chargedProne && isProning){
- goSub unProneSpam1
- return
- }
- return
- }
- proneSpam1: ;Prone Spam phase 1
- {
- if (proneCount < proneCountMax){
- proneCount++
- updateInputUI(UIKeyOn, "proneText")
- send {PgDn down}
- setTimer, proneSpam2, % tick(2)
- setTimer, proneSpam1, off
- }
- else if (proneCount >= proneCountMax){
- setTimer, proneSpam2, off
- }
- setTimer, proneSpam1, off
- return
- }
- proneSpam2: ;Prone Spam phase 2
- {
- send {PgDn up}
- if (proneCount < proneCountMax){
- updateInputUI("008800", "proneText")
- setTimer, proneSpam1, % tick(2)
- }
- else if (proneCount >= proneCountMax){
- updateInputUI("FF8800", "proneText")
- proneCount := 0
- setTimer, proneSpam1, off
- }
- setTimer, proneSpam2, off
- return
- }
- holdToProne: ;Prone held
- {
- if isholdingProne{
- updateInputUI("FFFF00", "proneText")
- chargedProne := 1
- setTimer, holdToProne, off
- return
- }
- else if !isholdingProne{
- updateInputUI(UIKeyOff, "proneText")
- chargedProne := 0
- isProning := 0
- setTimer, holdToProne, off
- return
- }
- setTimer, holdToProne, off
- return
- }
- unProneSpam1: ;Unprone Spam phase 1
- {
- if (unProneCount < unProneCountMax){
- unProneCount++
- updateInputUI("FF8800", "proneText")
- send {PgUp down}
- setTimer, unproneSpam2, % tick(2)
- }
- else if (unProneCount >= unProneCountMax){
- setTimer, unproneSpam2, off
- }
- setTimer, unproneSpam1, off
- return
- }
- unproneSpam2: ;Unprone Spam phase 2
- {
- updateInputUI("CC6600", "proneText")
- send {PgUp up}
- if (unProneCount < unProneCountMax){
- setTimer, unproneSpam1, % tick(2)
- }
- else if (unProneCount >= unProneCountMax){
- unProneCount := 0
- updateInputUI("FF8800", "proneText")
- setTimer, unproneSpam3, % tick(2)
- }
- setTimer, unproneSpam2, off
- return
- }
- unProneSpam3: ;Unprone Spam phase 3
- {
- updateInputUI(UIKeyOff, "proneText")
- chargedProne := 0
- isProning := 0
- setTimer, unProneSpam1, off
- setTimer, unProneSpam2, off
- setTimer, unProneSpam3, off
- return
- }
- ;;;;;;;;;;;;;;;;;;
- ;; MELEE SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;
- meleePressed: ;Melee pressed
- {
- cancelMelee := 0
- if !isHoldingMelee{
- updateInputUI(UIKeyOn, "meleeText")
- isHoldingMelee := 1
- if enableHoldToMelee{
- setTimer, switchMelee1, % tick(16)
- }
- }
- return
- }
- meleeReleased: ;Melee released
- {
- isHoldingMelee := 0
- updateInputUI(UIKeyOff, "meleeText")
- send {numpad5 up}
- if !cancelMelee{
- if !chargedMelee{
- goSub fastMelee1
- }
- if chargedMelee{
- setTimer, meleeReleasedSwitchBack1, % tick(2)
- }
- }
- chargedMelee := 0
- setTimer, switchMelee1, off
- setTimer, switchMelee2, off
- setTimer, switchMelee3, off
- return
- }
- fastMelee1: ;Fast melee phase 1
- {
- send {numpad4 down}
- setTimer, fastMelee2, % tick(4)
- setTimer, fastMelee1, off
- return
- }
- fastMelee2: ;Fast melee phase 2
- {
- send {numpad4 up}
- setTimer, fastMelee1, off
- setTimer, fastMelee2, off
- return
- }
- switchMelee1: ;Switch to melee weapon phase 1
- {
- updateInputUI("FFFF00", "meleeText")
- chargedMelee := 1
- goSub switchMelee2
- setTimer, switchMelee1, off
- return
- }
- switchMelee2: ;Switch to melee weapon phase 2
- {
- send {numpad5 down}
- setTimer, switchMelee3, % tick(2)
- setTimer, switchMelee2, off
- return
- }
- switchMelee3: ;Switch to melee weapon phase 3
- {
- send {numpad5 up}
- setTimer, switchMelee2, % tick(2)
- setTimer, switchMelee3, off
- return
- }
- meleeReleasedSwitchBack1: ;Switch from melee weapon to previous phase 1
- {
- send {numpad6 down}
- setTimer, meleeReleasedSwitchBack2, % tick(2)
- setTimer, meleeReleasedSwitchBack1, off
- return
- }
- meleeReleasedSwitchBack2: ;Switch from melee weapon to previous phase 2
- {
- send {numpad6 up}
- setTimer, meleeReleasedSwitchBack2, off
- return
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;
- ;; MOUSE WHEEL SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;;;;;;;
- wheelScrolled: ;Mouse Wheel scrolled
- {
- if chargedMelee{
- updateInputUI("CC6600", "meleeText")
- send {numpad5 up}
- cancelMelee := 1
- chargedMelee := 0
- setTimer, switchMelee1, off
- setTimer, switchMelee2, off
- setTimer, switchMelee3, off
- }
- return
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; BUNNY HOPPING SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- jumpPressed: ;Jump pressed
- {
- if !isHoldingJump{
- isHoldingJump := 1
- if enableBHop{
- goSub firstHop1
- setTimer, bHop1, % tick(16)
- setTimer, bHopHUD, % tick(16)
- }
- else if !enableBHop{
- updateInputUI(UIKeyOn, "jumpText")
- send {pause down}
- }
- }
- return
- }
- jumpReleased: ;Jump released
- {
- setTimer, firstHop1, off
- setTimer, firstHop2, off
- setTimer, bHop1, off
- setTimer, bHop2, off
- isHoldingJump := 0
- updateInputUI(UIKeyOff, "jumpText")
- send {space up}
- send {pause up}
- return
- }
- firstHop1: ;Initial Bhop Jump phase 1
- {
- updateInputUI(UIKeyOn, "jumpText")
- send {pause down}
- setTimer, firstHop2, % tick(8)
- setTimer, firstHop1, off
- return
- }
- firstHop2: ;Initial Bhop Jump phase 2
- {
- updateInputUI("FF8800", "jumpText")
- send {pause up}
- setTimer, firstHop2, off
- return
- }
- bHop1: ;Bhop Spam phase 1
- {
- ;updateInputUI("FFFF00", "jumpText")
- send {pause down}
- setTimer, bHop2, % tick()
- setTimer, bHop1, off
- return
- }
- bHop2: ;Bhop Spam phase 2
- {
- send {pause up}
- setTimer, bHop1, % tick()
- setTimer, bHop2, off
- if !getKeyState("Space", "P"){
- goSub jumpReleased
- }
- return
- }
- bHopHUD: ;Bhop HUD
- {
- if getKeyState("Space", "P"){
- updateInputUI("FFFF00", "jumpText")
- }
- setTimer, bHopHUD, off
- return
- }
- ;;;;;;;;;;;;;;;;;;;
- ;; AIMING SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;;
- aimPressed: ;Aim pressed
- {
- if !isHoldingAim{
- isHoldingAim := 1
- if enableAutoBreath{
- send {numpad7 down}
- }
- UI_hideRet()
- retState(2)
- UI_showRet()
- if showUI_firingMode{
- updateInputUI(UIKeyOn, "aimText")
- Gui firingModeADSDark: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- WinSet, Transparent, 0
- Gui firingModeHipDark: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- WinSet, Transparent, 127
- }
- if !chargedFiringMode{
- firingMode := firingModeADS
- }
- }
- goSub jumpReleased
- return
- }
- aimReleased: ;Aim released
- {
- isHoldingAim := 0
- updateInputUI(UIKeyOff, "aimText")
- UI_hideRet()
- retState(1)
- UI_showRet()
- if showUI_firingMode{
- Gui firingModeHipDark: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- WinSet, Transparent, 0
- Gui firingModeADSDark: +LastFound +AlwaysOnTop -Caption +ToolWindow +Disabled +E0x20
- WinSet, Transparent, 127
- }
- send {numpad7 up}
- if !chargedFiringMode{
- firingMode := firingModeHip
- }
- return
- }
- ;;;;;;;;;;;;;;;;;;;
- ;; SPRINT SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;;
- sprintPressed: ;Sprint pressed
- {
- if !isHoldingSprint{
- updateInputUI(UIKeyOn, "sprintText")
- isHoldingSprint := 1
- send {numpad7 down}
- goSub crouchReleased
- goSub proneReleased
- goSub jumpReleased
- proneCount := proneCountMax
- }
- return
- }
- sprintReleased: ;Sprint released
- {
- updateInputUI(UIKeyOff, "sprintText")
- isHoldingSprint := 0
- if !getKeyState("RBUTTON", "p"){
- send {numpad7 up}
- }
- proneCount := 0
- return
- }
- ;;;;;;;;;;;;;;;;;;;;;
- ;; AUTOMARK SYSTEM ;;
- ;;;;;;;;;;;;;;;;;;;;;
- sendMark1: ;Send AutoMark phase 1
- {
- setTimer, sendMark1, off
- if !markOut AND isHoldingAim AND isHoldingFire{
- setTimer, sendMark2, % tick(2)
- markOut := "1"
- send {Q down}
- setTimer, sendMark3, % tick(autoMarkCooldown)
- }
- return
- }
- sendMark2: ;Send AutoMark phase 2
- {
- setTimer, sendMark2, off
- send {Q Up}
- return
- }
- sendMark3: ;Send AutoMark phase 3
- {
- setTimer, sendMark3, off
- markOut := "0"
- if isHoldingAim AND isHoldingFire{
- setTimer, sendMark1, % tick(2)
- }
- }
- ;;;;;;;;;;;;;;;;
- ;; TAB SYSTEM ;;
- ;;;;;;;;;;;;;;;;
- tabPressed: ;Tab pressed
- {
- if getKeyState("LAlt", "p"){
- keywait LAlt
- send {LAlt up}
- reload
- }
- return
- }
- ;;;;;;;;;;;;;;;;;;;
- ;;SCRIPT HANDLING;;
- ;;;;;;;;;;;;;;;;;;;
- Shift & F5:: ;Shift F5 to exit
- keepscript := "Ironsight.ahk"
- for process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process where name = 'Autohotkey.exe' and not CommandLine like '%" keepscript "%' "){
- process, close, % process.ProcessId
- }
- exitapp
- ;#If WinActive("ahk_exe ironsight.exe")
- F5:: ;F5 to refresh
- send {F5}
- reload
- return
- LAlt & Tab:: ;ALT Tab handler
- goSub crouchReleased
- send {blind}{Alt up}
- send {blind}{Tab up}
- send {Alt down}{tab}
- keywait LAlt
- keywait Tab
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement