• Visit Rebornbuddy
  • API wish list.

    Discussion in 'Community Developer Forum' started by Exmortem, Feb 2, 2014.

    1. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      CurrentEorzeaTime()
      Teleport("string or id")

      If possible, thank you for all your hard work.
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,229
      Likes Received:
      364
      Trophy Points:
      83
      Teleportation is going to take some work due to how crazy they sort the list, current time ill take a look at.
       
    3. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Thanks man!
       
    4. kazaak

      kazaak New Member

      Joined:
      Feb 1, 2014
      Messages:
      8
      Likes Received:
      0
      Trophy Points:
      0
      // the following porting code worked for me in my test

      var locationsToPort = ff14bot.Managers.WorldManager.AvalibleLocations;
      ff14bot.Managers.WorldManager.Teleport(locationsToPort[0].Name);
       
    5. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,229
      Likes Received:
      364
      Trophy Points:
      83

      You can use partial matchs.

      ff14bot.Managers.WorldManager.Teleport("limsa");
       
    6. kazaak

      kazaak New Member

      Joined:
      Feb 1, 2014
      Messages:
      8
      Likes Received:
      0
      Trophy Points:
      0
      Can you add CurrentRegion to ff14bot.Core.Me or ff14bot.Managers.WorldManager?
       
    7. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,229
      Likes Received:
      364
      Trophy Points:
      83
      Added to the todo list.
       
    8. greate

      greate New Member

      Joined:
      Mar 11, 2014
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      Could you do proper polling or make it so that the api doesn't recreate the info everytime you poll the api. Makes it a lot harder to code plugins when I have to figure out polling instead of the already built api that has most of that info.
       
    9. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,229
      Likes Received:
      364
      Trophy Points:
      83

      What?
       
    10. greate

      greate New Member

      Joined:
      Mar 11, 2014
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      Your currently fetch the most current values from memory when a consumer requests them. For example, if I do:

      Code:
       PartyManager.AllMembers 
      I receive the latest copy from memory -- this is desirable in some cases but it requires myself to implement my own polling. This means if I ask for the value now, assign it a UserControl and have it monitor that reference, I can't do that. This is because the value is only updated when I make an explicit call to the getter. This causes two complications:

      1: The data isn't being updated in the background by anything. Is this by design, and up to the author to solve?
      2: This means data binding cannot possibly work. This is because nothing is ever truly changed.
       
    11. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,229
      Likes Received:
      364
      Trophy Points:
      83
      We do caching at the memory library level. The bot caches data for 1 tick and then clears the cache. If the bot is not 'started' then youll run into issues where youll get objects that don't update. If your storing the object results from the partymanager you can work around this by wrapping where you update the fields with
      Code:
      
                              using (Core.Memory.TemporaryCacheState(true))
                              {
      somefield = PartyMemberobj.CurrentHealth;
      }
      
       
    12. greate

      greate New Member

      Joined:
      Mar 11, 2014
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      Ah. Great! Thank you very much for that info. Much appreciated.
       
    13. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Can you post an example of how you databinded partymanager to a user control please?
       
    14. greate

      greate New Member

      Joined:
      Mar 11, 2014
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      example this quick a dirty.
      Code:
      using System.Windows.Forms;
      using ff14bot.Managers;
      
      namespace Reborn_Healer.Controls
      {
          public partial class test : UserControl
          {
              private PartyMember _member;
      
              public void DataBind()
              {
                  progressBar1.DataBindings.Add("Maximum", Member, "MaxHP");
                  progressBar1.DataBindings.Add("Value", Member, "CurrentHP");
              }
      
              public test(PartyMember member)
              {
                  _member = member;
                  InitializeComponent();
              }
      
              public PartyMember Member
              {
                  get { return _member; }
                  set { Member = value; UpdateUI(); }
              }
      
              public void UpdateUI()
              {
                  DataBind();
              }
          }
      }
      
      
      That's a user control I built. What you will have to do on your main winform, is to pass in the information for the member your tryin to poll and have that information poll through a Timer and looping through partymanager to check for updates. Cant provide the winform part cause I Decided to do something completely different now and rewrote a lot of code now. But basically youll need a for loop to check for each member and if you make a user control you could pass in info to each user control on demand and update each user control on the fly for each member.
       
    15. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      I'm trying to understand and learn this, i'm currently using this to update my form - it works for the first tick but then doesn't constantly update the progress bar with my health.

      Code:
              public void OnPulse()
              {
                  UpdateForm();
              }
      
      
              public void UpdateForm()
              {
                  if (Core.Me.InCombat)
                  {
                      using (Core.Memory.TemporaryCacheState(true))
                      {
                          MethodInvoker action = () => _form.progressBar1.Value = (int)Core.Me.CurrentHealthPercent;
                          _form.BeginInvoke(action);
                      }
                  }
              }
      
      I'm just trying to get a form updated in real time with info from the game.
       
    16. greate

      greate New Member

      Joined:
      Mar 11, 2014
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      are you doing that inside of the one .cs file that inherits the main plugin? I tried to keep those separated. I sent you a Skype request easier to chat on there then forums lol. But what I can do is fix your code to bare minimal of what you want your form or w/e to do atm and zip it up and put on forums ill edit it and get It running for ya so you can see the code. Then you can go from there.
       
    17. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Damn man, if you could do that that would be awesome.
       
    18. greate

      greate New Member

      Joined:
      Mar 11, 2014
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      Well upload your current code. So I can take a look at it.
       
    19. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      This is all i'm trying to do right now, keep a progressbar updated with my current health. So this is just a bare plugin with a simple form.
       

    Share This Page