Guest User

Untitled

a guest
Oct 9th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #NoEnv
  2. SendMode, Input
  3. SetBatchLines -1
  4. CoordMode, Mouse, Screen
  5. ; Note: remove ; on BlockInputs if you want to prevent user mouse movements while using hotkeys.
  6.  
  7. mouseXY(x, y)
  8. {
  9. DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
  10. }
  11. strafe(left)
  12. {
  13. moveCount := 10
  14. sleepInterval := 2
  15. relativeMove := 15
  16.  
  17. if (left)
  18. {
  19. key := "p"
  20. move := -relativeMove
  21. }
  22. else
  23. {
  24. key := "o"
  25. move := relativeMove
  26. }
  27. send {%key% down}
  28. DllCall("Sleep", "UInt", 5)
  29. Loop, %moveCount%
  30. {
  31. mouseXY(move, 0)
  32. DllCall("Sleep", "UInt", sleepInterval)
  33. }
  34. send {%key% up}
  35. }
  36. $XButton2::
  37. while getkeystate("XButton2","P")
  38. {
  39. strafe(false)
  40. strafe(true)
  41. }
  42. return
Add Comment
Please, Sign In to add comment