What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Enduring Cry Issue

zhenk

Member
Joined
Jun 12, 2012
Messages
101
Reaction score
0
So my routine casts Enduring Cry every 4 seconds while my endurance charges stay up for 10 seconds. I'd like to alter the code to make it cast Enduring Cry every 8 or 10 seconds so there's less of a hiccup while in combat.

I only have minimal C++ knowledge and could use some help.
 
That would be awsome, can anyone help with that ?

I won't say it's working (not tested) neither explain what it does or how it works, but this should do the trick :

PHP:
	if (_enduringCrySlot != -1)
	{
		// See if we can use the skill.
		var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_enduringCrySlot);
		var endCharges = LokiPoe.Me.Auras.FirstOrDefault(a => a.InternalName.ToLower().Contains("endurance"));
		Func<bool> eCryCondition = () => endCharges == null || endCharges.TimeLeft.Seconds <= 3; // this is what you need to consider

		if (_enduringCrySlot != -1)
		{
			// See if we can use the skill.
			var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_enduringCrySlot);
			if (skill.CanUse())
			{
				if (eCryCondition.Invoke()) // This magically returns true if eCryCondition matches one of the 2 written above
				{
					if (Utility.NumberOfMobsNear(LokiPoe.Me, 30) > 0)
					{
						var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_enduringCrySlot, true);
						if (err1 == LokiPoe.InGameState.UseError.None)
						{
							await Coroutine.Sleep(Utility.LatencySafeValue(500));

							await Coroutines.FinishCurrentAction(false);

							return true;
						}

						Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
					}
				}
			}
		}
	}

// EDIT //

If it's not working, copy the error, if it's not detecting the endurance charges, dump player auras while having and endurance charge, tyvm
Tbh, just shat this in less than a minute, it might throw errors sometimes
 
Last edited:
Wish I was able to shit codes... only comes out gold once a while..

Thank you for the contribution toNyx :)
 
Back
Top