Advertisement
Guest User

wow

a guest
Jan 15th, 2019
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv                       ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. SendMode Input               ; Recommended for new scripts due to its superior speed and reliability.
  3. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  4. ;#MaxThreads 2
  5. ;SetKeyDelay, 5, 5
  6. HotKey, LButton, Off
  7. HotKey, RButton, Off
  8. $LButton::SpamKey("-")
  9. $RButton::SpamKey("f|3|4")
  10.  
  11. breakout:=false
  12. mouseLook:=false
  13.  
  14. ^!r::Reload
  15. $Pause::Suspend, Off
  16. !Pause::Suspend, On
  17. *mbutton::breakout=true
  18.  
  19. SpamKey2(list,hotkey)
  20. {
  21.     Hotkey:=RegExReplace(hotkey,"^(\w* & |\W*)")
  22.     IfWinActive, ahk_class GxWindowClass
  23.     {
  24.         stringsplit, list, list,`|
  25.         Counter:=0
  26.         global breakout:=false
  27.         While, true {
  28.             If (breakout)
  29.             {
  30.                 break
  31.             }
  32.             Counter:=(Counter=list0) ? (1) : (Counter+1)
  33.             key:=% list%counter%
  34.         Send,{Blind}%key%
  35.             ;Send % list%counter%
  36.             Sleep 60
  37.         }
  38.         Return
  39.     }
  40.     Else
  41.     {
  42.         Send {Blind}{%Hotkey%}
  43.         Return
  44.     }
  45. }
  46. SpamKey(list)
  47. {
  48.     Hotkey:=RegExReplace(A_ThisHotkey,"^(\w* & |\W*)")
  49.     IfWinActive, ahk_class GxWindowClass
  50.     {
  51.         stringsplit, list, list,`|
  52.         Counter:=0
  53.         global breakout2:=false
  54.         While, GetKeyState(Hotkey, "p") {
  55.             If (breakout2)
  56.             {
  57.                 break
  58.             }
  59.             Counter:=(Counter=list0) ? (1) : (Counter+1)
  60.             key:=% list%counter%
  61.             Send,{Blind}%key%
  62.             Sleep 60
  63.         }
  64.         Return
  65.     }
  66.     Else
  67.     {
  68.         Send {Blind}{%Hotkey%}
  69.         Return
  70.     }
  71. }
  72.  
  73. #IfWinActive, ahk_class GxWindowClass
  74.     *1::SpamKey("1")
  75.     *2::SpamKey("2")
  76.     *3::SpamKey("3")
  77.     *4::SpamKey("4")
  78.     *f::SpamKey("f|4")
  79.     *r::SpamKey("r")
  80.  
  81.     $`::
  82.     If (mouseLook)
  83.     {
  84.         Send {RButton up}
  85.         mouseLook:=false
  86.         HotKey, LButton, Off
  87.         HotKey, RButton, Off
  88.         Return
  89.     }
  90.     Else
  91.     {
  92.         Send {RButton Down}
  93.         mouseLook:=true
  94.         HotKey, LButton, On
  95.         HotKey, RButton, On
  96.         Return
  97.     }
  98.     Return
  99.  
  100.     $Esc::
  101.         if (breakout)
  102.         {
  103.             Send {Escape}
  104.         }
  105.         breakout:=true
  106.    
  107.         if(mouseLook)
  108.         {
  109.             Send {RButton up}
  110.             mouseLook:=false
  111.             HotKey, LButton, Off
  112.             HotKey, RButton, Off
  113.         }
  114.     Return
  115.  
  116.     ~RButton & LButton::
  117.         SpamKey2("-", "LButton")
  118.     Return
  119.  
  120. ;flag return spam
  121. ;~$LButton::
  122. ;    While GetKeyState("LButton","P"){
  123. ;        Click
  124. ;        Sleep 50  ;  milliseconds
  125. ;    }
  126. ;return
  127.  
  128.  #IfWinActive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement