// 注意.注意,開始外掛前請在右上小地圖的"N"上按一下,在開始按F11
function main
SetInputMode(1) # 設為窗口輸入模式。
SetInputTarget(2) # 設置鼠標所在窗口為目標窗口。
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//在窗口坐標(926, 29)單擊鼠標左鍵
MouseLeftClick(WinX0+926, WinY0+29)
while true
Book() //一分鍾自動按一次物品欄左上方的書(60秒)
Magic() //技能,放在0鍵,10(600秒)分鐘自動執行一次
//Takebox() //自動拾取物品
keypress("`")
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//如果有人在打這一支怪自動換下一支,也就是不搶怪
if CheckColor(WinX0+437, WinY0+23, Color(8, 8, 8), 30) then
//if not FindImageEx("next3.Sel", Color(30, 30, 30),358, 4, 683, 49, true, X, Y) then
//當怪還沒殺死時一直普攻"1"鍵
do while FindImageEx("kill2.Sel", Color(30, 30, 30), 1, 1, 1024, 768, true, X, Y)
keypress("1")
Takebox() //自動拾取物品
loop
//else //否則
// end if
end if
wend
end function
# 撿東西副程式
Function Takebox()
//如果找到圖像"b1.sel"
if FindImageEx("寶箱.sel", Color(10,10,10), 1, 1, 1024, 768, true, FoundX, FoundY) then
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標
mousemove(FoundX,FoundY)
mouserightclick()
//否則
elseif FindImageEx("寶箱2.sel", Color(10,10,10), 1, 1, 1024, 768, true, FoundX, FoundY) then
//此時FoundX和FoundY的值分別為找到的圖像的左上角X,Y坐標
mousemove(FoundX,FoundY)
mouserightclick()
end if
end function
#刷書副程式,把書放至左上第一格
function Book()
//定時器代碼,每Interval秒執行一次
dim global Timer01 = -1
if Timer01 < 0 or GetTime() - Timer01 >= 60 * 1000 then
Timer01 = GetTime()
Wait(200)
KeyPress("A", 141)
Wait(1600)
MouseMove(778, 235)
MouseRightClick(125)
Wait(1600)
MouseMove(656, 420)
MouseLeftClick(156)
Wait(1600)
KeyPress("A", 219)
end if
end function
function Magic()
//定時器代碼,每Interval秒執行一次
dim global Timer02 = -1
if Timer02 < 0 or GetTime() - Timer02 >= 600 * 1000 then
Timer02 = GetTime()
Wait(200)
KeyPress("0")
end if
end function |