[QUOTE='[win]_champion;218279']Wynthar's DotA Invoker Auto-Hotkey Script
Version 3
Okay, so version three! Man. I have just spent many hours writing this script. I really don't feel like making a tutorial. But, I'm so happy with the way the script turned out ath I'm going to try to create a nice looking well rounded tutorial to support the script.
Credits
kill5link : Code for turning on and off the script in chat rooms/hitting enter/escape.
CerberPl : Pointed out a major flaw in my last script which made this script so much better.
Valarauka : Got some stuff for version one, including the Enter key to toggle.
Newest Feature
So, the thing that I spent hours on this revision is the ability to "remember" which spell or spells are currently invoked. The first tactic I used was to detect what the current spells were by grabbing a pixel at a point of the screen for the spells. I realized I had to get a different color for the spell if it was on the left side or the right side. I also realized I had to get a different color if the spell was currently in cooldown. So, I spent perhaps an hour writing up some code to detect the colors, then one by one I had to cast each spell, get the color, cast next spell get the color, invoke next spell. You get the idea. Eventually it was kind of tricky to get a few of the spells to be on the right side or the left side in order to record the colors.
After spending a long time doing this, I was in window'd mode, and I resized the window. I suddenly noticed that all my colors were off. I did a little bit more experimentation and found out that the colors change at various resolutions. Very upsetting. So I was stumped for a while, but then I thought about something I had seen once. Each time a spell is invoked record it. But there is a problem here too. Because, sometimes the spell doesn't get invoked if the invoke spell is on cool down. So, I grab the colors and determine if the invoke spell actually got casted. If it does, I keep track of the last two spells to be successfully invoked. Rotating in the newly invoked spell and cycling out the spell invoked two times ago. It's working pretty well now.
Known Bug
I know already that there will be one bug. The bug is going to be that if you are only at level 1 of Invoke, and you have invoked two spell so far, the script will think that you have two spells invoked. For example, let's say we've only got one level of invoke, and we invoke sunstrike, and then forge spirits. Well, we want to go cast sunstrike again. The script thinks that we have sun strike, since we can have two spells at higher levels. This will fail then when you try to use F7 to cast sunstrike. Until you have two ranks of invoke, you will have to manually invoke sunstrike (7) before you can cast it with F7.
Features:
* ` Enable the script. You must run this at least once.
* F1-F10: Cast Spells (Invoke if needed)
* 1 - 0 : Invoke Spells
* = : rotate current power balls
* F11, F12 : click the left and right spots of the invoker spells.
In this screen shot: F11 would cast EMP, F12 would cast Sun Strike
"Power Ball"
This is the term that I use to refer to the balls that fly around invoker. When you press "E" three times (for Exort) you will see three red balls floating around invoker. You will also notice his damage goes up +3 each power ball. So +9 at level one. If you have trained up to level 7 Exort you will have a maximum of +63 damage if all three "power balls" are red (Exort). This is why it is handy that when the spells are invoked, it reverts back to the "current" power ball. Sometimes you have the Wes power balls set because you want increased move speed. Say maybe you are trying to run away, or get to a battle. Then you want to cast ice wall and keep running, well then it's nice to just press the number 3, and have it invoke ice wall so you have that spell prepared, then it also reverts back to three Wes balls so that you can keep running quickly. Same goes for the other power balls, like with Exort you want to keep the DPS high.
In order to activate your "power balls" for the script to know which set you have, you must use the = key. You can find in the script where this key is mapped and change it if you want. It just is where I like to have it.
Invoke Spell Keys
Pressing the following numbers will invoke the spell, then it will revert back to your current "power ball."
1 Deafening Blast
2 Chaos Meteor
3 Ice Wall
4 EMP
5 Forge Spirits
6 Ghost Walk
7 Sun Strike
8 Tornado
9 Alacrity
0 Cold Snap
For Example
If your current power ball is Quas, and you press the number 5. The script will quickly "Click" the Exort, Exort, Quas button, then Invoke, then Quas, Quas, Quas. This will result in preparing the forge spirits spell, and then going back to your quas "powerball."
Of course you can remap all these keys by changing the letters in the script. Should be easy enough to find.
(Hint: *1:: PrepBlast() is where it sets they number 1 to cast the Deafening Blast Spell)
Cast Spell Keys
Same numbering sequence, and similar idea to the Invoke spell script. This spell willa ctually cast the spell as well as invoke it if needed. Remember this will have a bug if you only have one rank of the invoke spell. But once you have the second rank of invoke spell it works pretty well.
F1 Deafening Blast
F2 Chaos Meteor
F3 Ice Wall
F4 EMP
F5 Forge Spirits
F6 Ghost Walk
F7 Sun Strike
F8 Tornado
F9 Alacrity
F10 Cold Snap
[SPOILER];;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:: PrepBlast()
*2:: PrepMeteor()
*3:: PrepIceWall()
*4:: PrepEMP()
*5:: PrepForge()
*6:: PrepGhost()
*7:: PrepSunStrike()
*8:: PrepTornado()
*9:: PrepAlacrity()
*0:: 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
![]()
Share This Thread