Advertisement
Guest User

AHK Strafe

a guest
Aug 11th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #NoEnv
  2. SendMode, Input
  3. SetBatchLines -1
  4. CoordMode, Mouse, Screen
  5.  
  6. mouseXY(x, y){
  7. DllCall("mouse_event",uint,1,int,x,int,y­,uint,0,int,0)
  8. }
  9.  
  10. strafe(left){
  11. moveCount := 20
  12. sleepInterval := 1
  13. relativeMove := 20
  14. if(left){
  15. key := "a"
  16. move := -relativeMove
  17. } else {
  18. key := "d"
  19. move := relativeMove
  20. }
  21. Send, {Blind}{%key% down}
  22. DllCall("Sleep", "UInt", 5)
  23. Loop, %moveCount% {
  24. mouseXY(move, 0)
  25. DllCall("Sleep", "UInt", sleepInterval)
  26. }
  27. Send, {Blind}{%key% up}
  28. }
  29.  
  30. *XButton1::
  31. while getkeystate("XButton1","P") {
  32. strafe(false)
  33. strafe(true)
  34. }
  35. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement