網子放 1
攻擊放 2 3 4
藥水放 5 6 7(咖啡之類的)
快速恢復放 8
熱血放 9
致命反擊放 0
#[HOTKEY][EXT]HOME
//==========================================//
Dim WinID
//=================================================================================進程
function Main
SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
while true //循環開始
HP()//休息迴圈
Find()//尋找怪物迴圈
At()//攻擊迴圈,DP()反擊迴圈下在HP()所以不用寫在進程
wend //返回while開始循環
end function
//=================================================================================程序迴圈
//============================= 休息 ============================================
function HP()//休息攻擊+喝水
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
print("血量檢查點,如果不足就休息回血")
if not CheckColor(WinX0+204, WinY0+706, Color(255, 131, 134), 10) then
Wait(500)
KeyPress("x")
Wait(500)
Do
//循環
DP()//如果有主動怪或是支援怪就反擊
Wait(1000)//反擊結束後如果血量還沒滿就休息
loop until CheckColor(WinX0+250, WinY0+708, Color(118, 9, 29), 10)
end if
end Function
//==============================================================================搜尋怪物
Function Find()
FindWindow("未來啟示錄",WinID)
ActiveWindow(WinID)
Wait(100)
GetActiveWindowSize(w,h)
Print(w ","& h)
//--------------------------NPC判斷式---------------------------------------------
GetActiveWindowXY(WinX0, WinY0)
/* if not CheckColor(WinX0+432, WinY0+6, Color(176, 172, 97), 10) then//npc特定圖形判斷
do
print("判斷是否為npc")
Keypress("tab")
Wait(100)
Wait(300)
loop until CheckColor(WinX0+432, WinY0+6, Color(176, 172, 97), 10)//如果符合怪的圖行及執行下一行
end if
*/
//----------------------------npc判斷迴圈------------------------------------------
print("不為npc")
if not CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10) then//怪物血條判斷前端防止強怪
do
Print("尋找目標")
keyPress("tab")
Wait(100)
Keypress("a")//必免讀取顏色錯誤
Wait(300)
loop Until CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10)//怪物血條前端符合及跳離執行下一段
end if
end Function
//=================================================================================攻擊迴圈
Function At() //攻擊開始
GetActiveWindowXY(WinX0, WinY0)
stt=GetTime()
do
Print("AT")
Keypress("1",300)
KeyPress("s",1000)
KeyPress("2",300)
Keypress("3",300)
KeyPress("0",300)
//Wait(300)
if not CheckColor(WinX0+161, WinY0+705, Color(209, 81, 84), 10) then
Print("檢查人物血量.如果不足就補血")
KeyPress("5")
Wait(100)
end if
if not CheckColor(WinX0+161, WinY0+705, Color(209, 81, 84), 10) then
Print("檢查人物血量.如果不足就補血")
KeyPress("6")
Wait(100)
end if
if not CheckColor(WinX0+161, WinY0+705, Color(209, 81, 84), 10) then
Print("檢查人物血量.如果不足就補血")
KeyPress("7")
Wait(100)
end if
//------------------------------Timer這裡算是亂寫的只供參考-----------------------
if gettime()-stt>30*1000 then
CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10)=CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10)
if CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10)=CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10) then
print("卡怪!!!Tab換怪")
keypress("Tab")
exit do
end if
end if
loop until CheckColor(WinX0+451, WinY0+30, Color(24, 26, 29), 10)
print("第一次攻擊結束,檢查怪物血量")
print("怪物死亡")
Keypress("1",500)
KeyPress("W",1000)
Keypress("F",500)
Keypress("F",500)
Keypress("F1")//輔助技能直接按下不管有沒有狀態
Wait(100)
Keypress("9")
Wait(1200)
Keypress("8")
Wait(1000)
keypress("esc")//這裡的ESC是因為檢完物品後還會出現框框
end function
//==================================================================反擊迴圈
Function Dp()
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+451, WinY0+31, Color(102, 35, 48), 10) then//怪血條後端如果顏色正確就反擊
do
Print("主動怪反擊迴圈")
Keypress("1",300)
KeyPress("s",1000)
KeyPress("2",300)
Keypress("3",300)
KeyPress("0",300)
//Wait(300)
if not CheckColor(WinX0+161, WinY0+705, Color(209, 81, 84), 10) then
Print("檢查人物血量.如果不足就補血")
KeyPress("5")
Wait(100)
end if
if not CheckColor(WinX0+161, WinY0+705, Color(209, 81, 84), 10) then
Print("檢查人物血量.如果不足就補血")
KeyPress("6")
Wait(100)
end if
if not CheckColor(WinX0+161, WinY0+705, Color(209, 81, 84), 10) then
Print("檢查人物血量.如果不足就補血")
KeyPress("7")
Wait(100)
end if
loop until CheckColor(WinX0+451, WinY0+30, Color(24, 26, 29), 10)//直到血條為0及跳出
KeyPress("W",1000)
KeyPress("F")
Wait(500)
KeyPress("F")
Wait(500)
Keypress("ESC")
Wait(500)
HP()
end if
end function |