Jump to content

combat checks... ive tried everything.


booya

Recommended Posts

Doing a quest script, currently need to kill a rat for meat to burn it.

i just want it to sleep until it sees meat on floor then pick it. but currently, it is returning true on everything ive tried for when on combat in rat, it seems to be if the rats far away.....

I have tried every combo you can think of but it skips and comes back to "AT RATS" ive tried || and &&................. anoyying.

Quote
if (!players.myPlayer().isMoving() && RATS.contains(myPosition())) {
    log("AT RATS");
    sleep(random(500, 1250));
    if (!players.myPlayer().isAnimating() && !players.myPlayer().isMoving() && npcs.closest("Giant rat") != null && RATS.contains(myPosition())) {
        npcs.closest("Giant rat").interact("Attack");
        log("ATTACKING RAT");
        sleep(random(500,1200));
        mouse.moveOutsideScreen();
        log("MOVE MOUSE OF SCREEN & SLEEPING");
        new ConditionalSleep(120000, 500) {
            @Override
            public boolean condition() {

                log("INCOMBAT3");

                return !getPlayers().myPlayer().isMoving() || !getPlayers().myPlayer().isInteracting(getNpcs().closest("Giant Rat")) || !getCombat().isFighting();
            }
        }.sleep();
    }
    if (groundItems.closest("Raw rat meat") != null) {
        log("RAW MEAT IS ON FLOOR");
        groundItems.closestThatContains("Raw rat meat").interact("Take");
        sleep(random(200, 800));
        new ConditionalSleep(6000) {
            @Override
            public boolean condition() throws InterruptedException {

                return inventory.contains("Raw rat meat");
            }
        }.sleep();
    }
    if (getInventory().contains("Raw rat meat")) {
        sleep(random(500, 1250));
        Onion();
    } else {
        sleep(random(200, 800));
        Meat();

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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