Jump to content

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


Recommended Posts

Posted
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

Posted
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!

 

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