• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • After update calling BotManager.SetCurrent from Plugin and then Stopping bot crashes

    Discussion in 'Rebornbuddy Support' started by nishalp, May 12, 2015.

    1. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      177
      Likes Received:
      4
      Trophy Points:
      18
      After the update, I fixed the Animus Plugin to use BotPlugin instead of IBotPlugin which is all good and fine now. However when I press the Stop Bot button after I have used the following code, RB hard crashes with the following stack trace:

      RebornBuddy.exe!ff14bot.BotBases.FateBot.Stop() Unknown
      RebornBuddy.exe!ff14bot.TreeRoot.() Unknown
      mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) Unknown
      mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
      mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
      mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
      mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() Unknown


      When this code is called from my plugin it crashes RB on pressing the Stop Bot button. I start off with a Order Bot and change to Fate Bot via the function where bot is the text "Fate Bot":

      foreach (BotBase a in BotManager.Bots)
      {
      if (a.EnglishName == bot)
      {
      BotManager.SetCurrent(a);
      break;
      }
      }

      Any ideas?
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Need an entire log.
       
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Yea, I can't get it to crash but your using treeroot.stop wrong.

      What you want todo is on your changebot function add a handler to TreeRoot.OnStop, call treeroot.stop() and return., Then inside the event handler actually change the currentbot, remove the event handler and then treeroot.start()
       
    4. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      177
      Likes Received:
      4
      Trophy Points:
      18
      Crashed right at the end of this. Does not log much about the crash.

      [04:51:56.003 D] [BotManager] Botbases have been reloaded.
      [04:51:56.003 D] ChocoboTrainer v1.0.273.0
      [04:51:56.003 D] Gardening bot v1.0.273.0
      [04:51:56.003 D] Combat Assist v1.0.273.0
      [04:51:56.004 D] Fate Bot v1.0.273.0
      [04:51:56.004 D] PvP v1.0.273.0
      [04:51:56.004 D] Fishing v1.0.273.0
      [04:51:56.004 D] Grinding v1.0.273.0
      [04:51:56.004 D] Gathering v1.0.273.0
      [04:51:56.004 D] Order Bot v1.0.273.0
      [04:51:56.029 D] Reloading AssemblyLoader<ff14bot.Interfaces.IBotPlugin> - Initializing
      [04:51:57.042 N] Book Id - 6
      [04:51:57.042 D] [PluginManager] Plugins have been reloaded.
      [04:51:57.042 D] Animus Book v1.5.6
      [04:51:57.042 D] QuestDevTools v0.0.1
      [04:51:57.042 D] RebornConsole v0.0.1
      [04:51:57.046 N] Building Actioncache
      [04:51:58.583 N] Action Name:Sprint Action Id:3
      [04:51:58.583 N] Action Name:Heavy Swing Action Id:31
      [04:51:58.583 N] Action Name:Foresight Action Id:32
      [04:51:58.583 N] Action Name:Fracture Action Id:33
      [04:51:58.583 N] Action Name:Bloodbath Action Id:34
      [04:51:58.583 N] Action Name:Skull Sunder Action Id:35
      [04:51:58.583 N] Action Name:Mercy Stroke Action Id:36
      [04:51:58.583 N] Action Name:Maim Action Id:37
      [04:51:58.583 N] Action Name:Berserk Action Id:38
      [04:51:58.583 N] Action Name:Brutal Swing Action Id:39
      [04:51:58.583 N] Action Name:Thrill of Battle Action Id:40
      [04:51:58.583 N] Action Name:Overpower Action Id:41
      [04:51:58.583 N] Action Name:Storm's Path Action Id:42
      [04:51:58.583 N] Action Name:Holmgang Action Id:43
      [04:51:58.583 N] Action Name:Vengeance Action Id:44
      [04:51:58.583 N] Action Name:Storm's Eye Action Id:45
      [04:51:58.583 N] Action Name:Tomahawk Action Id:46
      [04:51:58.583 N] Action Name:Butcher's Block Action Id:47
      [04:51:58.583 N] Action Name:Defiance Action Id:48
      [04:51:58.583 N] Action Name:Inner Beast Action Id:49
      [04:51:58.583 N] Action Name:Unchained Action Id:50
      [04:51:58.583 N] Action Name:Steel Cyclone Action Id:51
      [04:51:58.583 N] Action Name:Infuriate Action Id:52
      [04:51:58.583 N] Action Name:Flash Action Id:14
      [04:51:58.583 N] Action Name:provoke Action Id:18
      [04:51:58.583 N] Action Name:Second Wind Action Id:57
      [04:51:58.583 N] Action Name:Internal Release Action Id:59
      [04:51:58.583 N] Action Name:Convalescence Action Id:12
      [04:51:58.583 N] Action Name:Mythril Tempest Action Id:1560
      [04:51:58.583 N] Action Name:Thrill of War Action Id:1561
      [04:51:58.583 N] Action Name:Full Swing Action Id:1562
      [04:51:58.583 N] Action Name:Enliven Action Id:1580
      [04:51:58.583 N] Action Name:purify Action Id:1584
      [04:51:58.583 N] Done building Actioncache
      [04:51:58.600 D] Reloading AssemblyLoader<ff14bot.Interfaces.ICombatRoutine> - Initializing
      [04:51:59.064 D] [RoutineManager] Routines have been reloaded. Current class-specific list:
      [04:51:59.064 D] Kupo [MaruaderWarrior] v1.0.273.0
      [04:51:59.066 N] [Kupo] Starting Kupo [MaruaderWarrior]
      [04:51:59.084 N] [Kupo] Old context:None CurrentContext:Normal
      [04:51:59.095 D] Replaced hook [Kupo.Combat] e07c9e7b-ca31-4e45-9330-23c61c62de07
      [04:51:59.096 D] Replaced hook [Kupo.Pull] c15f8885-aa8f-4ab3-9be2-2612c1763f2c
      [04:51:59.096 D] Replaced hook [Kupo.Rest] edce8de3-69db-4e8e-921e-7c41d5769198
      [04:51:59.096 D] Replaced hook [Kupo.CombatBuffs] d0333aef-afc9-4484-ba47-5ffff52ead3c
      [04:51:59.097 D] Replaced hook [Kupo.Heal] 054dc735-12cb-492e-b431-32bacfb61cfa
      [04:51:59.098 D] Replaced hook [Kupo.PreCombatBuffs] a7aa2856-acc4-49d1-abeb-df842202ba16
      [04:51:59.098 N] (Kupo) Verified behaviors can be created!
      [04:51:59.098 N] [Kupo] Initialization complete!
      [04:52:06.176 D] Loading last profile
      [04:52:06.343 N] Loaded profile Empty Profile
      [04:52:06.344 N] Bot Thread Started.
      [04:52:06.665 N] Connection to 192.99.148.87:31214 established.
      [04:52:06.686 N] Clearing all hooks.
      [04:52:06.686 D] Added new hook [TreeStart] ea056cc7-ec0c-4a7c-8f8e-fddae977945f
      [04:52:06.686 N] Loading Profile - Blank
      [04:52:06.832 N] Loaded profile Empty Profile
      [04:52:06.832 N] [Kupo] Hooks cleared, re-creating behaviors
      [04:52:06.833 D] Replaced hook [Kupo.Combat] 60052b6c-5c3b-452c-a8a7-b49d4605e221
      [04:52:06.833 D] Replaced hook [Kupo.Pull] 8d9df728-c8ce-4861-ada3-b9004638e7b8
      [04:52:06.833 D] Replaced hook [Kupo.Rest] 8168e561-11b0-4841-a2f2-5916466ce2fd
      [04:52:06.833 D] Replaced hook [Kupo.CombatBuffs] cd5293ff-0844-478f-b838-44f717cce576
      [04:52:06.833 D] Replaced hook [Kupo.Heal] 12d63cf2-e102-4c64-b68a-8e4aecd1de47
      [04:52:06.833 D] Replaced hook [Kupo.PreCombatBuffs] acbb5871-f0a4-4020-90a0-2a21a204596f
      [04:52:06.840 D] Added new hook [Pull] c2ed3880-4a1c-4273-9992-32abe83af8ca
      [04:52:06.840 D] Added new hook [RoutineCombat] 13388de7-cf33-48e4-adc8-2f2d3ea6e884
      [04:52:06.841 D] Added new hook [HotspotPoi] ca5247b6-0693-495f-9d9d-26b863d47c0c
      [04:52:06.842 D] Added new hook [SetDeathPoi] 18371089-2ddf-4c7d-be17-467a9b120e65
      [04:52:06.842 D] Added new hook [SetCombatPoi] 3c2b07c8-4b31-49fd-931a-82943ab04bd7
      [04:52:06.842 D] Added new hook [SetHotspotPoi] 5effb6e0-9eb9-4756-b04f-b0fd2877a8b6
      [04:52:06.842 D] Added new hook [SelectPoiType] 46f98f35-ee4a-456e-8c15-50493fef44b6
      [04:52:06.842 D] Replaced hook [SelectPoiType] 57f77894-66c4-401d-a04c-b55f3aecc07c
      [04:52:06.842 D] Inserted new hook [TreeStart @0] 15868abc-acea-4d61-a823-47e6e5a4badb
      [04:52:06.907 N] Bot Changed to - Fate Bot
      [04:52:06.907 N] Stopping the bot.
      [04:52:06.907 D] CurrentBot.Stop()
      [04:52:06.910 N] Connection closed! 192.99.148.87:31214
      [04:52:06.911 D] TreeHooks.Instance.ClearAll()
      [04:52:06.911 N] Clearing all hooks.
      [04:52:06.911 D] Added new hook [TreeStart] ea056cc7-ec0c-4a7c-8f8e-fddae977945f
      [04:52:06.911 N] Loading Profile - Blank
      [04:52:07.070 N] Loaded profile Empty Profile
      [04:52:07.070 N] [Kupo] Hooks cleared, re-creating behaviors
      [04:52:07.070 D] Replaced hook [Kupo.Combat] ccc65839-bef4-4995-961a-caa9f64aae06
      [04:52:07.071 D] Replaced hook [Kupo.Pull] d3acae20-e8bc-4359-af58-d35557e8782a
      [04:52:07.071 D] Replaced hook [Kupo.Rest] f6d60734-8295-45dd-81a7-882142ce9f17
      [04:52:07.071 D] Replaced hook [Kupo.CombatBuffs] 98aea6cd-2694-4b59-8590-eddafbb1423f
      [04:52:07.071 D] Replaced hook [Kupo.Heal] a2188812-69c4-499b-9e83-de3325fa754e
      [04:52:07.071 D] Replaced hook [Kupo.PreCombatBuffs] 6908f0a5-0da9-4bbe-b422-841d16fc7673
      [04:52:07.071 D] Navigator.Clear()
      [04:52:07.072 V] [Poi.Clear] Reason: Bot stopped
      [04:52:07.072 D] OnStop event
      [04:52:08.574 N] Bot Thread Started.
      [04:52:08.575 N] Teleporting to - 4
      [04:52:08.600 D] Teleporting to the hawthorne hut
      [04:52:08.657 D] System.NullReferenceException: Object reference not set to an instance of an object.
      at ff14bot.TreeRoot.()
      [04:52:08.749 N] Clearing all hooks.
      [04:52:08.749 D] Added new hook [TreeStart] ea056cc7-ec0c-4a7c-8f8e-fddae977945f
      [04:52:08.749 N] Loading Profile - Blank
      [04:52:08.749 N] Connection to 192.99.148.87:31214 established.
      [04:52:08.767 D] System.NullReferenceException: Object reference not set to an instance of an object.
      at ff14bot.TreeRoot.()
      [04:52:08.893 N] Loaded profile Empty Profile
      [04:52:08.893 N] [Kupo] Hooks cleared, re-creating behaviors
      [04:52:08.894 D] Replaced hook [Kupo.Combat] 78073934-e91b-468a-b93c-8c429f3a41dd
      [04:52:08.894 D] Replaced hook [Kupo.Pull] 72f02723-201a-429f-9140-a4d26273a3f6
      [04:52:08.894 D] Replaced hook [Kupo.Rest] bb690cf9-832f-4f87-a24d-df6d2363ae37
      [04:52:08.894 D] Replaced hook [Kupo.CombatBuffs] 53ac0efe-ef02-452d-a2bc-3c713046d11e
      [04:52:08.894 D] Replaced hook [Kupo.Heal] 8125cf83-6a13-42ba-aea3-b548a69c0b42
      [04:52:08.894 D] Replaced hook [Kupo.PreCombatBuffs] ddc6caed-cc14-4356-993d-ecb9f6c720fc
      [04:52:08.894 D] Added new hook [Pull] c2ed3880-4a1c-4273-9992-32abe83af8ca
      [04:52:08.894 D] Added new hook [RoutineCombat] 95103de9-f308-4d7d-b58e-f7dbe8df64a5
      [04:52:08.894 D] Added new hook [HotspotPoi] 973d11a2-2b1f-4b70-967b-fd84981c6904
      [04:52:08.894 D] Added new hook [SetDeathPoi] 0b63230d-6681-45f8-ac76-d93d740faead
      [04:52:08.894 D] Added new hook [SetCombatPoi] dc56afe1-576d-49b6-9361-1b28eb877c2d
      [04:52:08.894 D] Added new hook [SetHotspotPoi] 89baaba9-93b6-4bd3-8d63-6a1d41df0ca3
      [04:52:08.894 D] Added new hook [SelectPoiType] 5191accc-a70d-465c-9ca0-7d77ef312db3
      [04:52:08.895 D] Added new hook [SetFatePoi] 7ec1b903-1d3e-46c2-b0b0-9632b1698a14
      [04:52:08.895 D] Added new hook [SetRestPoi] 1581de15-fc8a-4d7d-b6ca-4a5ea78157e8
      [04:52:08.895 D] Replaced hook [SelectPoiType] e9ea42b4-d630-4301-a33b-cff59b10dc04
      [04:52:08.896 D] Added new hook [FatePoi] 7a72625c-fca6-492c-afa0-b6b63b855633
      [04:52:08.896 D] Added new hook [PoiAction] 28b4cbb1-f635-43b8-810c-aa825e3954a3
      [04:52:08.897 D] Added new hook [RestPoi] b3a5ebf2-b396-465d-b820-e8b357321f83
      [04:52:08.897 D] Added new hook [PoiAction2] 353a7d05-2143-4d42-9a08-05ace38180ce
      [04:52:08.898 D] Added new hook [TreeStart] cc6b2ad3-e981-4b79-afb7-7ee191b8b4a4
      [04:52:08.945 N] Teleporting to - 4
      [04:52:08.945 D] Teleporting to the hawthorne hut
      [04:52:23.963 D] Requesting path on 152 from <-196.7707, 3.487429, 298.7876> to <338.248, -4.124189, -58.41627>
      [04:52:24.551 D] Generated path to <338.248, -4.124189, -58.41627> in 00:00:00.5880778 ms
      [04:52:26.552 N] Stopping the bot. Reason:pushed the stop button.
      [04:52:26.573 D] CurrentBot.Stop()
      [04:52:26.574 N] Connection closed! 192.99.148.87:31214
      [04:52:26.574 D] OnStop event
      [04:52:26.574 N] Bot Thread Ended.
       
    5. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Please try implementing the proper method for switching botbases as i described above and let me know if it still crashes.
       
    6. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Also, you can add
      Code:
      using System.Linq;
      
      then do

      Code:
      BotManager.Bots.FirstOrDefault(u => u.Name.Contains(bot))
      
       
    7. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      177
      Likes Received:
      4
      Trophy Points:
      18
      Thanks. I will give that a shot.

       
    8. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      177
      Likes Received:
      4
      Trophy Points:
      18
      All good now with the events. Thanks.
       

    Share This Page