julianperrott / WowClassicGrindBot

WOW Classic Grind Bot, World of Warcraft Grind Bot - No DLL injection or memory watching, just screen capture and mouse and keyboard clicking.
120 stars 211 forks source link

NullPointerExceptions with custom path #29

Closed pikachyu closed 3 years ago

pikachyu commented 4 years ago

Hi there,

I am getting NullPointer exceptions right after I start the bot. I have recorded a custom path, edited the class file to use this file (path_etc.json). I am in the same map as I recorded the path.

Log is filled with below;

[20:24:53 ERR] PerformAction on FollowRouteGoal
System.NullReferenceException: Object reference not set to an instance of an object.
   at PathingAPI.PPatherService.GetWorldLocation(Int32 uiMapId, Single v1, Single v2) in C:\Users\jpl\Documents\WowClassicGrindBot\PathingAPI\Search\PPatherService.cs:line 66
   at BlazorServer.LocalPathingApi.FindRoute(Int32 map, WowPoint fromPoint, WowPoint toPoint) in C:\Users\jpl\Documents\WowClassicGrindBot\BlazorServer\PathingApi\LocalPathingApi.cs:line 40
   at Libs.Goals.FollowRouteGoal.RefillRouteToNextWaypoint(Boolean forceUsePathing) in C:\Users\jpl\Documents\WowClassicGrindBot\Libs\Goals\FollowRouteGoal.cs:line 302
   at Libs.Goals.FollowRouteGoal.PerformAction() in C:\Users\jpl\Documents\WowClassicGrindBot\Libs\Goals\FollowRouteGoal.cs:line 136
   at Libs.Goals.GoalThread.GoapPerformGoal() in C:\Users\jpl\Documents\WowClassicGrindBot\Libs\Goals\GoalThread.cs:line 57

Thanks!

julianperrott commented 4 years ago

What zone is this in ? I think it is a problem with it not matching the MapId correctly between these two: https://github.com/julianperrott/WowClassicGrindBot/blob/master/PathingAPI/WorldToMap/WorldMapArea.json and https://github.com/julianperrott/WowClassicGrindBot/blob/master/PathingAPI/WorldToMap/uimap.csv

pikachyu commented 4 years ago

Barrens seems to be the issue, works in the other areas.

julianperrott commented 4 years ago

Could you do the following command in the chat window and tell me what it says.

/dump C_Map.GetBestMapForUnit("player")

pikachyu commented 3 years ago

[1]=1413 I just noticed that player dot is missing from the map. 1413 is in the csv

Gothfinger commented 3 years ago

I'm getting the same error message:

[10:13:56 ERR] PerformAction on FollowRouteGoal System.NullReferenceException: Object reference not set to an instance of an object. at PathingAPI.PPatherService.GetWorldLocation(Int32 uiMapId, Single v1, Single v2) in C:\Users\Leonard\Desktop\downloads\wowo2\WowClassicGrindBot3\PathingAPI\Search\PPatherService.cs:line 66 at BlazorServer.LocalPathingApi.FindRoute(Int32 map, WowPoint fromPoint, WowPoint toPoint) in C:\Users\Leonard\Desktop\downloads\wowo2\WowClassicGrindBot3\BlazorServer\PathingApi\LocalPathingApi.cs:line 40 at Libs.Goals.FollowRouteGoal.RefillRouteToNextWaypoint(Boolean forceUsePathing) in C:\Users\Leonard\Desktop\downloads\wowo2\WowClassicGrindBot3\Libs\Goals\FollowRouteGoal.cs:line 302 at Libs.Goals.FollowRouteGoal.PerformAction() in C:\Users\Leonard\Desktop\downloads\wowo2\WowClassicGrindBot3\Libs\Goals\FollowRouteGoal.cs:line 136 at Libs.Goals.GoalThread.GoapPerformGoal() in C:\Users\Leonard\Desktop\downloads\wowo2\WowClassicGrindBot3\Libs\Goals\GoalThread.cs:line 57

Also got [1]=1413 in Barrens.

https://github.com/julianperrott/WowClassicGrindBot/blob/master/PathingAPI/WorldToMap/WorldMapArea.json

{
    "ID": 11,
    "MapID": 1,
    "AreaID": 17,
    "AreaName": "Barrens",
    "LocLeft": 2622.9165,
    "LocRight": -7510.4165,
    "LocTop": 1612.49988,
    "LocBottom": -5143.75
},

https://github.com/julianperrott/WowClassicGrindBot/blob/master/PathingAPI/WorldToMap/uimap.csv

Name_lang ID ParentUiMapID Flags System Type LevelRangeMin LevelRangeMax BountySetID BountyDisplayLocation VisibilityPlayerConditionID HelpTextPosition BkgAtlasID
Azeroth 947 0 2304 0 1 0 0 0 0 0 0 0
Durotar 1411 1414 4 0 3 0 0 0 0 0 0 0
Mulgore 1412 1414 4 0 3 0 0 0 0 0 0 0
The Barrens 1413 1414 4 0 3 0 0 0 0 0 0 0

Not sure how the mapping is performed, but something should be changed in WorldMapArea.json maybe?

pikachyu commented 3 years ago

I'll debug it this weekend, will create PR.

julianperrott commented 3 years ago

Should be fixed in the latest code.