peanutbutterp 1 Share Posted January 4, 2018 Hello, I'm trying to have my script using an iron ingot on the furnance, but I'd like to have it right clicking it. Here's my code so far, but moving my mouse Y coordinates down is the wrong case here, because often players get into my right click selection public void smeltBars(){ if(getInventory().contains("Steel bar")){ GameObject furnace = getGameObjects().closest("Furnace" /*16469*/); getCamera().rotateToEntity(furnace); sleep(); getInventory().interact(2353, "Use"); sleep(); getMouse().click(furnace, true); // true = right click, false = left click sleepLong(); Point point = new Point(getMouse().getX(),getMouse().getY() - 20 ); // how far do we need to go down to select the option you want, collect the point data and add it to this code getMouse().move(point); getMouse().click(false); // now we use false to left click sleep(); //228, 403, 229, 246 getMouse().click(new Point(Calculations.random(226, 230), Calculations.random(401, 405)) { }); sleepLong(); if(getPlayers().localPlayer().getAnimation() == -1 && !getInventory().contains("Cannonball")) smeltBars(); sleepLong(); } } Link to comment Share on other sites More sharing options...
Scorpius 144 Share Posted January 4, 2018 I love your effort but getInventory().get(2353).useOn(furnace) If you insist on forcing a right-click, here are a few hints getClient().getMenu().isMenuVisible() getClient().getMenu().getMenuRows() getClient().getMenu().clickIndex(target_item_index_from_menu_rows) getClient().getMenu().clickAction("action", entity) Link to comment Share on other sites More sharing options...
peanutbutterp 1 Author Share Posted January 4, 2018 I love your effort but getInventory().get(2353).useOn(furnace); Wow, turns out that it's that simple Thanks! Link to comment Share on other sites More sharing options...
Scorpius 144 Share Posted January 4, 2018 Wow, turns out that it's that simple Thanks! Check the edit, I gave you a few more alternatives to force right-click Link to comment Share on other sites More sharing options...
Xephy 237 Share Posted January 4, 2018 Check the edit, I gave you a few more alternatives to force right-click I believe you're overcomplicating it for such an easy task. if (getInventory().interact("Steel bar", "Use")) { if (getGameObjects().closest("Furnace") != null && getGameObjects().closest("Furnace").interactForceRight("Use")) { // Sleep until the widget for making cannonballs appears. } } Although, you may as well just use interact("Use"). It'll right click if needed. Edit: Tagged the OP for the notification. Hello, I'm trying to have my script using an iron ingot on the furnance, but I'd like to have it right clicking it. Here's my code so far, but moving my mouse Y coordinates down is the wrong case here, because often players get into my right click selection Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.