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

Mines don't work with OldRoutine

widds

Member
Joined
Nov 12, 2014
Messages
316
Reaction score
3
The logic is present..

Code:
if (_mineSlot == -1 && _mineStopwatch.ElapsedMilliseconds >
					OldRoutineSettings.Instance.MineDelayMs &&
					myPos.Distance(cachedPosition) < OldRoutineSettings.Instance.MaxMeleeRange)
				{
					var skill = LokiPoe.InGameState.SkillBarHud.Slot(_mineSlot);
					var max = skill.GetStat(StatTypeGGG.SkillDisplayNumberOfRemoteMinesAllowed);
					var insta = skill.GetStat(StatTypeGGG.MineDetonationIsInstant) == 1;
					if (skill.NumberDeployed < max && skill.CanUse())
					{
						await DisableAlwaysHiglight();

						await Coroutines.FinishCurrentAction();

						var err1 = LokiPoe.InGameState.SkillBarHud.Use(_mineSlot, true);

						if (err1 == LokiPoe.InGameState.UseResult.None)
						{
							await Coroutines.LatencyWait();

							await Coroutines.FinishCurrentAction(false);

							if (!insta)
							{
								await Coroutines.LatencyWait();

								LokiPoe.Input.SimulateKeyEvent(LokiPoe.Input.Binding.detonate_mines, true, false, false);
							}

							_mineStopwatch.Restart();

							return true;
						}

						_mineStopwatch.Restart();

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

However, no matter what combination of settings I try in OldRoutine settings it does one of two things: 1) spams the mine (even if it has reached max deployable) and never detonates, or 2) if I set everything to -1 after starting the bot it works sometimes normally, but gets stuck if anything is at a certain range and won't use any skills (spams there are no skills to use) until the mob wanders within range.
 
Code wise, it's not detonating because there's a client delay now between when you can detonate after placing.

If you make

Code:
if (!insta)
{
	await Coroutines.LatencyWait();
	LokiPoe.Input.SimulateKeyEvent(LokiPoe.Input.Binding.detonate_mines, true, false, false);
}

into

Code:
if (!insta)
{
	await Coroutines.LatencyWait();
        await Coroutine.Sleep(500);
	LokiPoe.Input.SimulateKeyEvent(LokiPoe.Input.Binding.detonate_mines, true, false, false);
}

That should be good enough to place the mine, wait, then detonate.

OldRoutine is not catered to using mines as a main skill though, and will only use them in melee range when the user cooldown isn't elapsed.

You'll want a custom routine that specializes in mine if you want to use them as your main skill.

OldRoutine wise, if you:
- Set fallback slot to your move only skill.
- Change all other slots to -1
- Increase max melee range to say 30
- Change MineDelayMs to 1
- Ensure you have your mine on the skill bar

You should end up with a behavior of moving into melee range, dropping a mine, waiting then detonating. You can play with the 500 to find something that works a bit better for you though.
 
Back
Top