Advertisement
Guest User

CSGO Triggerbot sourcecode 1

a guest
Apr 22nd, 2015
1,066
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.42 KB | None | 0 0
  1. if not A_IsAdmin
  2. {
  3. Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
  4. ExitApp
  5. }
  6.  
  7. config =
  8. (
  9. [MDelaySettings]
  10. mouseDelay=30
  11. minMouseDelay=10
  12. [MButtonSettings]
  13. RButtonEnabled=false
  14. LButtonEnabled=true
  15. [BurstSettings]
  16. BurstFire=false
  17. burst=3
  18. [NoRecoilSettings]
  19. norecoil=false
  20. movedown=2
  21. [CrossHairSettings]
  22. crosshairColor=000000
  23. [VersionInfo]
  24. major=1
  25. minor=8
  26. )
  27.  
  28. IfNotExist c:\AHKScript\config.ini
  29. FileCreateDir, C:\AHKScript
  30. FileAppend %config%, c:\AHKScript\config.ini
  31.  
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  33. ;;; Constants Includes ;;;
  34. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  35. #InstallKeybdHook
  36. #InstallMouseHook
  37. #NoEnv
  38. ;; Version info ;;
  39. major := getIni("c:\AHKScript\config.ini", "VersionInfo", "major")
  40. minor := getIni("c:\AHKScript\config.ini", "VersionInfo", "minor")
  41. version := major "." minor
  42. tfVersion := major " point " minor
  43.  
  44. ini := "c:\AHKScript\config.ini"
  45. ;; TTS ;;
  46. ttsEnabled = true
  47. ttsVol = 100
  48.  
  49. SetWinDelay 0
  50. Coordmode Mouse, Screen
  51. OldX := -1, OldY := -1
  52.  
  53. ;;;;;;;;;;;;;;;;;
  54. ;;; Functions ;;;
  55. ;;;;;;;;;;;;;;;;;
  56. SAPI := ComObjCreate("SAPI.SpVoice")
  57. SAPI.volume := 100
  58.  
  59. say(msg) { ;Text to speech using integrated COM
  60. global ttsEnabled
  61. if(ttsEnabled == "true") {
  62. global SAPI
  63. SAPI.speak(msg,1)
  64. }
  65. }
  66.  
  67. MouseMoveDown(movedownRate) {
  68. MouseGetPos x, y
  69. MouseMove x, y+movedownRate
  70. }
  71.  
  72. getIni(config, section, key) {
  73. IniRead value, %config%, %section%, %key%
  74. return value
  75. }
  76.  
  77. OldX := -1, OldY := -1
  78.  
  79. ID1 := Box(1,1,A_ScreenHeight)
  80. ID2 := Box(2,A_ScreenWidth,1)
  81.  
  82. Box(n,w,h) { ;;By Lazslo from autohotkey.com
  83. Gui %n%:-Caption +ToolWindow +E0x20 ; No title bar, No taskbar button, Transparent for clicks
  84. Gui %n%: Show, X0 Y0 W%w% H%h% ; Show it
  85. cColor := getIni("config.ini", "CrossHairSettings", "crosshairColor")
  86. Gui 1:Color, %cColor%
  87. Gui 2:Color, %cColor%
  88. WinGet ID, ID, A ; ...with HWND/handle ID
  89. Winset AlwaysOnTop,ON,ahk_id %ID% ; Keep it always on the top
  90. WinSet Transparent,255,ahk_id %ID% ; Opaque
  91. Return ID
  92. }
  93.  
  94. RGBtoHEX(R, G, B) {
  95. SetFormat, integer, hex
  96. R += 0 ; Convert from decimal to hex.
  97. G += 0
  98. B += 0
  99. RGB := (R*0x10000) + (G*0x100) + (B*0x1)
  100. return %RGB%
  101. }
  102.  
  103. ;;;;;;;;;;;;;;;;;;;;;;;
  104. ;;; Startup message ;;;
  105. ;;;;;;;;;;;;;;;;;;;;;;;
  106. welcomeMsg = Universal Rapid Fire version %tfVersion% has finished loading. You can get help by pressing CONTROL PLUS SHIFT PLUS H
  107. say(welcomeMsg) ;Loading message
  108.  
  109. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  110. ;;; Variables and configuration ;;;
  111. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  112. ;; Mouse delay settings ;;
  113. mouseDelay := getIni("c:\AHKScript\config.ini", "MDelaySettings", "mouseDelay")
  114. minMouseDelay := getIni("c:\AHKScript\config.ini", "MDelaySettings", "minMouseDelay")
  115. ;; Mouse button settings ;;
  116. RButtonEnabled := getIni("c:\AHKScript\config.ini", "MButtonSettings", "RButtonEnabled")
  117. LButtonEnabled := getIni("c:\AHKScript\config.ini", "MButtonSettings", "LButtonEnabled")
  118. ;; Burst settings ;;
  119. BurstFire := getIni("c:\AHKScript\config.ini", "BurstSettings", "BurstFire")
  120. burst := getIni("c:\AHKScript\config.ini", "BurstSettings", "burst")
  121. ;; No recoil settings ;;
  122. norecoil := getIni("c:\AHKScript\config.ini", "NoRecoilSettings", "norecoil")
  123. movedown := getIni("c:\AHKScript\config.ini", "NoRecoilSettings", "movedown")
  124. ;; Crosshair settings ;;
  125. crosshairColor := getIni("c:\AHKScript\config.ini", "CrossHairSettings", "crosshairColor")
  126.  
  127. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  128. ;;; Application settings ;;;
  129. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  130. ^+s:: ;Temporarily suspends the application
  131. Suspend, Toggle
  132. return
  133.  
  134. ^+e:: ;Exits the application
  135. GoSub ExitSub
  136. return
  137.  
  138. !+s:: ;Toggle TTS
  139. if(ttsEnabled == "false") {
  140. ttsEnabled = true
  141. say("Text to speech has been enabled")
  142. } else {
  143. say("Text to speech has been disabled")
  144. ttsEnabled = false
  145. }
  146. return
  147.  
  148.  
  149. ^+RButton::
  150. if(RButtonEnabled == "false") {
  151. RButtonEnabled = true
  152. say("Right mouse button is now rapid fire enabled")
  153. } else {
  154. RBUttonEnabled = false
  155. say("Right mouse button is now rapid fire disabled")
  156. }
  157. return
  158.  
  159. ^+LButton::
  160. if(LButtonEnabled == "false") {
  161. LButtonEnabled = true
  162. say("Left mouse button is now rapid fire enabled")
  163. } else {
  164. LBUttonEnabled = false
  165. say("Left mouse button is now rapid fire disabled")
  166. }
  167. return
  168.  
  169. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  170. ;;; Mouse delay settings ;;;
  171. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  172. ^+d:: ;Says the current mouse delay
  173. msg = Your current mouse delay is %mouseDelay%.
  174. say(msg)
  175. return
  176.  
  177. ^+up:: ;Increase the mouse delay
  178. mouseDelay := mouseDelay + 10
  179. return
  180.  
  181. ^+down:: ;Decrease the mouse delay
  182. if(mouseDelay > minMouseDelay) {
  183. mouseDelay := mouseDelay - 10
  184. } else {
  185. msg = The mouse delay cannot go below %minMouseDelay%.
  186. say(msg)
  187. }
  188. return
  189.  
  190. ;;;;;;;;;;;;;;;;;;;;;;
  191. ;;; Burst settings ;;;
  192. ;;;;;;;;;;;;;;;;;;;;;;
  193. ^+b:: ;Toggles burst fire (x-shots/30ms)
  194. if(BurstFire == "false") {
  195. BurstFire = true
  196. } else {
  197. BurstFire = false
  198. }
  199. return
  200.  
  201. !+b:: ;Says the current burst amount
  202. msg = Your current burst amount is %burst%.
  203. say(msg)
  204. return
  205.  
  206. !+up:: ;Increase burst amount
  207. burst := burst + 1
  208. return
  209.  
  210. !+down:: ;Decrease burst amount
  211. if(burst > 1) {
  212. burst := burst - 1
  213. } else {
  214. msg = The burst amount cannot go below 1
  215. say(msg)
  216. }
  217. return
  218.  
  219. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  220. ;;; No recoil settings ;;;
  221. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  222. ^+n::
  223. if(norecoil == "false") {
  224. norecoil = true
  225. say("No recoil has been enabled")
  226. } else {
  227. norecoil = false
  228. say("No recoil has been disabled")
  229. }
  230. return
  231.  
  232. ^+m::
  233. msg = No recoil: %movedown%
  234. say(msg)
  235. return
  236.  
  237. #+up::
  238. movedown := movedown + 1
  239. return
  240.  
  241. #+down::
  242. movedown := movedown - 1
  243. return
  244.  
  245. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  246. ;;; Crosshair settings ;;;
  247. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  248. ^+c:: ;Toggles crosshair
  249. If OldX = -1
  250. SetTimer crosshair, 1
  251. Else
  252. {
  253. SetTimer crosshair, Off
  254. Gui 1: Show, X0 Y0
  255. Gui 2: Show, X0 Y0
  256. ToolTip
  257. OldX := -1, OldY := -1
  258. }
  259. return
  260.  
  261. #+c:: ;Crosshair color
  262. InputBox, R, Color selection, Please enter the amount of red to use
  263. InputBox, G, Color selection, Please enter the amount of green to use
  264. InputBox, B, Color selection, Please enter the amount of blue to use
  265.  
  266. crosshairColor := RGBtoHEX(R, G, B)
  267.  
  268. Gui 1:Color, %crosshairColor%
  269. Gui 2:Color, %crosshairColor%
  270. msgbox The crosshair color has been changed to %crosshairColor%
  271. return
  272.  
  273. ;;;;;;;;;;;;;;;;;;;;;;
  274. ;;; Misc. commands ;;;
  275. ;;;;;;;;;;;;;;;;;;;;;;
  276. ^+h::
  277. Run, http://www.autohotkey.com/forum/viewtopic.php?p=477703#477703
  278. return
  279.  
  280. ;;;;;;;;;;;;;;;;;;;;
  281. ;;; Key bindings ;;;
  282. ;;;;;;;;;;;;;;;;;;;;
  283. ^+MButton:: ;Make a 360 degree turn (lol trick shots)
  284. MouseGetPos x, y
  285. MouseMove X+790, Y
  286. return
  287.  
  288.  
  289. #if LButtonEnabled == "true"
  290. ~$LButton:: ;Left mouse button rapid fire
  291. if(BurstFire == "false") {
  292. Loop {
  293. SetMouseDelay mouseDelay
  294. Click
  295. if (norecoil == "true")
  296. MouseMoveDown(movedown)
  297. if (GetKeyState("LButton", "P")=0)
  298. break
  299. }
  300. } else {
  301. Loop %burst% {
  302. Click
  303. Sleep 30
  304. }
  305. Sleep 300
  306. }
  307. return
  308.  
  309. #if RButtonEnabled == "true"
  310. ~$RButton:: ;Right mouse button rapid fire
  311. if(BurstFire == "false") {
  312. Loop {
  313. SetMouseDelay mouseDelay
  314. Click right
  315. if (norecoil == "true")
  316. MouseMoveDown(movedown)
  317. if (GetKeyState("RButton", "P")=0)
  318. break
  319. }
  320. } else {
  321. Loop %burst% {
  322. Click right
  323. Sleep 30
  324. }
  325. Sleep 300
  326. }
  327. return
  328.  
  329. crosshair:
  330. MouseGetPos RulerX, RulerY
  331. If (OldX <> RulerX) {
  332. OldX := RulerX
  333. WinMove ahk_id %ID1%,, %RulerX%
  334. }
  335. If (OldY <> RulerY) {
  336. OldY := RulerY
  337. WinMove ahk_id %ID2%,,,%RulerY%
  338. }
  339. Return
  340.  
  341. #Persistent
  342. OnExit, ExitSub
  343. return
  344.  
  345. ExitSub:
  346. IniWrite %mouseDelay%, c:\AHKScript\config.ini, MDelaySettings, mouseDelay
  347. IniWrite %minMouseDelay%, c:\AHKScript\config.ini, MDelaySettings, minMouseDelay
  348. IniWrite %RButtonEnabled%, c:\AHKScript\config.ini, MButtonSettings, RButtonEnabled
  349. IniWrite %LButtonEnabled%, c:\AHKScript\config.ini, MButtonSettings, LButtonEnabled
  350. IniWrite %BurstFire%, c:\AHKScript\config.ini, BurstSettings, BurstFire
  351. IniWrite %burst%, c:\AHKScript\config.ini, BurstSettings, burst
  352. IniWrite %norecoil%, c:\AHKScript\config.ini, NoRecoilSettings, norecoil
  353. IniWrite %movedown%, c:\AHKScript\config.ini, NoRecoilSettings, movedown
  354. IniWrite %crosshairColor%, c:\AHKScript\config.ini, crosshairSettings, CrosshairColor
  355. IniWrite %VersionInf%, c:\AHKScript\config.ini, VersionInf, ver
  356. ExitApp
  357. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement