Jump to content

Recommended Posts

Hello,

So far I've been able to figure out profile and fight class creation but I'm stuck with a core function for my bot.

It's going to rely on the use of an in game macro. What I need is to have a random delay on said macro between x and y seconds. 
Preferably I can run another function with this also, essentially having combat and pathing handled by the bot with two macros for targeting a special mob and running this function.

Any idea's/advice?

Link to comment
https://wrobot.eu/forums/topic/8164-macro-insert-random-delay/
Share on other sites

 private void foo()
 {
   
     var tmp = calculateRandomByRange(1000, 3000);
     //sleep for random between 1000 and 3000
     Thread.sleep(tmp);
     // run macros
       macro():
     
 }
  
  private int calculateRandomByRange(int lower, int upper)
    {
        Random r = new Random();
        return (r.Next(lower, upper));
    }

Here is how you do a random sleep between 1000 and 3000 milliseconds in C#. 

Edited by Avvi

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