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

Custom movement skills trouble

zeronomous

New Member
Joined
Sep 18, 2015
Messages
2
Reaction score
0
Heya!

I was hoping one of you exilebuddy pro's could give a little guidance on custom movement skills (in this case, whirling blades). I've searched the forums over and tried a couple of plugin's released, and placed them into the plugins folder, only to have the beta bot read errors on boot and not load them. I was unable to find much information on the subject after looking around.

I'm not terribly familiar with the coding aspect of the bot itself, and was wondering how you could set the bot to move with whirling blades instead of walking, or another movement based skill. Thanks ahead!

PS. on a random note, was also playing with the itemfilter, and managed to tweak something incorrectly (doesn't seem to pickup quality gems anymore), and was curious if you could reset it.
 
Dont have a plugin for custom movement working right now...Its like a dream... :(
 
Well, that's kind of a bummer :/, but thanks for the info. The last coding bit i did was a fairly serious stint with y2jsp and Yamb way back in the day, so I doubt I'd be able to do anything on my end (but will give it a shot). Any plan's for this implemented into the bot itself anytime soon? I know it's got to be a pain just keeping up with these rolling updates.
 
Here's two examples of player movers using skills that I was testing some stuff with.
Code:
	/// <summary>
	/// A player mover instance that uses Lightning Warp when it's not on cooldown to move faster.
	/// </summary>
	public class LightningWarpPlayerMover : IPlayerMover
	{
		private static readonly ILog Log = Logger.GetLoggerInstanceForType();
		private readonly IPlayerMover _corePlayerMover;
		private readonly Stopwatch _castStopwatch = Stopwatch.StartNew();

		/// <summary>
		/// Assigns the current PlayerMover instance to one of this type.
		/// </summary>
		public static void Activate()
		{
			if (PlayerMover.Instance is LockstepPlayerMover || PlayerMover.Instance is PredictivePlayerMover)
			{
				PlayerMover.Instance = new LightningWarpPlayerMover(PlayerMover.Instance);
			}
			else
			{
				Log.ErrorFormat(
					"[LightningWarpPlayerMover] LightningWarpPlayerMover.Activate only works when the current PlayerMover instance is LockstepPlayerMover or PredictivePlayerMover.");
			}
		}

		internal LightningWarpPlayerMover(IPlayerMover corePlayerMover)
		{
			_corePlayerMover = corePlayerMover;
		}

		/// <summary>
		/// Attempts to move towards a position. This function will perform pathfinding logic and take into consideration move distance
		/// to try and smoothly move towards a point.
		/// </summary>
		/// <param name="position">The position to move towards.</param>
		/// <param name="user">A user object passed.</param>
		/// <returns>true if the position was moved towards, and false if there was a pathfinding error.</returns>
		public bool MoveTowards(Vector2i position, params dynamic[] user)
		{
			var myPos = LokiPoe.Me.Position;
			if (myPos.Distance(position) < 50)
			{
				return _corePlayerMover.MoveTowards(position, user);
			}

			if (_castStopwatch.ElapsedMilliseconds > 500)
			{
				var skill = LokiPoe.Me.SkillBarSkills.FirstOrDefault(s => s.Name == "Lightning Warp");
				if (skill != null)
				{
					if (skill.CanUse())
					{
						var err = LokiPoe.InGameState.SkillBarPanel.UseAt(skill.Slot, false,
							myPos.GetPointAtDistanceAfterThis(position, 50));
						if (err != LokiPoe.InGameState.UseError.None)
						{
							Log.ErrorFormat("[LightningWarpPlayerMover] Use returned {0}.", err);
						}

						var lat = LatencyTracker.AverageLatency*2;
						using (LokiPoe.Memory.ReleaseFrame(LokiPoe.UseHardlock))
						{
							Thread.Sleep(lat);
						}

						_castStopwatch.Restart();
                    }
				}
			}

			return _corePlayerMover.MoveTowards(position, user);
		}
	}

	/// <summary>
	/// A player mover instance that uses Phase Run when it's not on cooldown to move faster.
	/// </summary>
	public class PhaseRunPlayerMover : IPlayerMover
	{
		private static readonly ILog Log = Logger.GetLoggerInstanceForType();
		private readonly IPlayerMover _corePlayerMover;

		/// <summary>
		/// Assigns the current PlayerMover instance to one of this type.
		/// </summary>
		public static void Activate()
		{
			if (PlayerMover.Instance is LockstepPlayerMover || PlayerMover.Instance is PredictivePlayerMover)
			{
				PlayerMover.Instance = new PhaseRunPlayerMover(PlayerMover.Instance);
			}
			else
			{
				Log.ErrorFormat(
					"[PhaseRunPlayerMover] Activate only works when the current PlayerMover instance is LockstepPlayerMover or PredictivePlayerMover.");
			}
		}

		internal PhaseRunPlayerMover(IPlayerMover corePlayerMover)
		{
			_corePlayerMover = corePlayerMover;
		}

		/// <summary>
		/// Attempts to move towards a position. This function will perform pathfinding logic and take into consideration move distance
		/// to try and smoothly move towards a point.
		/// </summary>
		/// <param name="position">The position to move towards.</param>
		/// <param name="user">A user object passed.</param>
		/// <returns>true if the position was moved towards, and false if there was a pathfinding error.</returns>
		public bool MoveTowards(Vector2i position, params dynamic[] user)
		{
			var skill = LokiPoe.Me.SkillBarSkills.FirstOrDefault(s => s.Name == "Phase Run");
			if (skill != null)
			{
				if (skill.CanUse())
				{
					var err = LokiPoe.InGameState.SkillBarPanel.Use(skill.Slot, false);
					if (err != LokiPoe.InGameState.UseError.None)
					{
						Log.ErrorFormat("[PhaseRunPlayerMover] Use returned {0}.", err);
					}
				}
			}
			return _corePlayerMover.MoveTowards(position, user);
		}
	}

If you want to use certain skills, you'll have to do a bit of coding and tweak the logic so it works as expected. In the LW example, it only uses it past a certain distance, since the skill has it's own minimal distance. If you're not careful and try moving too close, you can lockup the bots movement.

Phase Run is the easiest to do, and the most reliable since it applies a buff.
 
Back
Top