Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Right-click use


    peanutbutterp

    Recommended Posts

    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

    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

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.