1) How can I have the script run only when I'm in combat, and not run when I'm out of combat? Say I tab-target a mob, the script runs, the mob dies, the script pauses. <- That!
2) In conjunction with the above, is there a way to detect when I'm in or out of combat? This is the key to making the script work perfectly.
My script is below. Feel free to (constructively) critique it. It's just a first go. The X Y coordinates are based on my monitor's configuration and won't work for anyone else...probably!!
Code: Select all
#IfWinActive, World of Warcraft
Loop
{
PixelSearch, FoundX, FoundY, 647, 628, 701, 681, 0xFF0000, 50, Fast RGB ; Charge
if ErrorLevel = 0
{
Send, 1
Sleep, 250
}
PixelSearch, FoundX, FoundY, 649, 630, 702, 681, 0xC89016, 50, Fast RGB ; Collosus Smash
if ErrorLevel = 0
{
Send, 6
Sleep, 250
}
PixelSearch, FoundX, FoundY, 651, 630, 699, 679, 0x4D4968, 50, Fast RGB ; Mortal Strike
if ErrorLevel = 0
{
Send, 5
Sleep, 250
}
PixelSearch, FoundX, FoundY, 649, 627, 701, 682, 0x6E3189, 50, Fast RGB ; Slam
if ErrorLevel = 0
{
Send, 4
Sleep, 250
}
PixelSearch, FoundX, FoundY, 649, 629, 701, 682, 0x216163, 50, Fast RGB ; Warbreaker
if ErrorLevel = 0
{
Send, 9
Sleep, 250
}
PixelSearch, FoundX, FoundY, 649, 627, 701, 678, 0xE70000, 50, Fast RGB ; Execute
if ErrorLevel = 0
{
Send, x
Sleep, 250
}
}
return
0::
Suspend
Pause,,1
return