Advertisement
t3h_m00kz

AutoMark.ahk

Mar 6th, 2022
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Fire and Mark when pressing Left Mouse button or Melee
  2.  
  3. #Include Init.ahk
  4.  
  5. #If WinActive("ahk_exe HaloInfinite.exe")
  6.  
  7. global markLocked
  8.  
  9. ~*XButton2::
  10. ~*LButton::
  11.     Mark()
  12.     return
  13.  
  14. ~*XButton1::
  15. ~*WheelUp::
  16. ~*WheelDown::
  17.     markLocked :=false
  18.     return
  19.  
  20. ;Sends the Mark keypress
  21. Mark(){
  22.     if !markLocked{
  23.         markLocked :=true
  24.        
  25.         Send {Blind}{l down}{l up}
  26.        
  27.         ;First 4-tick loop cannot be interrupted
  28.         loop 4
  29.         {
  30.             sleep 215
  31.         }
  32.        
  33.         ;Second 4-tick loop can be interrupted at each tick interval
  34.         loop 4
  35.         {
  36.             sleep 215
  37.             if !markLocked ; The key has been released, so break out of the loop.
  38.                 break
  39.         }
  40.        
  41.         markLocked :=false
  42.        
  43.     }else{
  44.         return
  45.         }
  46.     return
  47.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement