• Visit Rebornbuddy
  • Healing

    Discussion in 'Rebornbuddy Support' started by Nizaden, Feb 16, 2014.

    1. Nizaden

      Nizaden New Member

      Joined:
      Nov 3, 2013
      Messages:
      62
      Likes Received:
      0
      Trophy Points:
      0
      Please add support for healing in routines! I know your working on world meshing etc but party healing for White Mage and Scholar is a feature greatly over looked in the routine section.
       
    2. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      The API currently has everything needed to make a healbot. I'm working on this but I have limited programming knowledge and i'm progressing slowly.
       
    3. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      yea, i am slowly learning Visual Studio, just need to figure out the proper code for casting heals on party members,
      Also... Under ff14bot.Managers.PartyMember I noticed CurrentHealth but no CurrentHealthPercent. This would be really useful...
      But then again i don't know shit about VS so any help is appreciated.
       
    4. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      I've learned a lot about programming in general and C# since I started trying to make routines, learning the basics makes the biggest difference. The Reborn Console plugin is also amazing. The following code is commented so you can see what each line does...

      Code:
                  //Loops through every VISIBLE object in the objectmanager.
                  foreach (GameObject a in GameObjectManager.GameObjects.Where(u => u.IsVisible))
                  { 
                      //For each party member in our party manager
                      foreach (PartyMember b in PartyManager.AllMembers)
                      {
                          //If one of our party members matches an object in the object manager...
                          if (a == b.GameObject)
                              //Use the object as character to display the info we want in the log.
                              Log((a as Character).Name + "    " + (a as Character).CurrentHealthPercent + "    " + (a as Character).CurrentManaPercent);
                      }
                  }
      
      I've only just started getting into C# so there's probably a better way, but I don't know it. Essentially i'm using 2 foreach loops, 1 to go through all visible game objects and 1 to go through all our current party members. If a party member matches an object I use the object as character (using this gives me access to all the info I want, including percentages) and display some info in the log. Instead of writing info to the log I could just as easily do ...

      Code:
                  foreach (GameObject a in GameObjectManager.GameObjects.Where(u => u.IsVisible))
                  { 
                      foreach (PartyMember b in PartyManager.AllMembers)
                      {
                          if (a == b.GameObject && (a as Character).CurrentHealthPercent < 90 && !(a as Character).HasAura("Regen"))
                              Actionmanager.DoAction("Regen", a);
                      }
                  }
      
      This should use Regen on someone in our party who currently doesn't have it on them and has less than 90% health, I haven't tested it but it should work. You can try writing the first block of code in the Reborn Console to see if it works for you, from there you can alter it and have it do whatever you'd like.

      To get percent from PartyMembers, you would need to do something like this ...

      Code:
      var HealthPercent = (PartyMember.CurrentHealth / PartyMember.MaxHealth) * 100;
      
      Obviously all that does is divide the party member's current health from the max health and multiplies it by 100, the issue i've had is that using this, it always returns either 0 or 100. Using objects as character is the only way I was successful.

      I hope this was enough to lead you in the right direction. I'd like this community to grow and help each other out, I certainly know i'll need the help.
       
    5. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      Thank you, this is very useful, i will do more research into this and see how i can make it all work together
       

    Share This Page