Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. [SCRIPT]
  2.  
  3. ; Configuration
  4.  
  5. #NoEnv ;Improves performance and compatibility with future AHK updates.
  6. #SingleInstance force ;It allows to run only one at the same time.
  7. SetTitleMatchMode, 2 ;Matching for window title.
  8. #ifwinactive, PLAYERUNKNOWN'S BATTLEGROUNDS ;Active only when in PUBG.
  9.  
  10.  
  11. ; Variables
  12.  
  13. isMouseShown() ;To suspend script when mouse is visible.
  14. ADS = 0 ;Var for fast aiming.
  15. CrouchJump = 1 ;Var for crouch when jumping.
  16. AutoFire = 1 ;Var for autofiring.
  17. Compensation = 1 ;Var for compensation when autofiring.
  18. compVal = 5 ;Compensation value.
  19.  
  20.  
  21. ; Suspends if mouse is visible
  22.  
  23.  
  24. isMouseShown() ;It suspends the script when mouse is visible (map, inventory, menu).
  25. {
  26. StructSize := A_PtrSize + 16
  27. VarSetCapacity(InfoStruct, StructSize)
  28. NumPut(StructSize, InfoStruct)
  29. DllCall("GetCursorInfo", UInt, &InfoStruct)
  30. Result := NumGet(InfoStruct, 8)
  31.  
  32. if Result > 1
  33. Return 1
  34. else
  35. Return 0
  36. }
  37. Loop
  38. {
  39. if isMouseShown() == 1
  40. Suspend On
  41. else
  42. Suspend Off
  43. Sleep 1
  44. }
  45.  
  46. ; Fast Aiming
  47.  
  48.  
  49. *RButton:: ;Fast Aiming [default: Right Button]
  50. if ADS = 1
  51. { ;If active, clicks once and clicks again when button is released.
  52. SendInput {RButton Down}
  53. SendInput {RButton Up}
  54. KeyWait, RButton
  55. SendInput {RButton Down}
  56. SendInput {RButton Up}
  57. } else { ;If not, just keeps holding until button is released.
  58. SendInput {RButton Down}
  59. KeyWait, RButton
  60. SendInput {RButton Up}
  61. }
  62. Return
  63.  
  64.  
  65. ; CrouchJump
  66.  
  67. ~space::c
  68.  
  69. ; AutoFire
  70.  
  71.  
  72. ~$*LButton:: ;AutoFire
  73. if AutoFire = 1
  74. {
  75. Loop
  76. {
  77. GetKeyState, LButton, LButton, P
  78. if LButton = U
  79. Break
  80. MouseClick, Left,,, 1
  81. Gosub, RandomSleep ;Call to RandomSleep.
  82. if Compensation = 1
  83. {
  84. mouseXY(0, compVal) ;If active, call to Compensation.
  85. }
  86. }
  87. }
  88. Return
  89. RandomSleep: ;Random timing between clicks, just in case.
  90. Random, random, 14, 25
  91. Sleep %random%-5
  92. Return
  93.  
  94.  
  95. ; Compensation
  96.  
  97.  
  98. mouseXY(x,y) ;Moves the mouse down to compensate recoil (value in compVal var).
  99. {
  100. DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
  101. }
  102.  
  103.  
  104. ; Tooltips
  105.  
  106.  
  107. ToolTip(label) ;Function to show a tooltip when activating, deactivating or changing values.
  108. {
  109. ToolTip, %label%, 930, 650 ;Tooltips are shown under crosshair for FullHD monitors.
  110. SetTimer, RemoveToolTip, 1300 ;Removes tooltip after 1.3 seconds.
  111. return
  112. RemoveToolTip:
  113. SetTimer, RemoveToolTip, Off
  114. ToolTip
  115. Return
  116. }
  117.  
  118.  
  119. ; Hotkeys for changing values
  120.  
  121.  
  122. ;Toggles
  123. *NumPad1::(ADS = 0 ? (ADS := 1,ToolTip("ADS ON")) : (ADS := 0,ToolTip("ADS OFF")))
  124. *NumPad2::(AutoFire = 0 ? (AutoFire := 1,ToolTip("AutoFire ON")) : (AutoFire := 0,ToolTip("AutoFire OFF")))
  125. *NumPad3::(Compensation = 0 ? (Compensation := 1,ToolTip("Compensation ON")) : (Compensation := 0,ToolTip("Compensation OFF")))
  126. *NumPad0::(CrouchJump = 0 ? (CrouchJump := 1,ToolTip("CrouchJump ON")) : (CrouchJump := 0,ToolTip("CrouchJump OFF")))
  127.  
  128. *NumpadAdd:: ;Adds compensation.
  129. compVal := compVal + 5
  130. ToolTip("Compensation " . compVal)
  131. Return
  132.  
  133. *NumpadSub:: ;Substracts compensation.
  134. if compVal > 0
  135. {
  136. compVal := compVal - 5
  137. ToolTip("Compensation " . compVal)
  138. }
  139. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement