Jump to content

Waiting until target dies from ranged


Recommended Posts

Posted (edited)

I'm having trouble using conditional sleeps.

This is what I have so far which works for Melee but keeps clicking when using ranged.

new ConditionalSleep(30000) {
            public boolean condition() throws InterruptedException {
                return rat.isUnderAttack();
            }
        }.sleep();

Anyone got any ideas? Would be greatly appreciated! ❤️

Edited by CLoud
Posted (edited)

Sorry didnt see your other responses.

17 minutes ago, d0zza said:

The way you're going about this is bad, you're making the client sleep until the rat is dead. What happens if you need to eat during this time period?

Instead you should be checking for if you're in combat and if not then attack a rat.

Im interacting with the rat and if it's succesful then run the conditional sleep. If not. Try again.

5 minutes ago, Lexhanatin said:

Are you trying to sleep after you attempt to attack the rat?

How is he sleeping until the rat is dead? It's until the rat is under attack?

I'm sleeping until the rat isnt under attack in the original post. Then when it was dead it was no longer under attack. Thus I'd stop sleeping. But it didnt work well with ranged.

Edited by CLoud
Fucked up the order of the quotes.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...