以下的腳本那裡出錯
會一直選怪
請幫幫我看那裡出錯
dim fzjn1_T,fzjn2_T,fzjn3_T
function main
fzjn1_T=GetConfigNumber("按鍵5的輔助技能")
fzjn2_T=GetConfigNumber("按鍵6的輔助技能")
fzjn3_T=GetConfigNumber("按鍵7的輔助技能")
SetTimer("fzjn1", fzjn1_T*1000, true)
SetTimer("fzjn2", fzjn2_T*1000, true)
SetTimer("fzjn3", fzjn3_T*1000, true)
do
fuhuo()
find()
hit()
drink()
loop
end function
function find ()
GetActiveWindowXY(WinX0, WinY0)
do //循環
keypress("TAB")
wait(3000)
//加0.2秒延時以控制CPU佔用
Wait(200)
//直到圖像"怪.sel"出現
loop until FindImageEx("怪.sel", Color(30, 30, 30), WinX0+426, WinY0+0, WinX0+445, WinY0+18, true, FoundX, FoundY)
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標
end function
function hit()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
do //循環
qiehuan()
fuhuo()
keypress("1")
wait(500)
drink()
wait(1000)
keypress("2")
wait(1000)
drink()
wait(1000)
keypress("3")
wait(1000)
//加0.1秒延時以控制CPU佔用
Wait(100)
//直到窗口坐標(451, 29)的顏色不等於(108, 49, 54)
loop while CheckColor(WinX0+451, WinY0+29, Color(108, 49, 54), 10)
keypress("4")
keypress("4")
keypress("4")
wait(500)
end function
function drink()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(193, 707)的顏色不等於(239, 46, 73) 那麼
if not CheckColor(WinX0+193, WinY0+707, Color(239, 46, 73), 10) then
keypress("-")
wait(100)
end if
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(191, 737)的顏色不等於(56, 79, 209) 那麼
if not CheckColor(WinX0+191, WinY0+737, Color(56, 79, 209), 10) then
keypress("=")
wait(100)
end if
end function
function qiehuan()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果找到圖像"無法攻擊.sel"
if FindImageEx("無法攻擊.sel", Color(30, 30, 30), WinX0+411, WinY0+179, WinX0+623, WinY0+196, true, FoundX, FoundY) then
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標
keypress("TAB")
wait(300)
end if
end function
function fuhuo()
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果找到圖像"復活.sel"
if FindImageEx("復活.sel", Color(30, 30, 30), WinX0+485, WinY0+78, WinX0+537, WinY0+98, true, FoundX, FoundY) then
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標
beep(800,60000)
end if
end function
function fzjn1()
keypress("5")
wait(1000)
end function
function fzjn2()
keypress("6")
wait(1000)
end function
function fzjn3()
keypress("7")
wait(1000)
end function |