Jump to content

What's wrong with this code? Kills mob instead of using item


Ruinit

Recommended Posts

I found this code on forum what is wrong here? It just keeps attacking with everything I have and kills the mob before it uses item. 

Thread t = new Thread(() =>
{
 uint itemId = 60206;
 int questId = 26720;
 while (robotManager.Products.Products.IsStarted)
 {
  if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
  {
   if (!Quest.HasQuest(questId))
    break;
   if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 25)
   {
    ItemsManager.UseItem(itemId);
   }
  }
  Thread.Sleep(500);
 }
});
t.Start();

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...