Advertisement
Guest User

Untitled

a guest
Mar 13th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn ; Enable warnings to assist with detecting common errors.
  3. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  5. #NoEnv
  6. SendMode, Input
  7. SetBatchLines -1
  8. CoordMode, Mouse, Screen
  9.  
  10. mouseXY(x, y)
  11. {
  12. DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
  13. }
  14.  
  15. strafe(left)
  16. {
  17. moveCount := 22
  18. sleepInterval := 2
  19. relativeMove := 25
  20.  
  21. if (left)
  22. {
  23. key := "d"
  24. move := relativeMove
  25. } else
  26. {
  27. key := "a"
  28. move := -relativeMove
  29. }
  30. send {%key% down}
  31. DllCall("Sleep", "UInt", 5)
  32. Loop, %moveCount%
  33. {
  34. mouseXY(move, -(move/4))
  35. DllCall("Sleep", "UInt", sleepInterval)
  36. }
  37. send {%key% up}
  38. }
  39.  
  40. $xbutton1::
  41. while getkeystate("xbutton1","P")
  42. {
  43. strafe(true)
  44. strafe(false)
  45. }
  46. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement