function main
SetInputMode(4)
while true
Hpkey="F1" //補血鍵
percent=60 //每個人血量低於90%時補血
HpTime=3000 //補血技能延遲時間(3000=3秒)
MpKey="F2" //補魔鍵(預設50%自動補)
//========只需設定以上參數====================
KSP_ReadMemory(&H00A46AD8,2,hp01)
KSP_ReadMemory(&H00A46AF4,2,hp02)
KSP_ReadMemory(&H00A3E8C8,2,hp11)
KSP_ReadMemory(&H00A3E8D0,2,hp12)
KSP_ReadMemory(&H00A3E9A8,2,hp21)
KSP_ReadMemory(&H00A3E9B0,2,hp22)
KSP_ReadMemory(&H00A3EA88,2,hp31)
KSP_ReadMemory(&H00A3EA90,2,hp32)
KSP_ReadMemory(&H00A3EB68,2,hp41)
KSP_ReadMemory(&H00A3EB70,2,hp42)
KSP_ReadMemory(&H00A3EC48,2,hp51)
KSP_ReadMemory(&H00A3EC50,2,hp52)
KSP_ReadMemory(&H00A46ADC,2,mp)
KSP_ReadMemory(&H00A46AF8,2,mp1)
mp2=int(mp/mp1*100)
if mp2<50 then //hp低於50%,按補mp鍵
KeyPress(MpKey)
end if
hp03=int(hp01/hp02*100)
hp13=int(hp11/hp12*100)
hp23=int(hp21/hp22*100)
hp33=int(hp31/hp32*100)
hp43=int(hp41/hp42*100)
hp53=int(hp51/hp52*100)
if hp03<percent then
MouseLeftClick(50,50)
KeyPress(Hpkey)
wait(HpTime)
end if
print("自已HP:" & hp03 & "%")
if hp12<999999 then
if hp13<percent then
MouseLeftClick(26,160)
KeyPress(Hpkey)
wait(HpTime)
end if
print("第1位隊友HP:" & hp13 & "%")
end if
if hp22<999999 then
if hp23<percent then
MouseLeftClick(26,200)
KeyPress(Hpkey)
wait(HpTime)
end if
print("第2位隊友HP:" & hp23 & "%")
end if
if hp32<999999 then
if hp33<percent then
MouseLeftClick(26,240)
KeyPress(Hpkey)
wait(HpTime)
end if
print("第3位隊友HP:" & hp33 & "%")
end if
if hp42<999999 then
if hp43<percent then
MouseLeftClick(26,280)
KeyPress(Hpkey)
wait(HpTime)
end if
print("第4位隊友HP:" & hp43 & "%")
end if
if hp52<999999 then
if hp53<percent then
MouseLeftClick(26,320)
KeyPress(Hpkey)
wait(HpTime)
end if
print("第5位隊友HP:" & hp53 & "%")
end if
print("-----------------------------")
wait(1000)
wend
end function |