• Visit Rebornbuddy
  • Swiftcast issue

    Discussion in 'Community Developer Forum' started by stewiethecat, Feb 22, 2014.

    1. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      I have been trying to get Flare to go off after Swiftcast, i have had no luck with these,

      Code:
      Cast("Swiftcast", r => Core.Player.CurrentMana <= 904, r => Core.Player),
      Cast("Flare", r => Actionmanager.LastSpell.Name == "Swiftcast"),
      Cast("Convert", r => Actionmanager.LastSpell.Name == "Flare"),
      Code:
      Cast("Swiftcast", r => Core.Player.CurrentMana <= 904, r => Core.Player),
      Cast("Flare", r => Core.Player.HasAura("Swiftcast")),
      Cast("Convert", r => Actionmanager.LastSpell.Name == "Flare"),
      If i do,

      Code:
      Cast("Swiftcast", r => Core.Player.CurrentMana <= 904, r => Core.Player),
      Cast("Flare"),
      Cast("Convert", r => Actionmanager.LastSpell.Name == "Flare"),
      it will work, but will continuously cast Flare which is unwanted for obvious reasons,

      I believe the issue is, RB is trying to Cast the next part of the rotation before it recognizes that my character has the Swiftcast aura. Anyone have any suggestions, or proper code to work around this?

      Also... Is there any way i can implement a line of code so Flare will only cast, if Convert is readily available?
       
    2. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Code:
                       new Decorator(ret => {
                           if (!Actionmanager.CanCast("Convert", Core.Player))
                               return false;
                           return true;
                       },
                       new Sequence(
                             new Action(ret => { Actionmanager.DoAction("Swiftcast", Core.Player); }),
                             new WaitContinue(2, ret => false, new ActionAlwaysSucceed()),
                             //Swiftcast Flare
                             new Decorator(ret => { if (MovementManager.IsMoving) return false; return true; },
                             new Action(ret => { Actionmanager.DoAction("Flare", Core.Player.CurrentTarget); })),
                             new WaitContinue(2, ret => false, new ActionAlwaysSucceed()),
                             new Action(ret => { Actionmanager.DoAction("Convert", Core.Player); })
                           )),
      
      Put that instead of the ..

      Code:
      Cast("Swiftcast", r => Core.Player.CurrentMana <= 904, r => Core.Player),
      Cast("Flare"),
      Cast("Convert", r => Actionmanager.LastSpell.Name == "Flare"),
      
       
    3. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      thanks for the reply, i am getting this error at launch

      Code:
      [20:18:10.948 D] Reloading AssemblyLoader<ff14bot.Interfaces.IBotPlugin> - Initializing
      [20:18:11.306 D] Reloading AssemblyLoader<ff14bot.Interfaces.ICombatRoutine> - Initializing
      [20:18:11.636 D] Compiler Error: c:\Users\Desktop\Games\RB\Routines\Kupo\KupoRoutine.cs(14,7) : warning CS0105: The using directive for 'Kupo.Settings' appeared previously in this namespace
      [20:18:11.636 D] Compiler Error: c:\Users\Desktop\Games\RB\Routines\Kupo\Rotations\A Routine of Ice and Fire.cs(108,62) : error CS0246: The type or namespace name 'ActionAlwaysSucceed' could not be found (are you missing a using directive or an assembly reference?)
      [20:18:11.636 D] Compiler Error: c:\Users\Desktop\Games\RB\Routines\Kupo\Rotations\A Routine of Ice and Fire.cs(112,62) : error CS0246: The type or namespace name 'ActionAlwaysSucceed' could not be found (are you missing a using directive or an assembly reference?)
      I know my code is sloppy as hell, this was my first written Routine and i will be cleaning this up, I'm not sure if it was the way i implemented the code you gave me, i see that ActionAlwaysSucceed is a Member of ff14bot.Behavior, so here is my Routine as is, with the Code you gave me
       
    4. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Add
      Code:
      using ff14bot.Behavior;
      at the top of the CC where all the other references are.
       
    5. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      so thats how that works, thanks for the help man, you saved me hours of eye bleeding research.
       
    6. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Np man, I don't know if there's a better way, it's just the only way i've gotten it to work with.
       
    7. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      is there any want to add something like

      new Action(ret => { Actionmanager.DoAction("Swiftcast", r => Core.Player.CurrentMana >= 904, Core.Player); }),

      tried to add in Core.Player.CurrentMana >= 904 a few different ways with no luck, the point of this is so swiftcast/flare/convert is only used when below a certain amount of mana
       
    8. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Code:
       new Decorator(ret => {
                           if (!Actionmanager.CanCast("Convert", Core.Player))
                               return false;
      
                           if (Core.Player.CurrentMana >= 904)
                               return false;
      
                           return true;
                       },
                       new Sequence(
                             new Action(ret => { Actionmanager.DoAction("Swiftcast", Core.Player); }),
                             new WaitContinue(2, ret => false, new ActionAlwaysSucceed()),
                             //Swiftcast Flare
                             new Decorator(ret => { if (MovementManager.IsMoving) return false; return true; },
                             new Action(ret => { Actionmanager.DoAction("Flare", Core.Player.CurrentTarget); })),
                             new WaitContinue(2, ret => false, new ActionAlwaysSucceed()),
                             new Action(ret => { Actionmanager.DoAction("Convert", Core.Player); })
                           )),
      
      Added

      Code:
                           if (Core.Player.CurrentMana >= 904)
                               return false;
      
      to the decorator. The decorator evaluates certain conditions that you specify and returns either true or false, if true is returned then it moves onto the action, if not it skips to the next item in the PrioritySelector.
       
    9. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      I'm understanding the code more and more, but for some reason when

      Code:
                           if (Core.Player.CurrentMana >= 904)
                               return false;
      
      is added, it stopped working all together. I will play around with this more and see if i can come up with something
       
    10. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Actually less than 904 mana would be ...

      Code:
      Core.Player.CurrentMana <= 904
      
       
    11. stewiethecat

      stewiethecat Member

      Joined:
      Feb 4, 2011
      Messages:
      454
      Likes Received:
      0
      Trophy Points:
      16
      Correct!
      For some reason it won't activate swiftcast unless i start to move. Other than that everything else is in order.
       

    Share This Page