• Visit Rebornbuddy
  • Possible to cast a spell dependent on remaining uptime (dots / debuff / self buff )

    Discussion in 'Community Developer Forum' started by kthx, Feb 3, 2014.

    1. kthx

      kthx New Member

      Joined:
      Jan 30, 2014
      Messages:
      18
      Likes Received:
      0
      Trophy Points:
      0
      Is there any way to check for duration on a debuff to give as a condition for recast?

      So it would be like

      !Core.Player.CurrentTarget.HasAura("Disembowel") || Core.Player.CurrentTarget.HasAura("Disembowel") && Aura.Duration<"1"

      or what would be the proper code in that spot if you wanted it to start to reapply if the duration of the aura was below a certain value?

      If any one knows, please let me know, I'm trying to make some more indepth and dps maximizing rotations and this helps with dot fall offs and making sure, as a dragoon, you don't go into your main combo if thrust cd or your disembowel cd is about to be up.
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,235
      Likes Received:
      365
      Trophy Points:
      83
      If you look at kupo routine

      Code:
      public static bool HasAura(this GameObject unit, string spellname, bool isMyAura = false, int msLeft = 0)
      
      So itd be to recast when there is 300ms or less

      Code:
      Core.Player.CurrentTarget.HasAura("Disembowel",true,300) 
      
      if you have visual studio + a refrence added for rebornbuddy all this will be revealed when working on the kupo csproj
       
    3. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16

      Assuming that MS means Milliseconds i tried to test these with 5 seconds left on the Dot...

      Apply("Bio II", r => Core.Player.CurrentTarget.HasAura("Bio II", true, 5000)),
      Apply("Bio II", r => !Core.Player.CurrentTarget.HasAura("Bio II", true, 5000)),
      Apply("Bio II", r => !Core.Player.CurrentTarget.HasAura("Bio II") || Core.Player.CurrentTarget.HasAura("Bio II", true, 5000)),

      Got no results, Instead of recasting with 5 seconds left on Bio II, it recast when the Dot finished.
       
    4. kthx

      kthx New Member

      Joined:
      Jan 30, 2014
      Messages:
      18
      Likes Received:
      0
      Trophy Points:
      0
      I also used codes like that and got no result. Sorry, been busy and I thought it might have been user error as well. :(
       
    5. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,235
      Likes Received:
      365
      Trophy Points:
      83
      This is working for me

      Code:
      
      Apply("Bio II",msLeft:20000),
      
      Reapplys once it goes under 20 seconds left remaining.
       
    6. Grimmjow

      Grimmjow New Member

      Joined:
      Nov 11, 2013
      Messages:
      118
      Likes Received:
      1
      Trophy Points:
      0
      I'm unable to get the cast to happen before the dots wear off. but if i change

      return auras.Any(aura => aura.TimespanLeft.TotalMilliseconds > msLeft);

      to

      return auras.Any(aura => aura.TimespanLeft.TotalMilliseconds < msLeft);

      its seems to work.

      I'll keep trying to get the original code to work but if it doesn't i'll but a summoner routine up that needs an edit to the kuporoutine.
       
    7. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,235
      Likes Received:
      365
      Trophy Points:
      83

      HasAura's purpose is to return true if the target has an aura on it.

      Example data:

      aura.TimespanLeft.TotalMilliseconds = 13000
      Msleft = 3000

      returns true because TotalMilliseconds > msleft and it shouldn't recast.

      aura.TimespanLeft.TotalMilliseconds = 2500
      Msleft = 3000

      returns false because TotalMilliseconds < msleft and it says no aura here, go and reapply.
       
    8. Grimmjow

      Grimmjow New Member

      Joined:
      Nov 11, 2013
      Messages:
      118
      Likes Received:
      1
      Trophy Points:
      0
      Code:
       public static bool HasAura(this GameObject unit, string spellname, bool isMyAura = false, int msLeft = [B]50000[/B])
              {
                  var auras = (unit as BattleCharacter).CharacterAuras.Where(r => r.Name == spellname);
      
                  if (isMyAura)
                  {
                      auras = auras.Where(r => r.CasterId == Core.Player.ObjectId);
                  }
      
      
                  return auras.Any(aura => aura.TimespanLeft.TotalMilliseconds [B]<[/B] msLeft);
      Apply("Bio II", r => Core.Player.CurrentTarget.HasAura("Bio II", true, 3500) | !Core.Player.CurrentTarget.HasAura("Bio II",true)),

      I changed the kuporoutine and modified how i apply dots, and this seems to work. i tried other combination but i don't get the correct results.
       
    9. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,235
      Likes Received:
      365
      Trophy Points:
      83

      Apply already checks for the aura presence, your using a single OR operator which is bad as its checking both.

      Just use

      Code:
      Apply("Bio II",msLeft:20000),
      
       
    10. kthx

      kthx New Member

      Joined:
      Jan 30, 2014
      Messages:
      18
      Likes Received:
      0
      Trophy Points:
      0
      Is there any reason

      "Apply("Wind Bite",msLeft:3000, r=> Core.Player.ClassLevel >= 30),"

      seems to break the bot?

      Gives me some ArcherBard compilation issue.

      I guess my question is how do you add conditions for this? Sorry... my coding experience isnt intensive but I can understand and repurpose regular code.

      I downloaded VS but had trouble finding a way to reference RebornBuddy. Thanks for your patience.
       
    11. exaccuss

      exaccuss Active Member

      Joined:
      Nov 10, 2013
      Messages:
      1,021
      Likes Received:
      6
      Trophy Points:
      38
      Have you tried
      Code:
      Apply("Wind Bite",msLeft:3000, r=> Core.Player.ClassLevel >= 30),
      instead?
       
    12. kthx

      kthx New Member

      Joined:
      Jan 30, 2014
      Messages:
      18
      Likes Received:
      0
      Trophy Points:
      0
      The quotation marks were just to signify exactly what the code is. They aren't there in the script.
       
    13. kthx

      kthx New Member

      Joined:
      Jan 30, 2014
      Messages:
      18
      Likes Received:
      0
      Trophy Points:
      0
      I've also tried

      Cast("Impulse Drive", r => Core.Player.CurrentTarget.IsBehind && !Core.Player.CurrentTarget.HasAura("Disembowel") && Actionmanager.HasSpell("Disembowel") || Core.Player.CurrentTarget.IsBehind && !Core.Player.CurrentTarget.HasAura("Chaos Thrust,true,5000") && Actionmanager.HasSpell("Disembowel"))

      to no avail either. This dps rotation is really high and having that dot on a high uptime is vital for maximizing dps. Just curious how to make it work as well.
       
    14. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      This works for me,

      Cast("Chaos Thrust", r => Actionmanager.LastSpell.Name == "Disembowel" && !Core.Player.CurrentTarget.HasAura("Chaos Thurst", msLeft: 6000)),
      Cast("Disembowel", r => Actionmanager.LastSpell.Name == "Impulse Drive" && !Core.Player.CurrentTarget.HasAura("Disembowel", msLeft: 6000)),
      Cast("Impulse Drive", r => Core.Player.CurrentTarget.IsBehind && !Core.Player.CurrentTarget.HasAura("Disembowel", msLeft: 6000)),

      This all depends on your skill speed to make it work,

      && !Core.Player.CurrentTarget.HasAura("Chaos Thurst", msLeft: 6000)),
      && !Core.Player.CurrentTarget.HasAura("Disembowel", msLeft: 6000)),

      This is probably unnecessary, but it's in there for good measure, i will also probably have to add in True at some point to make it work with multiple dots on the target, my 50 Dragoon profile is almost done but needs some touch ups
       
    15. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,235
      Likes Received:
      365
      Trophy Points:
      83

      You should be using:

      Code:
      Apply("Chaos Thurst",r => Actionmanager.LastSpell.Name == "Disembowel",msLeft: 6000),
      Apply("Disembowel",r => Actionmanager.LastSpell.Name == "Impulse Drive",msLeft: 6000),
      
       
    16. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      awesome, that cleans up a lot of my syntax
       
    17. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      Problem i am having with this is if Multiple Disembowel is on the same target, should i add a true somewhere?

      Apply("Chaos Thrust", r => Actionmanager.LastSpell.Name == "Disembowel", msLeft: 6000),
      Cast("Full Thrust", r => Actionmanager.LastSpell.Name == "Vorpal Thrust"),
      Apply("Disembowel", r => Actionmanager.LastSpell.Name == "Impulse Drive", msLeft: 6000),
      Cast("Vorpal Thrust", r => Actionmanager.LastSpell.Name == "True Thrust"),
      Cast("Impulse Drive", r => Core.Player.CurrentTarget.IsBehind && !Core.Player.CurrentTarget.HasAura("Disembowel", msLeft: 6000)),
      Cast("True Thrust", r=> true)
       
    18. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,235
      Likes Received:
      365
      Trophy Points:
      83
      Core.Player.CurrentTarget.HasAura("Disembowel",true, msLeft: 6000)
       

    Share This Page