• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • How do you stop the botbase's logic temporarily as a plugin?

    Discussion in 'Community Developer Forum' started by Neverdyne, Dec 20, 2014.

    1. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      649
      Likes Received:
      18
      Trophy Points:
      18
      Just a quick question, probably answered somewhere that I might have missed. Is there a way for a plugin to stop the bot base completely, do something on its own (like using the navigator and other API stuff) and then resume the botbase? What's the cleanest way to do this?
       
    2. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      Can't you just hook it? I don't know about cutting it off completely, maybe treeroot? But you could kill it early.

      You could hook into precombat logic and return true which would cut off the rest of the botbases logic below that. which I believe would include movement.
       
    3. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      AFAIK plugins are run before the main BotBase logic anyway, so I think a hook isn't necessary.

      I think if you always return true with your composite in your plugin, nothing below it would call. Something like:

      Code:
      return new PrioritySelector(
                      new Decorator(ret => ShouldStopbotbase,
                          new Action(r =>
                          {
                              Your logic here or in more priority selectors
                          }
                          ),
                          new ActionAlwaysSucceed()
                      )
                  );
       
    4. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      I assume your using treehooks. If you reach a actionalwaysucced then it wont go any further down a priorityselector which is what the main logic uses.
       
    5. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      649
      Likes Received:
      18
      Trophy Points:
      18
      Thanks. I know about the action succeed thing, but my question is more about where should I hook it? What I would like to achieve is to take control off FateBot for a while, do something with navigation and stuff, then give FateBot control again. But this must happen even if FateBot is outside of combat waiting in a town. What I want to guarantee is that FateBot won't do something while the plugin is in control.
       
    6. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      TreeStart

      or

      PoiAction


      also make sure to use insert.
       

    Share This Page