twistedintel
New Member
- Joined
- Oct 3, 2010
- Messages
- 35
- Reaction score
- 0
So, I've been (for the past 20 minutes or so...) writing a plugin that will return dropped flags in WSG and TP, mainly for use with lazyraider, etc.
Currently it recognized the flag being dropped (finds it in ObjectManager) and accurately judges whether or not I'm in range of the flag. However it won't interact with the flag.
Code for this:
Anyone have any pointers on this? And yeah, I'm fairly positive that this is extremely in-efficient, and that there are better ways etc. but I'm not worried with that yet... Thanks in advance for any help.
Currently it recognized the flag being dropped (finds it in ObjectManager) and accurately judges whether or not I'm in range of the flag. However it won't interact with the flag.
Code for this:
Code:
public override void Pulse()
{
var DroppedFlag = ObjectManager.GetObjectsOfType<WoWGameObject>().Find(o => o.SubType == WoWGameObjectType.FlagDrop);
if (DroppedFlag.IsValid && DroppedFlag.WithinInteractRange)
{
Logging.Write(Color.Aquamarine, "Clicking {0}!", DroppedFlag.Name);
DroppedFlag.Interact();
StyxWoW.SleepForLagDuration();
}
else if (DroppedFlag.IsValid && !DroppedFlag.WithinInteractRange)
{
Logging.Write(Color.Aquamarine,"Tried to click {0}, but was out of range.",DroppedFlag.Name);
}
else
return;
}