Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #IfWinActive, Diablo II ahk_class Diablo II
- global Stop := 0 ;Variables defined within functions will only exist within that function
- global Wait := 0 ;Global variables are shared between functions
- Numpad1::Start() ;
- Numpad2::Stop() ;Was this meant to intentionally be a reload or just a stop?
- Numpad4::Exit ;I assume you had this here as a kill-switch so I left it
- Start() {
- Stop++ ;Adds 1 to Stop
- While(Stop > 0) && (WinActive("Diablo II")){ ;Will continue looping while Stop is greater than 0 and Diablo II is the active window
- While(Wait = 0) && (Stop > 0) && (WinActive("Diablo II")){ ;If Wait does not equal 0, Stop is greater than 0, or Diablo II isn't the active window, this block is skipped, we return to the first "While"
- Send, {F10}
- Click, Right
- Sleep 800
- Send, {F11}
- Click, Right
- Sleep 800
- Send, {F12}
- Click, Right
- ;Sleep 150
- ;Send, {F9} ;Remove the semicolon before "Send" and "Sleep" to un-comment this line and restore fuctionality
- Wait++ ;Adds 1 to Wait, so this block no longer fires
- Wait() ;Begins the Wait() function
- }
- }
- }
- Wait() { ;This is in a separate function to allow the While(Stop > 0) loop to continue
- Sleep 17000 ;17 seconds to allow the cooldowns to fully finish, can be configured to your liking
- Wait := 0 ;Returns Wait to 0, allowing the block checking for it in Start() to function again
- }
- Stop() {
- Stop := 0 ;Returns the Stop variable to 0, thereby ending the loop
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement