• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Looking to reduce the minimum distance to mount & help with plugin coding

    Discussion in 'Honorbuddy Support' started by kazzo, Nov 18, 2016.

    1. kazzo

      kazzo New Member

      Joined:
      Nov 18, 2016
      Messages:
      8
      Likes Received:
      0
      Trophy Points:
      0
      Hello!

      I want to reduce the minimum distance bot will mount on GB2, because currently the bot is running on foot alot , (i've tried tweaking the hotspot distance).

      Also, im currently using the plugin Herbalism Tweaks (https://www.thebuddyforum.com/honor...-tweaks-disable-combat-perfect-foxflower.html) where im using combat disabled above 30% HP, im looking to tweak it that i enable combat when dismounted, and instantly mount when im leaving combat.

      If anyone would be so kind to help me or guide me in the right direction with these problems it would be greatly appreciated, I have some C# experience so i can do some coding myself I just have no clue where to start :)

      Cheers, Kazzo
       
    2. VanRookie

      VanRookie Member

      Joined:
      Sep 7, 2016
      Messages:
      30
      Likes Received:
      0
      Trophy Points:
      6
      The "flags" you're looking for are:

      PHP:
      Me.IsActuallyInCombat == false && Me.Mounted == false
      Now, in questing profiles I use this:

      PHP:
            <While Condition="Me.Mounted == false">
              <
      CustomBehavior File="RunCode" Code="mountStuck = mountStuck + 1;" />
              <If 
      Condition="mountStuck &gt;=1">
                <
      CustomBehavior File="Misc\RunLua" Lua="MoveForwardStart();" WaitTime="1000" />
              </If>
                <
      CustomBehavior File="ForcedMount" />
            </While>
      The first part is optional, I do it because sometimes the bot gets stuck in an infinite loop trying to mount below an object which instantly dismounts you (when the mount is too big).

      Anyway, you need something similar for C#, maybe a function rather than a custom behavior. Good luck.
       
    3. kazzo

      kazzo New Member

      Joined:
      Nov 18, 2016
      Messages:
      8
      Likes Received:
      0
      Trophy Points:
      0
      Thanks! I'm just playing with it a bit so far I've come up with this

      PHP:
      using Styx.CommonBot.Mount;
      //other using

         
      public override void Pulse()
              {
              if(!
      Me.Mounted && !Me.Combat){
              
      Mount.SummonMount(); //not working
                      
      Me.SummonMount(); // not working
              
      }
               }
      only I cant get it to summon the mount. For the stuck part ill just go simple I think and make it try to mount up 3 times and after that stop trying to mount up.

      If anyone wants to help it's much appreciated.. ill keep searching in the meanwhile :)
       
    4. VanRookie

      VanRookie Member

      Joined:
      Sep 7, 2016
      Messages:
      30
      Likes Received:
      0
      Trophy Points:
      6
      Take a look at the ForcedMount.cs file in your Quest Behaviors. This is the actual code that mounts you:

      PHP:
              private Composite CreateActualBehavior()
              {
                  return new 
      PrioritySelector(
                      new 
      Decorator(
                          
      ret => MountType == ForcedMountType.Ground,
                          new 
      ActionRunCoroutine(ret => UtilityCoroutine.ExecuteMountStrategy(MountStrategyType.MountStyx.NavType.Run))),

                      new 
      Decorator(
                          
      ret => MountType == ForcedMountType.Flying,
                          new 
      ActionRunCoroutine(ctx => MountForFlying()))
                      );
              }
       
    5. kazzo

      kazzo New Member

      Joined:
      Nov 18, 2016
      Messages:
      8
      Likes Received:
      0
      Trophy Points:
      0
      Thanks a lot again for your input, I've looked at the class but can't seem to get it to work this way. Nevertheless I got it working
      PHP:
      if(triedMounting == false)
                  {
                          
      WoWMovement.MoveStop();
                          
      Thread.Sleep(500);
                          
      Lua.DoString("RunMacroText(\"/run C_MountJournal.SummonByID(0)\")");
                          
      Thread.Sleep(1000);
                          
      Navigator.PlayerMover = new ClickToMoveMover();
                          
      triedMounting true;
      }
      It's not all but I think you can see how I managed it :) It's quite messy code... but it works for 9/10 cases and doesn't get stuck wich is fine for me !

      I've found some documentation (Honorbuddy Namespaces) but it's hard for me to work with it because it seems incomplete, I've also tried decompiling the bot but I figure that's not possible. How do people manage to write these big plugins? only with the docs?
       

    Share This Page