Java 游戏自动寻路,老游戏仙境传说RO私服自动寻路求交流(含代码)

游戏的参照物是小地图的箭头,里面有个红点不会变~但是随箭头移动,有可能斜上、有可能斜下的时候会找不到颜色,我要从人物所在位置移动到红线尽头,我的思路是(从回主城寻路找女人-回主城寻路找女人5):依照箭头然后一只走到红线尽头,在尽头处有个图可以做判定,代码中图片叫“门口”,这个脚本有时候能成功,有时候又 不能成功,求建议!!另,其他子程序运行100次可能有1-2次会出现找不到图或者是字或者是点的问题,所以,我想在每个子程序上面搞一个时间判定>=60秒则跳转到 “Call回人物画面”这个子程序接着运行下去,如果“Call回人物画面”>=60秒则跳转都“Call回人物画面”这个子程序接着运行下去,要怎么搞~~跳转和时间判定我也不会,顺便求个演示代码!

半3D的游戏,

Call 绑定窗口

call 进入游戏

Call 建角色

Call 进入画面

Call 找到点击验证人员

Call 与验证人说话1

call .............(还有许多个子程序)

Call 回人物画面

Call 删除角色

Call 删除角色2

Call 删除角色3

Sub 回主城寻路找女人

Set dm = createobject("dm.dmsoft")

base_path = dm.GetBasePath()

dm_ret = dm.SetPath(base_path)

dm_ret = dm.SetPath( "c:\test_game")

Hwnd = Plugin.Window.MousePoint()

dm_ret = dm.BindWindow(Hwnd, "normal", "normal", "normal", 0)

Delay 500

If dm_ret = 1 Then

TracePrint "绑定成功"

End If

Do

dm_ret = dm.FindColor(681,31,759,133,"d60000-000000|ffb2b2-000000",0.95,0,faX,faY)

If faX = 706 and faY = 119 Then

Delay 200

TracePrint faX & "," & faY

dm.MoveTo 224,296

Delay 100

dm.LeftClick

Delay 100

Exit Do

TracePrint "未找到"

Else

Delay 100

End IF

Loop

End Sub

Sub 回主城寻路找女人1

Set dm = createobject("dm.dmsoft")

base_path = dm.GetBasePath()

dm_ret = dm.SetPath(base_path)

dm_ret = dm.SetPath( "c:\test_game")

Hwnd = Plugin.Window.MousePoint()

dm_ret = dm.BindWindow(Hwnd, "normal", "normal", "normal", 0)

Delay 500

If dm_ret = 1 Then

TracePrint "绑定成功"

End If

Do

dm_ret = dm.FindColor(681,31,759,133,"d60000-000000|ffb2b2-000000",0.95,0,faX,faY)

If faX = 703 and faY = 119 Then

Delay 200

TracePrint faX & "," & faY

dm.MoveTo 420,500

Delay 200

dm.LeftClick

Delay 800

Exit Do

TracePrint "未找到"

Else

Delay 100

End IF

Loop

End Sub

Sub 回主城寻路找女人2

Set dm = createobject("dm.dmsoft")

base_path = dm.GetBasePath()

dm_ret = dm.SetPath(base_path)

dm_ret = dm.SetPath( "c:\test_game")

Hwnd = Plugin.Window.MousePoint()

dm_ret = dm.BindWindow(Hwnd, "normal", "normal", "normal", 0)

Delay 200

If dm_ret = 1 Then

TracePrint "绑定成功"

End If

Do

dm_ret = dm.FindColor(681,31,759,133,"ff9393-000000|d60000-000000",0.95,0,faX,faY)

If faX = 704 or faX =705 or faX =706 and faY = 123 or faY = 124 or faY = 125 Then

TracePrint faX & "," & faY

Delay 200

dm.MoveTo 78, 340

Delay 800

dm.LeftClick

Delay 500

Else

TracePrint "未找到"

Exit Do

End IF

Loop

End Sub

Sub 回主城寻路找女人3

Set dm = createobject("dm.dmsoft")

base_path = dm.GetBasePath()

dm_ret = dm.SetPath(base_path)

dm_ret = dm.SetPath( "c:\test_game")

Hwnd = Plugin.Window.MousePoint()

dm_ret = dm.BindWindow(Hwnd, "normal", "normal", "normal", 0)

Delay 200

If dm_ret = 1 Then

TracePrint "绑定成功"

End If

Do

dm_ret = dm.FindColor(675,22,759,133,"d60000-000000|ffb2b2-000000",0.95,0,faX,faY)

If faX = 697 or faX =698 or faX =699 and faY = 122 or faY = 123 or faY = 124 Then

TracePrint faX & "," & faY

Delay 300

dm.MoveTo 78, 330

Delay 200

dm.LeftClick

Delay 800

Else

Delay 200

Exit Do

TracePrint "未找到"

End IF

Loop

End Sub

Sub 回主城寻路找女人4

Set dm = createobject("dm.dmsoft")

base_path = dm.GetBasePath()

dm_ret = dm.SetPath(base_path)

dm_ret = dm.SetPath( "c:\test_game")

Hwnd = Plugin.Window.MousePoint()

dm_ret = dm.BindWindow(Hwnd, "normal", "normal", "normal", 0)

Delay 200

If dm_ret = 1 Then

TracePrint "绑定成功"

End If

Do

dm_ret = dm.FindColor(681,31,759,133,"d60000-000000|ffb2b2-000000",0.95,0,faX,faY)

If faX = 687 or faX =688 or faX =689 and faY = 126 or faY = 127 or faY = 128 Then

TracePrint faX & "," & faY

Delay 300

dm.MoveTo 168, 136

Delay 200

dm.LeftClick

Delay 500

Else

TracePrint "未找到"

Delay 600

Exit Do

End IF

Loop

End Sub

Sub 回主城寻路找女人5

Set dm = createobject("dm.dmsoft")

base_path = dm.GetBasePath()

dm_ret = dm.SetPath(base_path)

dm_ret = dm.SetPath( "c:\test_game")

Hwnd = Plugin.Window.MousePoint()

dm_ret = dm.BindWindow(Hwnd, "normal", "normal", "normal", 0)

Delay 500

If dm_ret = 1 Then

TracePrint "绑定成功"

End If

Do

dm_ret = dm.FindPic(0,0,2000,2000,"门口.bmp","020202",0.9,0,jianX,jianY)

If jianX >= 0 and jianY >= 0 Then

Delay 200

TracePrint jianX & "," & jianX

dm.MoveTo jianX -70, jianY + 60

Delay 100

dm.LeftClick

Delay 800

Exit Do

Else

TracePrint "没找到"

Delay 100

End IF

Loop

end sub

仙境传说.jpg

(, 下载次数:0)

ro sf(2015/10/8 19:31:07 上传)

7ae2b7f5e01e482f2468fafa9c23b03c.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值