Originally Posted by Omaster
I was wondering if you actually managed to get your bot to cast anything, as mine is only running around and targetting mobs.
This is currently the only thing keeping me from rewriting LEngine and hardcode some combat stuff.
I can't PM yet so I have to answer you here..
I had the same problem and couldn't figure out how to cast through the LEngine code, so I wen't the other route and edited the healbot code.(Only remove the ! as I suggested earlier if you're doing this).
I pretty much just swapped out this portion of code(in the healbot.cs Overrides Region KillTarget(...):
Code:
if (healbot)
return healBot(Target, IsAmbush);
with my combat routine.
Here's a sample of my routine:
Code:
move.releaseKeys();
while (true)
{
GContext.log("In Combat Loop! \n" + "Immo Timer:" + Immolate.Peek());
Thread.Sleep(1000);
if (Me.IsTargetingMe)
{
GContext.log("Targeting Self, sending escape");
KeyHelper.SendKey("Com.Esc", "None", "Escape");
Thread.Sleep(333);
}
if (Me.Health == 0.01 || Me.Health == 0 || Me.IsDead)
return eGCombatResult.Died;
if (Me.Health > .80 && Me.Mana < .80)
{
KeyHelper.SendKey("WL.Lifetap", "None", "0"); //lifetap
Thread.Sleep(333);
}
if (!Me.HasLivePet)
{
KeyHelper.SendKey("WL.SummonPet", "Shift", "0"); //summonpet
while (self.ChanneledCasting != 0)
{
Thread.Sleep(100);
}
}
else if (Me.Pet.Health < .25 && Me.Health > .60)
{
KeyHelper.SendKey("WL.HealthFunnel", "Shift", "9"); // healthfunnel
while (self.ChanneledCasting != 0)
{
Thread.Sleep(100);
}
}
if (Target.Health < .25)
{
KeyHelper.SendKey("WL.DrainSoul", "None", "6");
while (self.ChanneledCasting != 0)
{
Thread.Sleep(100);
}
}
if you wanted to do something similar you'd have to add a new method in keyhelper.cs:
Code:
public static void SendKey(string pkey, string pShift, string pChar)
{
if (!KeysList.ContainsKey(pkey))
{
KeysList.Add(pkey, new Keys(null, pShift, null, pChar));
}
Keys key = KeysList[pkey];
key.SendKey();
}
and add this to GPlayerSelf.cs:
Code:
public int ChanneledCasting
{
get
{
try
{
return objectList.getDescriptors.GetKnownField<int>(Descriptors.WoWUnitFields.UNIT_CHANNEL_SPELL, ObjectPointer);
}
catch
{
return 0;
}
}
}
If anyone wants to elaborate on this or clean this code up, feel free.
I know it's a mess
but im learning as I go!
EDIT: alot of this code is garbage and some does the opposite of what was intended, im making a post now with my updated combat routine and buff detection on mobs