UserVar jhp=80 当生命少于%时,使用红药
UserVar jmp=30 当真气少于%时,使用兰药
Delay 300
Rem 开始
Gosub 屏幕检测
Delay 300
EndScript
Sub 屏幕检测
Plugin cx=Sys.GetScRX()
Plugin cy=Sys.GetScRY()
Delay 300
Plugin s=Sys.GetScDep()
Delay 300
If cx=1280 and cy=1024 and s=32
Delay 100
Gosub 窗口检测
Delay 300
Gosub 主程序1
Else
If cx=1024 and cy=768 and s=32
Gosub 窗口检测
Gosub 主程序2
EndIf
VBSCall MessageBox ("检测2:屏幕分辩率或者颜色设置不对,请按标准设置后,重新运行脚本!")
EndScript
EndIf
Return
Sub 窗口检测
Delay 300
Plugin hwnd=Window.Find(0,"Gongfu Client")
Delay 300
If hwnd<>0
Delay 300
Plugin Window.Active(hwnd)
Delay 300
Plugin Window.Max(hwnd)
Delay 300
Else
Delay 300
MessageBox "程序未启动,请先启动程序!重新运行脚本!"
EndScript
EndIf
Return
Sub 主程序1
Gosub 判断血兰1
For 6
KeyPress 192,1
Delay 100
EndFor
KeyPress 9,1
Delay 100
Gosub 打怪1
Return
Sub 打怪1
Rem 技能1
KeyPress 49,1
Delay 100
KeyPress 50,1
Delay 100
KeyPress 51,1
Delay 1000
Gosub 判断血兰1
IfColor 553,82,3938FF,2
Delay 300
Goto 技能1
EndIf
Gosub 主程序1
Return
Sub 判断血兰1
Lx=16
Rx=175
hpy=93
mpy=111
Hcolor="584D3F"
Mcolor="605548"
VBSCall Hpx=int(jhp/100*(RX-lx)+lx)
VBSCall mpx=int(jmp/100*(Rx-lx)+LX)
IfColor Hpx,hpy,Hcolor,2
KeyPress 112,1
Delay 50
EndIf
IfColor mpx,mpy,Mcolor,2
KeyPress 113,1
Delay 50
EndIf
Return
Sub 主程序2
Gosub 判断血兰2
For 6
KeyPress 192,1
Delay 100
EndFor
KeyPress 9,1
Delay 100
Gosub 打怪2
Return
Sub 打怪2
Rem 技能2
KeyPress 49,1
Delay 100