jim87
New Member
- Joined
- Aug 26, 2011
- Messages
- 445
- Reaction score
- 7
Hello!
I've got an action which theoretically should move me from hotspot to hotspot, but effectively it stops at each step from hotspot to hotspot for, let's say, 1 second or less, making it look a lot bottish. How can I avoid this? Thanks!
Also: does ProfileManager.CurrentProfile.HotspotManager.GetNextHotspot() get the nearest hotspot, or just "first or default"? And is my action faulty in something? It doesn't seem to follow the path indeed... weird!
P.S.
The decorator doesn't let the action run if the "next hotspot" is too far from the current position.
I've got an action which theoretically should move me from hotspot to hotspot, but effectively it stops at each step from hotspot to hotspot for, let's say, 1 second or less, making it look a lot bottish. How can I avoid this? Thanks!
Also: does ProfileManager.CurrentProfile.HotspotManager.GetNextHotspot() get the nearest hotspot, or just "first or default"? And is my action faulty in something? It doesn't seem to follow the path indeed... weird!
PHP:
class ActionFollowPath : Action
{
protected override RunStatus Run(object context)
{
SharedData shared = SharedData.Instance;
FishingBuddySettings settings = FishingBuddySettings.Instance;
// I've not initialized the path yet
if (shared.nextPathIndex == -1)
{
// Get the index of the nearest hotspot
shared.nextPathIndex = ProfileManager.CurrentProfile.HotspotManager.Hotspots.IndexOf(
ProfileManager.CurrentProfile.HotspotManager.GetNextHotspot()
);
int totalHotspots = ProfileManager.CurrentProfile.HotspotManager.Hotspots.Count;
// There are less hotspots forward than backwards
// And I've got a bounce behavior
if (!settings.circlePathing)
{
if ((totalHotspots - shared.nextPathIndex) < (totalHotspots / 2))
shared.inversePath = false;
else
shared.inversePath = true;
}
// Circle behavior
else
shared.inversePath = false;
return RunStatus.Running;
}
else
{
// Mount if not mounted
if (!ObjectManager.Me.Mounted && Flightor.MountHelper.CanMount)
Flightor.MountHelper.MountUp();
Utils.changeStatusText("Moving to next hotspot");
// Start of the path
if (shared.nextPathIndex == 0)
shared.inversePath = false;
// End of the path
if (shared.nextPathIndex == (ProfileManager.CurrentProfile.HotspotManager.Hotspots.Count - 1))
{
if (settings.circlePathing)
shared.inversePath = false;
else
shared.inversePath = true;
}
// Move to next hotspot
Flightor.MoveTo(ProfileManager.CurrentProfile.HotspotManager.Hotspots.ElementAt(shared.nextPathIndex));
if (shared.inversePath)
shared.nextPathIndex--;
else
shared.nextPathIndex++;
}
return RunStatus.Success;
}
}
P.S.
The decorator doesn't let the action run if the "next hotspot" is too far from the current position.
Last edited: