#[HOTKEY][EXT]HOME
//--------------------------------
//---將遊戲改成試窗模式
//---利用判斷某點顏色的***抓色工具抓點跟顏色
//---******(每台電腦裡色彩都不一定相同,如無法套用記得重抓)****
//---HP()是判斷休息的迴圈
//---Find()尋找怪物迴圈
//---AT()攻擊加回血的迴圈
//---DP()反擊迴圈
//---Rt()復活迴圈
//---FuncTime()技能迴圈
//---按鍵設置[1.技能-三連擊][2.技能-劍舞][3.技能-閃電落雷][4.技能-神聖閃電][8.輔助技能-治癒氣息][9.輔助技能-充能武器][0.輔助技能-原能狂暴][-.輔助技能-抵禦][=.輔助技能-憤怒提升]
//---補血鍵 [5.高階治癒] 當然可視自己需要[6.7]也可在使用
//---至於AP不足時自動坐下回覆
Dim Time=1 //先定義以後用的到
Dim WinID
//=================== 進程 =====================
//================== 按下HOME執行 ===============
function Main
# 在此添加由嚮導創建或錄製的代碼
SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
while true //循環開始
Rt()
FuncTime()
HP()
Dp()
Find()
At()
wend //返回while開始循環
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(5000)
end if
end function
//================ 輔助技能 ====================
# 定時器添加方法:
# 步驟1. 將以下代碼加入腳本末尾
function FuncTime()
//定時器代碼,每Interval秒執行一次
dim global Time01 = -1
if Time01 < 0 or GetTime() - Time01 >= 200 * 1000 then
Time01 = GetTime()
//以下為執行代碼
KeyPress("F1")
Wait(100)
KeyPress("6")
Wait(1000)
end if
dim global Timer02 = -1
if Timer02 < 0 or GetTime() - Timer02 >= 170 * 1000 then
Timer02 = GetTime()
//以下為執行代碼
KeyPress("F1")
Wait(100)
KeyPress("7")
Wait(1000)
end if
dim global Timer03 = -1
if Timer03 < 0 or GetTime() - Timer03 >= 720 * 1000 then
Timer03 = GetTime()
//以下為執行代碼
KeyPress("F1")
Wait(100)
KeyPress("8")
Wait(1000)
end if
dim global Timer04 = -1
if Timer04 < 0 or GetTime() - Timer04 >= 480 * 1000 then
Timer04 = GetTime()
//以下為執行代碼
KeyPress("F1")
Wait(100)
KeyPress("9")
Wait(2000)
KeyPress("Esc")
Wait(100)
end if
end function
//==================== 休息 ===============
function HP()//休息+喝水
//取窗口原點坐標
//取窗口原點坐標
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
print("血量如不足,則休息回血")
if CheckColor(WinX0+160, WinY0+645, Color(34, 37, 45), 10) then
KeyPress("x")
Wait(100)
do
Dp()
Rt()
loop until CheckColor(WinX0+249, WinY0+644, Color(103, 9, 25), 10)
KeyPress("Esc")
Wait(100)
end if
end Function
//================== 反擊 ===============
Function Dp()
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+588, WinY0+31, Color(103, 19, 35), 10) then//怪血條後端如果顏色正確就反擊
do
Print("反擊主動怪")
keyPress("1")
wait(50)
KeyPress("2")
Wait(100)
KeyPress("3")
Wait(100)
KeyPress("4")
Wait(100)
Rt()
if CheckColor(WinX0+182, WinY0+708, Color(26, 27, 36), 10) then //人物血條判斷
Print("人物血量不足.補血中")
KeyPress("F1")
Wait(100)
KeyPress("5")
Wait(1500)
KeyPress("Tab")
Wait(100)
do
Rt()
loop While CheckColor(WinX0+160, WinY0+645, Color(34, 37, 45),10)
KeyPress("Esc")
Wait(100)
end if
loop until CheckColor(WinX0+447, WinY0+29, Color(24, 25, 31), 10)//直到血條為0及跳出
keypress("f")
wait(100)
KeyPress("f")
Wait(100)
end if
end function
//=================== 尋找怪物 ==================
Function Find()
FindWindow("未來啟示錄",WinID)
ActiveWindow(WinID)
Wait(50)
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+588, WinY0+31, Color(103, 19, 35), 10) then
do
Print("尋找目標")
keyPress("tab")
Wait(50)
KeyPress("q")
Wait(50)
KeyPress("a")
Wait(50)
loop Until CheckColor(WinX0+588, WinY0+31, Color(103, 19, 35), 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(300)
loop until CheckColor(WinX0+588, WinY0+31, Color(103, 19, 35), 10)//如果符合怪的圖行及執行下一行
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")//技能
Rt()
if CheckColor(WinX0+613, WinY0+186, Color(250, 210, 0), 10) then
//如果窗口坐標(613, 186)的顏色等於(250, 210, 0) 那麼
KeyPress("q")
Wait(100)
KeyPress("q")
wait(100)
KeyPress("q")
wait(100)
KeyPress("e")
Wait(100)
end if
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+577, WinY0+170, Color(255, 0, 0), 10) then
KeyPress("q")
Wait(100)
KeyPress("q")
wait(100)
KeyPress("q")
wait(100)
KeyPress("e")
Wait(100)
end if
if CheckColor(WinX0+160, WinY0+645, Color(34, 37, 45), 10) then //人物血條判斷
Print("人物血量不足.補血中")
KeyPress("F1")
Wait(100)
KeyPress("5")
Wait(1500)
KeyPress("f")
Wait(100)
do
loop While CheckColor(WinX0+249, WinY0+644, Color(103, 9, 25),10)
KeyPress("Esc")
Wait(100)
end if
if CheckColor(WinX0+157, WinY0+657, Color(211, 171, 51), 10) then
print("AP不足,回補AP")
KeyPress("x")
Wait(100)
do
Dp()
Rt()
loop until CheckColor(WinX0+249, WinY0+657, Color(141, 108, 27), 10)
KeyPress("Esc")
Wait(100)
end if
loop Until CheckColor(WinX0+447, WinY0+29, Color(24, 25, 31), 10)
print("第一次攻擊結束,檢查怪物血量")
print("怪物死亡 撿取物品")
Keypress("f")
wait(100)
Keypress("f")
Wait(100)
KeyPress("Esc")
Wait(500)
end function
以上是小弟改的腳本~~~不过懇請會的看的懂得幫我測試一下哪裡需要修改~~~
搞了好幾個小時~~~所有血條都抓過了......
但是打完一隻怪以後......他就會一直按X休息鍵~~~
腳本最後顯示的是~檢查怪物血量~撿取物品~~~懂得人幫我看一下~~哪裡還需要修改~~S軟體實在太複雜了!!!救命ㄚ各位大大 |