#[HOTKEY][EXT]F10
function Main
SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
while true //循環開始
HP()
wend //返回while開始循環
end function
function HP()//休息+喝水
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
print("血量檢查點,不足休息回血")
if not CheckColor(WinX0+208, WinY0+712, Color(248, 64, 105), 10) then
Wait(100)
KeyDown("x")
Wait(500)
KeyUp("x")
do
//循環
Wait(500)
loop until CheckColor(WinX0+253, WinY0+709, Color(102, 17, 33), 10)
end if
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(67, 15)的顏色不等於(138, 202, 149) 那麼
if not CheckColor(WinX0+67, WinY0+15, Color(138, 202, 149), 10) then
KeyPress("F1", 93)
Wait(125)
KeyDown("SHIFT")
Wait(375)
KeyPress("-", 94)
Wait(8000)
KeyUp("SHIFT")
end if
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+738, WinY0+138, Color(250, 210, 0), 10) then
Print("無法攻擊")
KeyDown("2")
Wait(3000)
KeyUp("2")
Wait(3000)
KeyDown("Tab")
Wait(100)
KeyUp("Tab")
Wait(1000)
end if
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+454, WinY0+29, Color(163, 36, 59), 10) then//怪物血量沒滿
do
Keypress("Tab")
Wait(100)
loop until CheckColor(WinX0+589, WinY0+29, Color(154, 38, 57), 10)//怪物滿血的位置
end if
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+439, WinY0+12, Color(220, 215, 121), 10) then//指定目標的種類
do
Print("Npc")
Keypress("Tab")
Wait(100)
loop until CheckColor(WinX0+589, WinY0+29, Color(154, 38, 57), 10)//怪物滿血的位置
else //找到的話…
do
Print("攻擊")
for ForCount = 1 to 1
KeyDown("1")
Wait(500)
KeyUp("1")
KeyDown("2")
Wait(2500)
KeyUp("2")
KeyDown("3")
Wait(2500)
KeyUp("3")
Keypress("4")
Wait(2000)
Keypress("5")
Keypress("6")
Keypress("7")
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(208, 711)的顏色不等於(223, 42, 84) 那麼
if not CheckColor(WinX0+208, WinY0+711, Color(223, 42, 84), 10) then
keypress("8")
Wait(300)
end if
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(164, 736)的顏色不等於(35, 51, 197) 那麼
if not CheckColor(WinX0+164, WinY0+736, Color(35, 51, 197), 10) then
KEYPRESS("-")
end if
next
loop while CheckColor(WinX0+454, WinY0+29, Color(163, 36, 59), 10)//怪物血量到達0如果還有血會跳回去
print("第一次攻擊結束,檢查怪物血量")
print("怪物死亡")
Keypress("f")
wait(500)
Keypress("f")
Wait(500)
end if
end function |