Jump to content

Force bot to take a "break"


Recommended Posts

Hey,

Is there an easy way to force the bot to pause for like 20-30 seconds dependant on hp/mana of pet, after combat.
I've tried with Thread.Sleep(20000) as a spell in my fightclass with hp condition of my pet and not in combat.
According to the log, it actually runs the spell, but the bot will just continue attacking mobs.

Link to comment
Share on other sites

Hello, try 

        new Thread(() =>
        {
            robotManager.Products.Products.InPause = true;
            Thread.Sleep(20 * 1000); // 20 secondes
            robotManager.Products.Products.InPause = false;
        }).Start();

or

            robotManager.Products.Products.InPause = true;
            Thread.Sleep(20 * 1000); // 20 secondes
            robotManager.Products.Products.InPause = false;

 

Link to comment
Share on other sites

Yep. I actually used simular code as you Droidz.

Now I got a new problem. I want to run this code RANDOMLY after combat when the manapercent of my pet is less than xx. Eg. condition: Pet.Manapercent <= 20 && (Others.Random(1,20) <= 4) && Notincombat..

Since the bot checks spells conditions each tick?, the random condition will eventually return true, because it runs often. The result is that the bot always pauses after combat when manapercent of pet is less that 20.

Would it be possible to only check these conditions once after combat? Is there a easier solution?

Link to comment
Share on other sites

Everything is possible. It will be easier to make plugin to do that. I have something like that so what you need exactly?

to stop the bot we need :

in_combat = false

petMana < 20%

and

( % chance to stop? )

to start it again we need?

time interval? random time interval? external stimuli?

Link to comment
Share on other sites

Sorry for late reply.

Yes something like that.

Conditions:

  1. Not in combat, should be straight after combat.
  2. Pet Mana < 20
  3. Randomizer, lets say 25% for beeing true.

When all these conditions is true, we should pause bot for like 20 seconds, something like this:

robotManager.Products.Products.InPause = true;
Others.Wait(Others.Random(20000);
robotManager.Products.Products.InPause = false;

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...