Sunteți pe pagina 1din 10

;;Got pieces from Valarauka originally for version 1 including...

;*~Enter:: ;Enter will also enable/disable script so you can chat easily ;; Massive Credits to CerberPl (4-27-2009) ; CerberPl pointed out a simple fix, but it was a major headache that ; completely stopped the development of this script. Thanks! ;;;WARNING - YOU MIGHT BECOME A GOD-LIKE INVOKER WITH THIS SCRIPT ; Recommended for performance and compatibility with future AutoHotkey releases. #NoEnv #InstallKeybdHook ; Recommended for new scripts due to its superior speed and reliability. ;SendMode Input ; This is what we want to use though.... (test) SendMode Play ; Ensures a consistent starting directory. SetWorkingDir %A_ScriptDir% Suspend On #IfWinActive, Warcraft III #UseHook On ; Force hotkeys to use keyboard hook ;;;;;;;;;;;;;;;;;;;;;;;;; ; Toggle Script Enabled ; ;;;;;;;;;;;;;;;;;;;;;;;;; *`:: Suspend CheckSetup() return ;;;;;;;;;;;;;;;;;;;;;;; ; Code From kill5link ; ;;;;;;;;;;;;;;;;;;;;;;; ~*Enter:: ~*NumpadEnter:: Suspend, Permit if (bInChatRoom == True) return Suspend if (A_IsSuspended == true) SetScrollLockState, Off else SetScrollLockState, On return ;; Escape will cancel chatting, so turn the hotkeys back on ~*Esc:: Suspend, Permit if (bInChatRoom == True) return Suspend, Off SetScrollLockState, On

return ;; Use End to toggle an "in chat room" state to keep script off *End:: Suspend, Permit bInChatRoom := not bInChatRoom if (bInChatRoom == True) { Suspend, On SetScrollLockState, Off } else { Suspend, Off SetScrollLockState, On } return

;;;;;;;;;;;;;;;;;;; ; Setup Variables ; ;;;;;;;;;;;;;;;;;;; CheckSetup() { global if (setupComplete != true) { GridSetup() sleeptime = 150 CurrentBallVar = 0 FirstInvokeSpell = 0 SecondInvokeSpell = 0 setupComplete := true SoundPlay *1 Sleep, 400 SoundPlay *1 Sleep, 400 SoundPlay *48 } else { if (A_IsSuspended) SoundPlay *64 else SoundPlay *48 } } ;;;;;;;;;;;;;;; ;Hotkey Setup ; ;;;;;;;;;;;;;;; *q:: SetQuas() *w:: SetWex() *e:: SetExort()

*=:: NextBall() *F11:: ClickLeftSpell() *F12:: ClickRightSpell() *1:: *2:: *3:: *4:: *5:: *6:: *7:: *8:: *9:: *0:: PrepBlast() PrepMeteor() PrepIceWall() PrepEMP() PrepForge() PrepGhost() PrepSunStrike() PrepTornado() PrepAlacrity() PrepColdSnap()

*F1:: Blast() *F2:: Meteor() *F3:: IceWall() *F4:: EMP() *F5:: Forge() *F6:: Ghost() *F7:: SunStrike() *F8:: Tornado() *F9:: Alacrity() *F10:: ColdSnap() *t:: DisplayStatus() ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Click Spells in Locations ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ClickLeftSpell() { global ClickSpot(x2, y2) } ClickRightSpell() { global ClickSpot(x3, y2) } ClickSpot(x, y) { SetMouseDelay, 1, Play MouseGetPos, xpos, ypos Send {Click %x%, %y%, L} MouseMove, %xpos%, %ypos% SetMouseDelay, -1, Play } DisplayStatus() { global MsgBox, % "Inv: " . FirstInvokeSpell . " Second: " . SecondInvokeSpell } ;;;;;;;;;;;;;;;;;;;;;;

; To CAST the spells ; ;;;;;;;;;;;;;;;;;;;;;; Blast() ;; Spell ID 1 { global if (FirstInvokeSpell != 1 and SecondInvokeSpell != 1) { PrepBlast() Sleep, %sleeptime% } SendPlay b } Meteor() ;; Spell ID 2 { global if (FirstInvokeSpell != 2 and SecondInvokeSpell != 2) { PrepMeteor() Sleep, %sleeptime% } SendPlay d } IceWall() ;; Spell ID 3 { global if (FirstInvokeSpell != 3 and SecondInvokeSpell != 3) { PrepIceWall() Sleep, %sleeptime% } SendPlay g } EMP() ;; Spell ID 4 { global if (FirstInvokeSpell != 4 and SecondInvokeSpell != 4) { PrepEMP() Sleep, %sleeptime% } SendPlay c } Forge() ;; Spell ID 5 { global if (FirstInvokeSpell != 5 and SecondInvokeSpell != 5) {

PrepForge() Sleep, %sleeptime% } SendPlay f } Ghost() ;; Spell ID 6 { global if (FirstInvokeSpell != 6 and SecondInvokeSpell != 6) { PrepGhost() Sleep, %sleeptime% } ; 3x Wex for Move Speed while Ghosted SendPlay {w 3} SendPlay v } SunStrike() ;; Spell ID 7 { global if (FirstInvokeSpell != 7 and SecondInvokeSpell != 7) { PrepSunStrike() Sleep, %sleeptime% } SendPlay t } Tornado() ;; Spell ID 8 { global if (FirstInvokeSpell != 8 and SecondInvokeSpell != 8) { PrepTornado() Sleep, %sleeptime% } SendPlay x } Alacrity() ;; Spell ID 9 { global if (FirstInvokeSpell != 9 and SecondInvokeSpell != 9) { PrepAlacrity() Sleep, %sleeptime% } SendPlay z } ColdSnap() ;; Spell ID 10 { global if (FirstInvokeSpell != 10 and SecondInvokeSpell != 10) { PrepColdSnap() Sleep, %sleeptime%

} SendPlay y } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 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 != 0x000000) 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)

; Go to Wex for move speed. SetWex() } 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} } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Grid for clicking buttons, ; ; and detecting colors ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GridSetup() { global ;Using WinGetPos will work even if playing windowed mode. WinGetPos,,, winWidth, winHeight, A x1:=(510*winWidth)//640 x2:=(542*winWidth)//640 x3:=(576*winWidth)//640 x4:=(605*winWidth)//640 y1:=(390*winHeight)//480 y2:=(414*winHeight)//480 y3:=(448*winHeight)//480 sentinelx:=(13*winWidth)//640 ;Sentinel fountain

sentinely:=(467*winHeight)//480 scourgex:=(110*winWidth)//640 ;Scourge fountain scourgey:=(374*winHeight)//480 selfx:=(200*winWidth)//640 selfy:=(420*winHeight)//480 }