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
  • Clicking items on inventory position as opposed to looping through interactions (incl old code)


    Recommended Posts

    Used to have a snippet saved of how i interacted with inv slots for cleaning herbs e.t.c but this is about 4 years old. Was having trouble getting the Mouse functionality to work looking at the docs:

    Any ideas appreciated - also I have issues with docs as all old methods are deprecated. Struggling to walk through new versions of everything?

    Code below:

        public void searchOnlyThese (Integer[] droppables, int[] dropOrder) {

            Rectangle[] invRects = new Rectangle[28];
            for (int r = 0; r < invRects.length; r++) {
                int x = 563 + 42 * (r % 4);
                int y = 213 + 36 * (r / 4);
                invRects[r] = new Rectangle(x, y, 42, 36);
            Mouse mouse = Mouse;
            Instance instance = Client.getInstance();
            Canvas canvas = instance.getCanvas();
            Inventory inventory = Inventory;

            MouseSettings.setSpeed(Calculations.random(7, 11));
         //   canvas.dispatchEvent(new KeyEvent(canvas, KeyEvent.KEY_PRESSED, System.currentTimeMillis(), 0, KeyEvent.VK_SHIFT, KeyEvent.CHAR_UNDEFINED));
            for (int r = 0; r < dropOrder.length; r++) {
                if (Inventory.getItemInSlot(dropOrder[r]) != null && Arrays.asList(droppables).contains(Inventory.getItemInSlot(dropOrder[r]).getID())) {
                try {
                } catch (InterruptedException e) {
          //  canvas.dispatchEvent(new KeyEvent(canvas, KeyEvent.KEY_RELEASED, System.currentTimeMillis(), 0, KeyEvent.VK_SHIFT, KeyEvent.CHAR_UNDEFINED));


    Link to comment
    Share on other sites

    This instead of looping through a while statement along the lines of while inv contains grimy herb click herb. From memory interaction with a more ahk methodology was better for antiban

    Link to comment
    Share on other sites

    Not tested but something like this should work for cleaning herbs:

    private void cleanHerbs()
        for(int i = 0; i < 28; i++)
            if(Inventory.getItemInSlot(i) != null)
                    int inventorySlot = i;
                    sleepUntil(() -> !Inventory.getItemInSlot(inventorySlot).getName().contains("Grimy"),
                            Calculations.random(1500, 2500));
    Link to comment
    Share on other sites


    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.