本帖最後由 pyng1975 於 2010-1-7 19:41 編輯
記得 重抓點.色
下載後把二個檔案放在一起
一樣有使用或問題的大大 記得回覆嘿
http://fhd.iwgun.net/downfile.php?action=public&file_id=4628&file_key=PHjPYb9z
------------------------------------------
#[HOTKEY]HOME
#[EXIT]END
#[PAUSE]PAUSE
#SetArgsOnCompile
//--------------------------------
//---將遊戲改成試窗模式
//---利用判斷某點顏色的***抓色工具抓點跟顏色
//---******(每一台電腦裡色彩都不一定相同一定要重抓)****
//---HP()是判斷血量的迴圈
//---Find()尋找怪物迴圈
//---AT()攻擊迴圈
//---DP()反擊迴圈
//---Rt()復活迴圈
//---Find2()防呆迴圈
//---FuncTime() 輔助技能迴圈
//---AP()魔量判斷迴圈
//---SP()體力判斷迴圈
//---攻擊設置[1.普攻-][2.技能-1][3.技能-2][4.技能-3][5.技能-4][6.技能-5]
//---輔助設置[S_1.輔助技能-1][S_2.輔助技能-2][S_3.輔助技能-3]
//---[S-4.輔助技能-4][S-5.輔助技能-5][S_6.輔助技能-6][S-7.輔助技能-7]
//---補血鍵 [=.既時生命大藥水]
//---至於AP.SP不足時自動坐下回覆
//=================== 進程 =====================
//================ 按下HOME執行 =================
function Main
# 在此添加由嚮導創建或錄製的代碼
SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
init()
FuncTime()
while true //循環開始
Rt()
Find2()
FuncTime()
HP()
AP()
SP()
Dp()
Find()
At()
wend //返回while開始循環
end function
dim Time1 = -1
dim Time2 = -1
dim Time3 = -1
dim Time4 = -1
dim Time5 = -1
dim Time6 = -1
dim Time7 = -1
dim S1,S2,S3,S4,S5,S6,S7,Z1,Z2,Z3,Z4,Z5,Z6,Z7 function init S1=GetConfigString("輔助鍵S_1冷卻時間")
Z1=GetConfigNumber("輔助鍵S_1施展時間")
S2=GetConfigString("輔助鍵S_2冷卻時間")
Z2=GetConfigNumber("輔助鍵S_2施展時間")
S3=GetConfigString("輔助鍵S_3冷卻時間")
Z3=GetConfigNumber("輔助鍵S_3施展時間")
S4=GetConfigString("輔助鍵S_4冷卻時間")
Z4=GetConfigNumber("輔助鍵S_4施展時間")
S5=GetConfigString("輔助鍵S_5冷卻時間")
Z5=GetConfigNumber("輔助鍵S_5施展時間")
S6=GetConfigString("輔助鍵S_6冷卻時間")
Z6=GetConfigNumber("輔助鍵S_6施展時間")
S7=GetConfigString("輔助鍵S_7冷卻時間")
Z7=GetConfigNumber("輔助鍵S_7施展時間")
end function
function SKeyPress(key)
KeyDown("SHIFT")
Wait(100)
KeyPress(key)
Wait(100)
KeyUp("SHIFT")
end function
//====================== 程序迴圈 ================
//================== 復活 ==================
Function Rt()
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(550, 234)的顏色等於(255, 255, 255) 那麼
if CheckColor(WinX0+550, WinY0+234, Color(255, 255, 255), 10) then
//以下為嚮導添加的代碼
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//在窗口坐標(549, 235)單擊鼠標左鍵
MouseLeftClick(WinX0+549, WinY0+235)
Wait(2000)
end if
if not CheckColor(WinX0+142, WinY0+736, Color(27, 40, 146), 10) then
print("SP不足,回補SP")
KeyPress("x")
do
loop Until CheckColor(WinX0+254, WinY0+737, Color(29, 41, 120), 10)
//取得當前活動窗口的坐標
GetActiveWindowXY(WinX0, WinY0)
//在此錄一段從復活點到掛機點的涵數
FuncTime()
Find()
Find2()
end if
end function
//==================== 輔助技能 =================
# 定時器添加方法:
# 步驟1. 將以下代碼加入腳本末尾
function FuncTime()
//定時器代碼,每Interval秒執行一次
Print("輔助技能加持中")
if S1 <> "=" then
if Time1 < 0 or GetTime() - Time1 > CNum(S1) * 1000 then
Time1 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("1")
Print("施放按鍵S_1輔助技能")
Wait(Z1) //<===如施放完呆滯時間過久就更改時間
keyPress("Esc")
Wait(100)
end if
end if
if S2 <> "=" then
if Time2 < 0 or GetTime() - Time2 > CNum(S2) * 1000 then
Time2 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("2")
Print("施放按鍵S_2輔助技能")
Wait(Z2)
KeyPress("Esc")
Wait(100)
end if
end if
if S3 <> "=" then
if Time3 < 0 or GetTime() - Time3 > CNum(S3) * 1000 then
Time3 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("3")
Print("施放按鍵S_3輔助技能")
Wait(Z3)
KeyPress("Esc")
Wait(100)
end if
end if
if S4 <> "=" then
if Time4 < 0 or GetTime() - Time4 > CNum(S4) * 1000 then
Time4 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("4")
Print("施放按鍵S_4輔助技能")
Wait(Z4)
KeyPress("Esc")
Wait(100)
end if
end if
if S5 <> "=" then
if Time5 < 0 or GetTime() - Time5 > CNum(S5) * 1000 then
Time5 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("5")
Print("施放按鍵S_5輔助技能")
Wait(Z5)
KeyPress("Esc")
Wait(100)
end if
end if
if S6 <> "=" then
if Time6 < 0 or GetTime() - Time6 > CNum(S6) * 1000 then
Time6 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("6")
Print("施放按鍵S_6輔助技能")
Wait(Z6)
KeyPress("Esc")
Wait(100)
end if
end if
if S7 <> "=" then
if Time7 < 0 or GetTime() - Time7 > CNum(S7) * 1000 then
Time7 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("7")
Print("施放按鍵S_7輔助技能")
Wait(Z7)
KeyPress("Esc")
Wait(100)
end if
end if
end function
//===================== HP ==================
function HP()
print("HP檢查點")
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(192, 707)的顏色等於(36, 40, 49) 那麼
if CheckColor(WinX0+192, WinY0+707, Color(36, 40, 49), 10) then
Print("HP不足 休息回HP")
KeyPress("x")
Wait(500)
do
DP()
Find2()
RT()
loop Until CheckColor(WinX0+253,WinY0+707,Color(146,23,43),10)
end if
end Function
//================== AP ======================
Function AP()
Print("AP檢查點")
GetActiveWindowXY(winX0,WinY0)
if CheckColor(WinX0+144, WinY0+722, Color(24, 25, 35), 10) then
print("AP不足,回補AP")
KeyPress("x")
Wait(500)
do
DP()
Find2()
RT()
loop Until CheckColor(WinX0+249, WinY0+721, Color(148, 118, 34), 10)
end if
end Function
//==================== SP ======================
Function SP()
Print("SP檢查點")
GetActiveWindowXY(winX0,WinY0)
if not CheckColor(WinX0+142, WinY0+736, Color(27, 40, 146), 10) then
print("SP不足,回補SP")
KeyPress("x")
Wait(500)
do
DP()
Find2()
RT()
loop until CheckColor(WinX0+254, WinY0+737, Color(29, 41, 120), 10)
end if
end Function
//==================== 反擊 =======================
Function Dp()
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+455, WinY0+29, Color(160, 38, 58), 10) then//怪血條後端如果顏色正確就反擊
do
Print("反擊主動怪")
Keypress("1")//普通攻擊
Wait(100)
KeyPress("2")//技能攻擊
Wait(100)
Keypress("3")//技能攻擊
Wait(100)
KeyPress("4")//技能攻擊
Wait(100)
KeyPress("5")//技能攻擊
Wait(100)
KeyPress("6")//技能攻擊
Wait(100)
Rt()
Find2()
do
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(147, 707)的顏色不等於(183, 34, 56) 那麼
if not CheckColor(WinX0+147, WinY0+707, Color(183, 34, 56), 10) then
Print("人物血量不足,補血中")
KeyPress("=")
Wait(500)
end if
Rt()
Find2()
loop While CheckColor(WinX0+250,WinY0+723, Color(110,82,14),10)
KeyPress("1")
Wait(100)
KeyPress("2")
Wait(100)
loop Until CheckColor(WinX0+451, WinY0+30, Color(24, 26, 29), 10)
print("攻擊結束,檢查怪物血量")
print("怪物死亡 撿取物品")
KeyPress("1")
wait(100)
KeyPress("f")
Wait(100)
KeyPress("f")
Wait(100)
KeyPress("Esc")
Wait(100)
KeyPress("x")
Wait(100)
end if
end function
//================== 尋找怪物 ====================
Function Find()
FindWindow("未來啟示錄",WinID)
ActiveWindow(WinID)
Wait(50)
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10) then
do
Print("尋找目標")
keyPress("tab")
Wait(100)
KeyPress("q")
Wait(100)
KeyPress("a")
Wait(100)
loop Until CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38),10)
end if
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+585, WinY0+9, Color(164, 164, 163), 10) then
//npc特定圖形判斷
do
print("判斷是否為npc")
Keypress("tab")
Wait(100)
KeyPress("q")
Wait(100)
KeyPress("q")
Wait(100)
loop until CheckColor(WinX0+585, WinY0+9, Color(164, 164, 163), 10)
//如果符合怪的圖行及執行下一行
end if
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(532, 11)的顏色等於(255, 255, 255) 那麼
if CheckColor(WinX0+532, WinY0+11, Color(255, 255, 255), 10) then
KeyPress("Tab")
Wait(100)
end if
end Function
//================== 攻擊開始 ==================
Function At() //攻擊開始
GetActiveWindowXY(WinX0, WinY0)
do
Print("攻擊中")
Keypress("1")//普攻
Wait(100)
KeyPress("2")//技能
Wait(100)
Keypress("3")//技能
Wait(100)
KeyPress("4")//技能
Wait(100)
KeyPress("5")//技能
Wait(100)
KeyPress("6")//技能
Wait(100)
Rt()
Find2()
if CheckColor(WinX0+611, WinY0+186, Color(250, 210, 0), 10) then
//如果窗口坐標(611, 186)的顏色等於(250, 210, 0) 那麼
KeyDown("q")
Wait(100)
KeyDown("d")
wait(1000)
KeyUp("q")
KeyUp("d")
Wait(100)
end if
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+578, WinY0+172, Color(255, 0, 0), 10) then
KeyDown("q")
Wait(1000)
KeyUp("q")
wait(100)
end if
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+142, WinY0+373, Color(255, 0, 0), 10) then
KeyDown("q")
Wait(1000)
KeyUp("q")
Wait(100)
end if
do
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(147, 707)的顏色不等於(183, 34, 56) 那麼
if not CheckColor(WinX0+147, WinY0+707, Color(183, 34, 56), 10) then
Print("人物血量不足,補血中")
KeyPress("=")
Wait(500)
end if
Rt()
Find2()
loop While CheckColor(WinX0+250,WinY0+723, Color(110,82,14),10)
KeyPress("1")
Wait(100)
KeyPress("2")
Wait(100)
loop Until CheckColor(WinX0+451, WinY0+30, Color(24, 26, 29), 10)
print("第一次攻擊結束,檢查怪物血量")
print("怪物死亡 撿取物品")
KeyPress("1")
wait(100)
KeyPress("f")
Wait(100)
KeyPress("f")
Wait(100)
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(532, 11)的顏色等於(255, 255, 255) 那麼
if CheckColor(WinX0+532, WinY0+11, Color(255, 255, 255), 10) then
KeyPress("Tab")
Wait(100)
end if
end function
//============================== Find2 ===============================
Function Find2()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0) //如果窗口坐標(586, 8)的顏色等於(71, 174, 189) 那麼
if CheckColor(WinX0+586, WinY0+8, Color(71, 174, 189), 50) then
KeyPress("Tab")
Wait(100)//以下為嚮導添加的代碼
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(509, 9)的顏色等於(255, 255, 255) 那麼
if CheckColor(WinX0+509, WinY0+9, Color(255, 255, 255), 10) then
KeyPress("Tab")
Wait(100)
end if
end if
end function |