Code: Select all
#Include <TapHoldManager>
#Include <ShinsImageScanClass>
#SingleInstance Force
#NoEnv
#Persistent
#InstallKeybdHook
#InstallMouseHook
#UseHook, On
#MaxThreadsperHotkey 2
#HotkeyModifierTimeout 200
#MaxHotkeysPerInterval 200
#Keyhistory 10
SetTitleMatchMode, 2
DetectHiddenWindows, On
SendMode, Event
SetWorkingDir %A_ScriptDir%
SetBatchLines, -1
SetControlDelay 1
SetWinDelay, -1
SetKeyDelay, -1, 0
SetMouseDelay, -1
ListLines off
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
CoordMode, Tooltip, Screen
Thread, interrupt, 0
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
; TapandHold
;----------------------------
thm := new TapHoldManager(250,300,,,"ahk_exe Wow.exe")
thm.Add("+", Func("Move"))
thm.Add("0", Func("Defensive"))
thm.Add("F1", Func("Totem"))
Move(isHold, taps, state)
{
If(isHold == 0)
{
if(state == -1)
{
if (taps == 1)
{
Send, {+}
}
else if (taps == 2)
{
Send, +{0}
}
}
}
else if(isHold == 1)
{
if (taps == 1)
{
Send, +{i}
}
}
}
Defensive(isHold, taps, state)
{
If(isHold == 0)
{
if(state == -1)
{
if (taps == 1)
{
Send, +{6}
}
else if (taps == 2)
{
Send, +{4}
}
}
}
else if(isHold == 1)
{
if (taps == 1)
{
Send, {e}
}
}
}
Totem(isHold, taps, state)
{
If(isHold == 0)
{
if(state == -1)
{
if (taps == 1)
{
Send, ^{2}
}
else if (taps == 2)
{
Send, {'}
}
}
}
else if(isHold == 1)
{
if (taps == 1)
{
Send, {f5}
}
}
}
; TapandHold
;----------------------------
#If WinActive("ahk_exe Wow.exe")
scan := new ShinsImageScanClass()
$+1::
SetTimer, lashingflames, -50
return
lashingflames:
scan.autoUpdate := 0 ;when performaing many scans on 1 frame set this to 0
done := true
rx := 1010
ry := 220
rw := 517
rh := 494
scan.update() ;only needed when setting the above to 0
if (scan.ImageRegion("image.png",rx,ry,rw,rh,60,x,y,0,"LRBT")) {
rh := (y - ry) - 5
x := x+60 ;scans to the left for flashing flames
y := y+5
w := 40
h := 40
mousemove,x,y
sleep 20
send +{1}
done := false
if (rh <= 0)
SetTimer,lashingflames, Off
} else
{
Send, 6
}
scan.autoUpdate := 1
return
$f4::
SendEvent, {s down}
SetTimer, Rotation, -40
return
$f4 up::
SendEvent, {s up}
SetTimer, Rotation, Off
return
$4::
SetTimer, wft, -40
return
wft:
PixelSearch, FoundX, FoundY, 1144, 458, 1179, 489, 0xE5D5F2, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, +{r}
}
else
{
PixelSearch, FoundX, FoundY, 1096, 458, 1132, 487, 0x5F7661, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, +{g}
}
else
{
PixelSearch, FoundX, FoundY, 1466, 1130, 1530, 1164, 0xF3EEC8, 10, Fast RGB
If (ErrorLevel = 1)
{
Send, {4}
}
}
}
Return
$4 up::
SetTimer, wft, Off
Return
$5::
SetTimer, Primordial, -40
return
Primordial:
PixelSearch, FoundX, FoundY, 1092, 1052, 1112, 1069, 0x09E1B5, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, {7}
Send, {f8}
}
else
{
PixelSearch, FoundX, FoundY, 1113, 1234, 1124, 1248, 0xF7DF10, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, {7}
Send +{6}
}
else
{
PixelSearch, FoundX, FoundY, 1372, 1145, 1403, 1192, 0x9A1011, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, {7}
Send, {2}
}
else
{
PixelSearch, FoundX, FoundY, 1273, 1057, 1285, 1064, 0xB54402, 10, Fast RGB
If(ErrorLevel = 0)
{
Send {5}
}
}
}
}
Return
$5 up::
SetTimer, Primordial, Off
return
$8::
if(scan.imageregion("fr1.png",321,20,1766,712,80,x,y,0,"BTLR"))
{
MouseMove, x+85,y+10
Send, 8
}else
{
if(scan.imageregion("image.png",321,20,1766,712,80,x,y,0,"BTLR"))
{
MouseMove, x+85,y+10
Send, 8
}
else {
Send, 8
}
}
Return
$1::
Send, {a down}
SetTimer, Rotation, -30
return
$1 up::
Send, {a up}
SetTimer, Rotation, Off
return
$2::
Settimer, Rotation, -30
Send, {d down}
return
$2 up::
Send, {d up}
SetTimer, Rotation, Off
return
$3::
SetTimer, Rotation, -30
return
Rotation:
PixelSearch, FoundX, FoundY, 1196, 1080, 1205, 1087, 0x1A6702, 10, Fast RGB
If (ErrorLevel = 0)
{
SendInput, {3}
}
scan.AutoUpdate := 0 ;class will not update buffer on calls, must update once manually
scan.Update()
if(scan.imageregion("1.png",1211,986,34,38,70,"BTLR"))
{
SendInput, {q}
}
if(scan.imageregion("2.png",1211,986,34,38,70,"BTLR"))
{
SendInput, {q}
}
if(scan.imageregion("3.png",1211,986,34,38,70,"BTLR"))
{
SendInput, {2}
}
if(scan.imageregion("4.png",1211,986,34,38,70,"BTLR"))
{
SetTimer, lashingflames, -30
}
if(scan.imageregion("5.png",1211,986,34,38,70,"BTLR"))
{
SendInput, {0}
}
if(scan.imageregion("6.png",1211,986,34,38,80,"BTLR"))
{
SendInput, {F3}
}
if(scan.imageregion("7.png",1211,986,34,38,70,"BTLR"))
{
SendInput, {'}
}
if(scan.imageregion("8.png",1211,986,34,38,60,"BTLR"))
{
SendInput, {1}
}
if(scan.imageregion("9.png",1211,986,34,38,60,"BTLR"))
{
SendInput, {t}
}
if(scan.imageregion("10.png",1211,986,34,38,60,"BTLR"))
{
SendInput, {3}
}
scan.AutoUpdate := 1
return
$3 up::
SetTimer, Rotation, Off
return
$6::
SetTimer, ss, -40
return
ss:
PixelSearch, FoundX, FoundY, 1116, 1070, 1136, 1091, 0x747474, 10, Fast RGB ; ST
If (ErrorLevel = 0)
{
PixelSearch, FoundX, FoundY, 1175, 1143, 1184, 1152, 0x1B9202, 10, Fast RGB
{
Send, {6}
}
else
{
PixelSearch, FoundX, FoundY, 1112, 1143, 1119, 1150, 0x881112, 10, Fast RGB
If (ErrorLevel = 0)
{
Send {0}
}
else
{
PixelSearch, FoundX, FoundY, 1156, 1150, 1176, 1165, 0xFD9600, 10, Fast RGB
If (ErrorLevel = 0)
{
Send {6}
}
else
{
PixelSearch, FoundX, FoundY, 1104, 1142, 1125, 1172, 0xD6E5ED, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, {0}
}
}
}
}
}
else
{
PixelSearch, FoundX, FoundY, 1175, 1143, 1184, 1152, 0x1B9202, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, {6}
}
else
{
PixelSearch, FoundX, FoundY, 1112, 1143, 1119, 1150, 0x881112, 10, Fast RGB
If (ErrorLevel = 0)
{
Send {0}
}
else
{
PixelSearch, FoundX, FoundY, 1156, 1150, 1176, 1165, 0xFD9600, 10, Fast RGB
If (ErrorLevel = 0)
{
Send {6}
}
else
{
PixelSearch, FoundX, FoundY, 1104, 1142, 1125, 1172, 0xD6E5ED, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, {0}
}
}
}
}
}
Return
$6 up::
SetTimer, ss, Off
return
$7::
SetTimer, cd, -40
Return
cd:
Send, {7}
Send, {r}
Send, {f7}
return
$7 up::
SetTimer, cd, Off
return
MButton::
Send, {e}
Send, {f}
Send, +{3}
Send, {0}
return
$9::
SetTimer, Defensives, -40
return
Defensives:
PixelSearch, FoundX, FoundY, 1245, 1197, 1271, 1224, 0x730712, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, {e}
Send, {f}
PixelSearch, FoundX, FoundY, 1195, 1269, 1206, 1280, 0xFCFABD, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, +{3}
Send, {9}
}
else
{
Send, +{e}
Sleep, 30
Send, +{4}
Sleep, 30
}
}
else
{
;PixelSearch, FoundX, FoundY, 1147, 1060, 1164, 1080, 0xB9A247, 10, Fast RGB
;If (ErrorLevel = 0)
;{
PixelSearch, FoundX, FoundY, 1235, 1191, 1267, 1207, 0xDEBB11, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, {e}
Send, {f}
PixelSearch, FoundX, FoundY, 1195, 1269, 1206, 1280, 0xFCFABD, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, +{3}
Send, {9}
}
}
else
{
Send, {e}
Send, {f}
PixelSearch, FoundX, FoundY, 1189, 1271, 1196, 1278, 0xFDF4A4, 10, Fast RGB
If (ErrorLevel = 0)
{
Send, +{3}
Send, {9}
}
else
{
Send, {9}
}
}
;}
;else
;{
;Send, ^{f}
;}
}
Return
$9 up::
SetTimer, Defensives, Off
return
#If
+!s::Suspend, Toggle
+!a::Reload