Jump to content

Hovering over Table Item - currently hovering on ground tile below object


Recommended Posts

public static Position pos = new Position(3018, 5013, 0);

public void grabWine() {
    if ((System.currentTimeMillis() - wineTimer) > 3000) {
        if (getMagic().isSpellSelected()) {
            GroundItem wine = getGroundItems().closest("Wine of zamorak");
            if (wine != null && wine.isVisible()) {
                winePosition = wine.getPosition();
                if (wine.interact("Cast")) {
                    wineTimer = System.currentTimeMillis();
                    amountOfWines++;
                }
            } else if (winePosition.isVisible(getBot())) {
                Rectangle rect = pos.getPolygon(getBot()).getBounds();
                getMouse().move(rect.x + (rect.width / 2), rect.y);
            } else {
                log("Moving camera to wine");
                getCamera().toEntity(wine);
            }


        } else {
            log("Spell not selected, Select telegrab");
            getMagic().castSpell(Spells.NormalSpells.TELEKINETIC_GRAB);
        }
    } else {
        if (getMagic().isSpellSelected()) {
            GroundItem wine = getGroundItems().closest("Wine of zamorak");

            if (wine != null && wine.isVisible()) {
                winePosition = wine.getPosition();

                log("Wine is visible and spell selected");
            } else if (winePosition.isVisible(getBot())) {

                Rectangle rect = pos.getPolygon(getBot()).getBounds();
                getMouse().move(rect.x + (rect.width / 2), rect.y);
            } else {
                log("Moving camera to wine");
                getCamera().toEntity(wine);
            }
        } else if (!getMagic().isSpellSelected()) {
            log("Spell not selected, Select telegrab");
            getMagic().castSpell(Spells.NormalSpells.TELEKINETIC_GRAB);
        }
    }
}

Hi guys, Trying to hover over a table item. However, with the code above hovers on the tile below the table as the wine is considered a ground item. Any way around this? Thanks for any help

Link to comment
Share on other sites

27 minutes ago, Camaro said:

I actually hover over the position above it in mine

How do you go about doing that lol

21 minutes ago, TheMcPker said:

after you interact with the wine (cast) you could probaly get your mouse position and save that (this is a realllllly bad way of doing things though so only use that option if nothing else works for you) 

Interesting idea, may try that if cant think of anything else, Thanks!

 

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