Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance force ;force a single instance
- #HotkeyInterval 0 ;disable the warning dialog if a key is held down
- #InstallKeybdHook ;Forces the unconditional installation of the keyboard hook
- #UseHook On ;might increase responsiveness of hotkeys
- #MaxThreads 20 ;use 20 (the max) instead of 10 threads
- SetBatchLines, -1 ;makes the script run at max speed
- SetKeyDelay , -1, -1 ;faster response (might be better with -1, 0)
- ;Thread, Interrupt , -1, -1 ;not sure what this does, could be bad for timers
- SetTitleMatchMode, 3 ;title Warcraft III must match exactly
- SetDefaultMouseSpeed, 0 ;Move the mouse faster for mouse moving commands
- IfExist, Warcraft III.ico
- menu, tray, Icon, Warcraft III.ico, 1, 1
- ;;;;;;;;;;;;;;;;;;;
- ; Setup Variables ;
- ;;;;;;;;;;;;;;;;;;;
- bInChatRoom := False
- bHealthBarOn := False
- Return ; End Auto-Execute Section
- sleeptime = 150
- CurrentBallVar = 0
- ;;;;;;;;;;;;;;;;;;;;
- ;AutoCast Function ;
- ;;;;;;;;;;;;;;;;;;;;
- AutoCast(iSpellQWERHotkey)
- {
- MouseGetPos, iMousePosX, IMousePosY
- if (iSpellQWERHotkey == 1)
- {
- iMouseGotoX := A_ScreenWidth*4//5
- iMouseGotoY := A_ScreenHeight*4//5
- }
- else if (iSpellQWERHotkey == 2)
- {
- iMouseGotoX := A_ScreenWidth*4//5
- iMouseGotoY := A_ScreenHeight*22//25
- }
- else if (iSpellQWERHotkey == 3)
- { iMouseGotoX := A_ScreenWidth*4//5
- iMouseGotoY := A_ScreenHeight*19//20
- }
- else if (iSpellQWERHotkey == 4)
- {
- iMouseGotoX := A_ScreenWidth*17//20
- iMouseGotoY := A_ScreenHeight*4//5
- }
- else if (iSpellQWERHotkey == 5)
- {
- iMouseGotoX := A_ScreenWidth*17//20
- iMouseGotoY := A_ScreenHeight*22//25
- }
- else if (iSpellQWERHotkey == 6)
- {
- iMouseGotoX := A_ScreenWidth*17//20
- iMouseGotoY := A_ScreenHeight*19//20
- }
- else if (iSpellQWERHotkey == 7)
- {
- iMouseGotoX := A_ScreenWidth*9//10
- iMouseGotoY := A_ScreenHeight*4//5
- }
- else if (iSpellQWERHotkey == 8)
- {
- iMouseGotoX := A_ScreenWidth*9//10
- iMouseGotoY := A_ScreenHeight*22//25
- }
- else if (iSpellQWERHotkey == 9)
- {
- iMouseGotoX := A_ScreenWidth*9//10
- iMouseGotoY := A_ScreenHeight*19//20
- }
- else if (iSpellQWERHotkey == 10)
- {
- iMouseGotoX := A_ScreenWidth*19//20
- iMouseGotoY := A_ScreenHeight*4//5
- }
- else if (iSpellQWERHotkey == 11)
- {
- iMouseGotoX := A_ScreenWidth*19//20
- iMouseGotoY := A_ScreenHeight*22//25
- }
- else if (iSpellQWERHotkey == 12)
- {
- iMouseGotoX := A_ScreenWidth*19//20
- iMouseGotoY := A_ScreenHeight*19//20
- }
- Click, Right, %iMouseGotoX%, %iMouseGotoY%
- MouseMove, %iMousePosX%, %iMousePosY%
- }
- #ifWinActive, Warcraft III ahk_class Warcraft III
- #UseHook On
- ;;;;;;;;;;;;;;;
- ;Hotkey Setup ;
- ;;;;;;;;;;;;;;;
- *Numlock:: NextBall()
- *numpad1:: PrepColdSnap()
- *numpad2:: PrepGhost()
- *numpad3:: PrepIceWall()
- *numpad4:: PrepTornado()
- *numpad5:: PrepEMP()
- *numpad6:: PrepAlacrity()
- *numpad7:: PrepMeteor()
- *numpad8:: PrepSunStrike()
- *numpad9:: PrepForge()
- *numpad0:: PrepBlast()
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Get Color of Invoke Skill ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- GetInvokeColor()
- {
- global
- retries = 0
- ;; Retries because sometimes it tries to pick the color
- ;; too fast, and gets simply "black"
- while (retries < 14)
- {
- retries++
- if (retries < 3)
- {
- PixelGetColor, invokeColor, x4, y3, Alt
- }
- else
- {
- PixelGetColor, invokeColor, x4, y3, Slow
- Sleep, 30
- }
- if (invokeColor != 0000)
- break
- }
- ;; This is some of my MAGIC
- ;; Once I built this code, I got correct spells
- ;; nearly EVERY try.
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Invoke Spell - Update Vars ;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- DoInvoke(spellId)
- {
- global
- GetInvokeColor()
- beforeInvoke := invokeColor
- sendPlay r
- Sleep, %sleeptime%
- GetInvokeColor()
- afterInvoke := invokeColor
- if (beforeInvoke != afterInvoke)
- {
- ;Assume Success
- invokeSuccess := true
- ;Rotate Current Invoked Spell
- SecondInvokeSpell := FirstInvokeSpell
- FirstInvokeSpell := spellId
- }
- else
- {
- invokeSuccess := false
- }
- }
- ;;;;;;;;;;;;;;;;;;;;;;;
- ; To INVOKE the spell ;
- ;;;;;;;;;;;;;;;;;;;;;;;
- PrepBlast() ;; Spell ID 1
- {
- SendPlay q
- SendPlay w
- SendPlay e
- DoInvoke(1)
- CurrentBall()
- }
- PrepMeteor() ;; Spell ID 2
- {
- SendPlay {e 2}
- SendPlay w
- DoInvoke(2)
- CurrentBall()
- }
- PrepIceWall() ;; Spell ID 3
- {
- SendPlay {q 2}
- SendPlay e
- DoInvoke(3)
- CurrentBall()
- }
- PrepEMP() ;; Spell ID 4
- {
- SendPlay {w 3}
- DoInvoke(4)
- CurrentBall()
- }
- PrepForge() ;; Spell ID 5
- {
- SendPlay {e 2}
- SendPlay q
- DoInvoke(5)
- CurrentBall()
- }
- PrepGhost() ;; Spell ID 6
- {
- SendPlay {q 2}
- SendPlay w
- DoInvoke(6)
- SendPlay {w 3}
- }
- PrepSunStrike() ;; Spell ID 7
- {
- SendPlay {e 3}
- DoInvoke(7)
- CurrentBall()
- }
- PrepTornado() ;; Spell ID 8
- {
- SendPlay {w 2}
- SendPlay q
- DoInvoke(8)
- CurrentBall()
- }
- PrepAlacrity() ;; Spell ID 9
- {
- SendPlay {w 2}
- SendPlay e
- DoInvoke(9)
- CurrentBall()
- }
- PrepColdSnap() ;; Spell ID 10
- {
- SendPlay {q 3}
- DoInvoke(10)
- CurrentBall()
- }
- ;;;;;;;;;;;;;;;;;;;;;;;;
- ; Power Ball Selection ;
- ;;;;;;;;;;;;;;;;;;;;;;;;
- ; 0 - Quas ;
- ; 1 - Wex ;
- ; 2 - Exort ;
- ;;;;;;;;;;;;;;;;;;;;;;;;
- CurrentBall()
- {
- ;;Used when a spell is cast.
- global
- if (CurrentBallVar = 0)
- {
- SendPlay {q 3}
- }
- else if (CurrentBallVar = 1)
- {
- SendPlay {w 3}
- }
- else if (CurrentBallVar = 2)
- {
- SendPlay {e 3}
- }
- }
- NextBall()
- {
- global
- if (CurrentBallVar = 0)
- {
- SetWex()
- }
- else if (CurrentBallVar = 1)
- {
- SetExort()
- }
- else if (CurrentBallVar = 2)
- {
- SetQuas()
- }
- }
- SetQuas()
- {
- global
- CurrentBallVar = 0
- SendPlay {q 3}
- }
- SetWex()
- {
- global
- CurrentBallVar = 1
- SendPlay {w 3}
- }
- SetExort()
- {
- global
- CurrentBallVar = 2
- SendPlay {e 3}
- }
- ;;;;;;;;;;;;;;;;;;;;;;;
- ; APM SPAMMER ;
- ;;;;;;;;;;;;;;;;;;;;;;;
- <::
- Loop 30
- {
- Send {RButton}
- Send {RButton}
- }
- return
- ;;;;;;;;;;;;;;;;;;;;;;;
- ; Other ;
- ;;;;;;;;;;;;;;;;;;;;;;;
- *ScrollLock::
- Suspend, Permit
- bInChatRoom := not bInChatRoom
- if (bInChatRoom == True)
- {
- Suspend, On
- }
- else
- {
- Suspend, Off
- }
- return
- ; Inventory Keys:
- 3::Numpad7
- 4::Numpad8
- 5::Numpad4
- 6::Numpad5
- ; Hotkeys Remapper:
- ; User Specified Hotkeys:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement