感謝krte大 寫的腳本,藍色部分是我有改的測試過正常掛網,沒改的地方別問我 我也還在摸索
畢竟我連C語言都不懂只會修改座標 希望大家要用還是要多用點心 有錯的地方請糾正 謝謝
小弟再此一鞠躬
=======================分隔線======================
#[HOTKEY]F10
function main
SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
while true //循環開始
State() //子函數狀態
wend //返回while開始循環
end function
function state
do
rest()
find()
hit()
buff()
loop
end function
//----------------------------------------------------------------------------------------------休息
function rest()
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(255, 707)的顏色等於(91, 32, 41) 那麼
if CheckColor(WinX0+215, WinY0+708, Color(26, 28, 36), 10) thenkrte大<=這裡是抓你沒血的地方
print("休息一下!!")
KeyPress("x")
Wait(500)
do //循環
//等待1000毫秒
pertect()
Wait(1000)
//直到窗口坐標(188, 42)的顏色等於(166, 60, 23)
loop until CheckColor(WinX0+253, WinY0+708, Color(103, 9, 25), 10)<=這裡是抓你滿血的地方
end if
if CheckColor(WinX0+170, WinY0+736, Color(27, 27, 35), 10) then<=這裡是抓你沒SP的地方
Print("NO SP")
KeyDown("x")
Wait(500)
KeyUp("x")
do
Wait(1000)
loop until CheckColor(WinX0+255, WinY0+737, Color(42, 49, 124), 10)<=這裡是抓你滿SP的地方
end if
end function
//--------------------------------------------------------------------------------------------------------尋找
function find()
Print("尋找目標")
pertect()
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+491, WinY0+10, Color(240, 240, 20), 10) then<=這是抓怪滿血的地方
do
Wait(300)
KeyDown("TAB")
Wait(100)
KeyUp("TAB")
Wait(100)
KeyPress("a")
Wait(1000)
aa()
loop until CheckColor(WinX0+491, WinY0+10, Color(240, 240, 20), 10) //怪物滿血的位置<=同上
end if
end function
//----------------------------------------------------------------------------------------------------------初打怪
function hit()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
Print("ATTACK")
do//執行攻擊
KeyPress("2")
Wait(1000)
KeyPress("1")
Wait(150)
miss()
miss2()
shotback()
GetActiveWindowXY(WinX0, WinY0)
shotback()
//如果窗口坐標(195, 708)的顏色等於(223, 18, 54) 那麼
if not CheckColor(WinX0+195, WinY0+708, Color(223, 18, 54), 10) then<=這是抓你失血到哪要喝水的地方
Print("補血") (我是設定小藥)
KeyDown("6")
Wait(500)
KeyUp("6")
end if
if not CheckColor(WinX0+140, WinY0+708, Color(124, 11, 30), 10) then<=這裡同上差別大藥跟小藥
Print("補血") (我是設定大藥)
KeyDown("7")
Wait(300)
KeyUp("7")
end if
loop while CheckColor(WinX0+451, WinY0+30, Color(109, 37, 47), 10)//怪物血量底部,如果還有血就跳回去
//等待500毫秒 (上面這排是抓怪最底部的血我會提醒是因為坐標需要改)@@"
Print("再加一槍以防萬一!!")
KeyPress("1")
wait(500)
Print("死亡")
KeyPress("F")
Wait(500)
print("撿東西")
keypress("F")
wait(500)
print("再確認一次")
KeyPress("ESC")
Wait(200)
Print("檢查:是否有主動怪")
Wait(1500)
pertect()
print("結束")
end function
//----------------------------------------------------------------------------------------------------無法攻擊1
function miss()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果找到圖像"無法攻擊.sel"
if CheckColor(WinX0+617, WinY0+186, Color(250, 210, 0), 10) then<=如果我沒想錯的話因該是螢幕出現的那個字
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標 抓出來的座標就是黃色字任一點大家試試嚕
Print("因視野關係無法攻擊,轉換目標")
keypress("TAB")
wait(500)
Print("準備攻擊")
Wait(500)
Print("檢查:是否有主動怪")
pertect()
end if
end function
//-------------------------------------------------------------------------------------------------
function miss2()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果找到圖像"無法攻擊.sel"
if CheckColor(WinX0+594, WinY0+192, Color(255, 0, 0), 10) then<=我想因該是同上的原理
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標
Print("在位置上無法使用技能.轉換目標")
keypress("TAB")
wait(500)
Print("準備攻擊")
Wait(500)
Print("檢查:是否有主動怪")
pertect()
end if
end function
//---------------------------------------------------------------------------------------------------buff的部份
function buff()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
pertect()
//如果窗口坐標(7, 10)的顏色等於(125, 25, 11) 那麼
if not FindImageEx("3333.Sel", Color(30, 30, 30), WinX0+3, WinY0+4, WinX0+52, WinY0+26, true, FoundX, FoundY) then
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標
Print("輔助")
KeyDown("F1")
Wait(1000)
KeyUp("F1")
KeyDown("8")
Wait(1500)
KeyUp("8")
KeyPress("ESC")
Wait(500)
pertect()
end if
end function
//------------------------------------------------------------------------主動怪攻擊的部份
function pertect()
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(579, 31)的顏色等於(159, 42, 71) 那麼
if CheckColor(WinX0+579, WinY0+31, Color(159, 42, 71), 10) then
Print("主動怪")
hit()
end if
end function
//--------------------------------------------------------------------------槍手反擊
function shotback()
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+410, WinY0+720, Color(255, 255, 163), 10) then<=這是殺手的技能那要抓話是抓那招亮起時
KeyPress("4") (我是去給低等怪打等他亮起時抓座標的)
Print("反擊")
end if
end function
//-----------------------------------------------------------------------不是滿血怪
function aa()
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+591, WinY0+31, Color(108, 25, 44), 10) then
Print("非滿血怪")
end if
end function |