• Visit Rebornbuddy
  • Getting OldRoutine to Cast Vaal Skill on Rare/Boss encounter

    Discussion in 'Archives' started by lyvewyre, Sep 15, 2015.

    1. lyvewyre

      lyvewyre Member

      Joined:
      Jan 3, 2013
      Messages:
      418
      Likes Received:
      12
      Trophy Points:
      18
      Hi All,

      I've been trying to set OR up to only use Vaal skill on encountering a rare. I tried following the recommendation from here:

      https://www.thebuddyforum.com/exile...bot-vaal-skills-rare-mobs.html?highlight=Vaal

      But where I believe I am meant to slot cachedRarity >= Rarity.Rare into isn't working:

      Code:
      
      if ((skill.SkillTags.Contains("aura") && !skill.SkillTags.Contains("vaal")) || IsAuraName(skill.Name))
      						{
      							if ([B]!LokiPoe.Me.HasAura(skill.Name) && skill.CanUse(OldRoutineSettings.Instance.DebugAuras, true)[/B])
      							{
      								var doCast = true;
      
      								while (skill.Slot == -1)
      								{
      									Log.InfoFormat("[Logic] Now assigning {0} to the skillbar.", skill.Name);
      
      									var sserr = LokiPoe.InGameState.SkillBarPanel.SetSlot(_auraSlot, skill);
      
      									if (sserr != LokiPoe.InGameState.SetSlotError.None)
      									{
      										Log.ErrorFormat("[Logic] SetSlot returned {0}.", sserr);
      
      										doCast = false;
      
      										break;
      									}
      
      									await Coroutine.Sleep(Utility.LatencySafeValue(1000));
      								}
      
      								if (!doCast)
      								{
      									continue;
      								}
      
      								await Coroutines.FinishCurrentAction();
      
      								await Coroutine.Sleep(Utility.LatencySafeValue(1000));
      
      								var err1 = LokiPoe.InGameState.SkillBarPanel.Use(skill.Slot, false);
      								if (err1 == LokiPoe.InGameState.UseError.None)
      								{
      									await Coroutine.Sleep(Utility.LatencySafeValue(250));
      
      									await Coroutines.FinishCurrentAction(false);
      
      									await Coroutine.Sleep(Utility.LatencySafeValue(500));
      
      									return true;
      								}
      
      								Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
      							}
      						}
      					}
      I tried if (!LokiPoe.Me.HasAura(skill.Name) && skill.CanUse(OldRoutineSettings.Instance.DebugAuras, true) && cachedRarity >= Rarity.Rare) but I get the following error:

      Compiler Error: warning CS2029: Invalid value for '/define'; '' is not a valid identifier
      Compiler Error: ...\Routines\OldRoutine\OldRoutine.cs(1279,109) : error CS0841: Cannot use local variable 'cachedRarity' before it is declared

      Can anyone enlighten me as to where I am going wrong?
       
      Barba likes this.
    2. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      Cannot use local variable 'cachedRarity' before it is declared

      Place the snippet after the variables declaration.
       
    3. lyvewyre

      lyvewyre Member

      Joined:
      Jan 3, 2013
      Messages:
      418
      Likes Received:
      12
      Trophy Points:
      18
      Yep, found it. Cheers for that Tony.

      Code:
      // Auto-cast any vaal skill at the best target as soon as it's usable.
      				if (OldRoutineSettings.Instance.AutoCastVaalSkills && _vaalStopwatch.ElapsedMilliseconds > 1000)
      				{
      					foreach (var skill in LokiPoe.InGameState.SkillBarPanel.Skills)
      					{
      						if (skill.SkillTags.Contains("vaal"))
      						{
      							[B]if (skill.CanUse() && cachedRarity >= Rarity.Rare)[/B]
      							{
      								await DisableAlwaysHiglight();
      
      								var err1 = LokiPoe.InGameState.SkillBarPanel.UseAt(skill.Slot, false, cachedPosition);
      								if (err1 == LokiPoe.InGameState.UseError.None)
      								{
      									await Coroutine.Sleep(Utility.LatencySafeValue(250));
      
      									await Coroutines.FinishCurrentAction(false);
      
      									await Coroutine.Sleep(Utility.LatencySafeValue(250));
      
      									return true;
      For those who stumble across the same thing.
       
      Barba likes this.
    4. solopro16

      solopro16 Member

      Joined:
      Sep 1, 2016
      Messages:
      36
      Likes Received:
      0
      Trophy Points:
      6
      hello i want use ****Vaal Righteous Fire , can someone help me add code for meele use vaal gem ??? thank you
       

    Share This Page