Demonbuddy for Season 16 released, updates.buddyauth.com !
  • Visit Rebornbuddy
  • Visit Demonbuddy

Restart bot?

Discussion in 'Community Developer Forum' started by Farmith, Mar 30, 2019.

  1. Farmith

    Farmith New Member

    Joined:
    Mar 23, 2019
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    So yeah, i've found that on quite a few occasions (Running for example the DeepDive botbase) there are instances where the bot just forgets what its doing, replicable :

    Run 2 or more toons in a group, and run POTD lvl 1-10 over and over, there will be within 1-2 runs an occasion where one, or both of the toons lose their minds and start running back and forth in place with the error "We have reached base logic, we dont know what to do!"

    When this happens, just stopping and starting the bot with the UI button works, and it continues on as it should, but is this process possible to automate? Like, can you from inside a plugin, or worst case another plugin, catch this type of thing and restart from code?

    My initial idea was if i could just call the Stop/Start methods of the DeepDungeon.cs from inside the BaseLogicHandler (for the case of POTD), but i can't seem to figure out how to actually do that since BaseLogicHandler is created inside DeepDungeon, and i have no idea how to call its parents methods from inside, or if that would even work (im sure stopping the bot would work, but would it work to start it a new too?)

    EDIT #1:
    I found that via a plugin, i can call:
    Code:
                    TreeRoot.Stop();
                    Thread.Sleep(1500);
                    BotManager.SetCurrent(BotManager.Bots.FirstOrDefault(u => u.Name.Contains("Deep Dungeon")));
                    TreeRoot.Start();
    Not even sure i need to set the current botmanager, might just work with the Stop and Start bits, but anyhew this kind of does it, however i have yet to find out how i via code can determine if we have reached the BaseLogicHandler inside the current treeroot, guessing it should somehow be detectable tho so, let's see
     
    Last edited: Mar 30, 2019

Share This Page