• Visit Rebornbuddy
  • Start a specific bot from a plugin

    Discussion in 'Archives' started by fpsware, Apr 12, 2011.

    1. fpsware

      fpsware Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      5,287
      Likes Received:
      133
      Trophy Points:
      63
      I'm sure this is easy enough but I simply don't have a clue where to look for this. How do I tell HB to select a specific bot (this will be done from a plugin while HB).

      Eg if HB is Grinding, how do I tell it to select the Questing bot?
       
    2. chinajade

      chinajade Well-Known Member Moderator Buddy Core Dev

      Joined:
      Jul 20, 2010
      Messages:
      17,540
      Likes Received:
      172
      Trophy Points:
      63
      Hi, fpsware,

      You disappoint us--we thought you knew everything! <smirk>

      I haven't tried this for certain, but something like?...
      HTML:
      Dictionary<string, BotBase>    bots = Styx.BotManager.Instance.GetBots();
      
      Styx.BotManager.Instance.SetCurrent(bots["Questing"]);
      
      I've left out the error checking for brevity. CharacterSettings also has a value...
      CharacterSettings.Instance.SelectedBotIndex​

      ...but there's the problem of mapping the desired bot to its bot index. I'm uncertain which one is the preferred technique, or perhaps there are other techniques.

      cheers,
      chinajade
       
    3. fpsware

      fpsware Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      5,287
      Likes Received:
      133
      Trophy Points:
      63
      Thanks. I had already played around with the BotIndex but had been unable to find the string name of the bot. I'll have another look and see what damage I can do :)
       
    4. fpsware

      fpsware Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      5,287
      Likes Received:
      133
      Trophy Points:
      63
      Dictionary<string, BotBase> bots = BotManager.Instance.GetBots();
      BotManager.Instance.SetCurrent(useFlyingMount.Checked ? bots["Questing"] : bots["Grind bot"]);

      Thats exactly what I wanted. Thanks for your help.
       

    Share This Page