djlz2008 - 2008-4-14 13:24:00
VBS dim x1,y1,MBX,MBY,FSðDPGGhAforum.liuxuehome.comytôùôøí
VBS MBX = 490ðDPGGhAforum.liuxuehome.comytôùôøí
//MBX=目的地X的位置ðDPGGhAforum.liuxuehome.comytôùôøí
VBS MBY = 480ðDPGGhAforum.liuxuehome.comytôùôøí
//MBY=目的地Y的位置ðDPGGhAforum.liuxuehome.comytôùôøí
VBS FS =2-4ðDPGGhAforum.liuxuehome.comytôùôøí
//FS=负2ðDPGGhAforum.liuxuehome.comytôùôøí
//因为不能输入负数,所以采取的办法.ðDPGGhAforum.liuxuehome.comytôùôøí
Rem 移动ðDPGGhAforum.liuxuehome.comytôùôøí
For 100ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 1000ðDPGGhAforum.liuxuehome.comytôùôøí
Plugin X=DBsoft.OCR(0,74,586,91,594,0,1,11,1,0,"ffffff",0,0,0)ðDPGGhAforum.liuxuehome.comytôùôøí
Plugin Y=DBsoft.OCR(0,98,586,115,594,0,1,11,1,0,"ffffff",0,0,0)ðDPGGhAforum.liuxuehome.comytôùôøí
//大兵插件识别数字坐标X.Y的代码.ðDPGGhAforum.liuxuehome.comytôùôøí
VBS x1 = x - MBXðDPGGhAforum.liuxuehome.comytôùôøí
VBS y1 = y - MBYðDPGGhAforum.liuxuehome.comytôùôøí
//利用游戏坐标 减去 目的地坐标.得到相差的距离为X1.Y1ðDPGGhAforum.liuxuehome.comytôùôøí
TracePrint x1ðDPGGhAforum.liuxuehome.comytôùôøí
TracePrint y1ðDPGGhAforum.liuxuehome.comytôùôøí
TracePrint FSðDPGGhAforum.liuxuehome.comytôùôøí
//在调试模式下输出 x1 y1 FS 的情况 可以删除ðDPGGhAforum.liuxuehome.comytôùôøí
If y1=0 and x1=0ðDPGGhAforum.liuxuehome.comytôùôøí
//如果相差的距离Y1=0 并且 相差的距离X1=0 则代表当前游戏坐标与目的地坐标相差为0 则到达目的地.停止运行脚本.ðDPGGhAforum.liuxuehome.comytôùôøí
EndScript ðDPGGhAforum.liuxuehome.comytôùôøí
EndIf ðDPGGhAforum.liuxuehome.comytôùôøí
If y1>=2 and x1>=2ðDPGGhAforum.liuxuehome.comytôùôøí
//如果 相差的距离Y1大于等于2则说明可以往左跑. 并且 相差的距离X1大于等于2则可以上跑.ðDPGGhAforum.liuxuehome.comytôùôøí
//大家都知道游戏中走1步游戏坐标会因为方向不同+1或-1.是有规则的.跑一步则是+2.ðDPGGhAforum.liuxuehome.comytôùôøí
//大家知道 and 是和的意思 则可以往左跑+上跑=左上跑ðDPGGhAforum.liuxuehome.comytôùôøí
//左上ðDPGGhAforum.liuxuehome.comytôùôøí
MoveTo 0,0ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
RightClick 1ðDPGGhAforum.liuxuehome.comytôùôøí
Goto 移动ðDPGGhAforum.liuxuehome.comytôùôøí
EndIf ðDPGGhAforum.liuxuehome.comytôùôøí
If x1>=2 and y1<=FSðDPGGhAforum.liuxuehome.comytôùôøí
//左下ðDPGGhAforum.liuxuehome.comytôùôøí
MoveTo 0,434ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
RightClick 1ðDPGGhAforum.liuxuehome.comytôùôøí
Goto 移动ðDPGGhAforum.liuxuehome.comytôùôøí
ElseIf ðDPGGhAforum.liuxuehome.comytôùôøí
If y1>=2 and x1<=FSðDPGGhAforum.liuxuehome.comytôùôøí
//右上ðDPGGhAforum.liuxuehome.comytôùôøí
MoveTo 799,0ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
RightClick 1ðDPGGhAforum.liuxuehome.comytôùôøí
Goto 移动ðDPGGhAforum.liuxuehome.comytôùôøí
ElseIf ðDPGGhAforum.liuxuehome.comytôùôøí
If x1<=FS and y1<=FSðDPGGhAforum.liuxuehome.comytôùôøí
//右下ðDPGGhAforum.liuxuehome.comytôùôøí
MoveTo 799,349ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
RightClick 1ðDPGGhAforum.liuxuehome.comytôùôøí
Goto 移动ðDPGGhAforum.liuxuehome.comytôùôøí
ElseIf ðDPGGhAforum.liuxuehome.comytôùôøí
If y1>=2ðDPGGhAforum.liuxuehome.comytôùôøí
//上ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
MoveTo 396,0ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
RightClick 1ðDPGGhAforum.liuxuehome.comytôùôøí
Goto 移动ðDPGGhAforum.liuxuehome.comytôùôøí
EndIf ðDPGGhAforum.liuxuehome.comytôùôøí
If x1>=2ðDPGGhAforum.liuxuehome.comytôùôøí
//左ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
MoveTo 0,219ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
RightClick 1ðDPGGhAforum.liuxuehome.comytôùôøí
Goto 移动ðDPGGhAforum.liuxuehome.comytôùôøí
EndIf ðDPGGhAforum.liuxuehome.comytôùôøí
If x1<=FSðDPGGhAforum.liuxuehome.comytôùôøí
//右ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
MoveTo 799,214ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
RightClick 1ðDPGGhAforum.liuxuehome.comytôùôøí
Goto 移动ðDPGGhAforum.liuxuehome.comytôùôøí
EndIf ðDPGGhAforum.liuxuehome.comytôùôøí
If y1<=FSðDPGGhAforum.liuxuehome.comytôùôøí
//下ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
MoveTo 393,393ðDPGGhAforum.liuxuehome.comytôùôøí
Delay 50ðDPGGhAforum.liuxuehome.comytôùôøí
RightClick 1ðDPGGhAforum.liuxuehome.comytôùôøí
Goto 移动ðDPGGhAforum.liuxuehome.comytôùôøí
EndIf ðDPGGhAforum.liuxuehome.comytôùôøí
EndScript ðDPGGhAforum.liuxuehome.comytôùôøí
EndForðDPGGhAforum.liuxuehome.comytôùôøí