#[HOTKEY]F10
# 在此定義全局變量
function main
do
//熱血沸騰
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+9, WinY0+15, Color(162, 45, 20), 10) then
KeyPress("f1")
Wait(100)
KeyPress("8")
Wait(1500)
end if
//快速恢復
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+41, WinY0+16, Color(128, 170, 162), 10) then
KeyPress("5")
Wait(1500)
end if
//休息
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(187, 644)的顏色不等於(221, 18, 53) 那麼
if not CheckColor(WinX0+189, WinY0+644, Color(223, 18, 54), 10) then
attack(K)
end if
a()
KeyPress("1")
wait (6000)
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果找到圖像"ID.sel"
if FindImageEx("ID.sel", Color(30, 30, 30), WinX0+597, WinY0+41, WinX0+778, WinY0+126, true, FoundX, FoundY) then
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標
do //循環
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(153, 644)的顏色不等於(196, 18, 50) 那麼
if not CheckColor(WinX0+153, WinY0+644, Color(196, 18, 50), 10) then
KeyPress("0")
end if
Wait(100)
//直到窗口坐標(671, 477)的顏色等於(240, 47, 23)
loop until CheckColor(WinX0+671, WinY0+477, Color(240, 47, 23), 10)
KeyPress("f")
wait (1000)
else //否則
a()
end if
loop
end function
# 在此添加子函數
//休息
function attack(K)
KeyPress("x")
//等待10000毫秒
Wait(10000)
end function
function a()
//找怪
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
do //循環
//以下為嚮導添加的代碼
KeyPress("TAB")//以下為嚮導添加的代碼
//等待500毫秒
Wait(500)
//以下為嚮導添加的代碼
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果窗口坐標(605, 49)的顏色等於(185, 186, 182) 那麼
if CheckColor(WinX0+605, WinY0+49, Color(185, 186, 182), 10) then
//以下為嚮導添加的代碼
KeyPress("TAB")//以下為嚮導添加的代碼
//等待100毫秒
Wait(500)
end if
//加0.1秒延時以控制CPU佔用
Wait(100)
//直到窗口坐標(431, 7)的顏色等於(217, 212, 120)
loop until CheckColor(WinX0+431, WinY0+7, Color(217, 212, 120), 10)
end function
winter3587大大發的帖 (轉 |