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
  • Using Mouse.move() while in resizable moves mouse off-screen


    wefwefwef222

    Recommended Posts

    Posted
    • Using Resizable - Classic layout, full screen
    • 1080p monitor

    When I execute:

    Mouse.move(new Rectangle(1005, 776, 1033, 805));

    ...which should move the mouse to the "Deposit inventory" button location inside of the bank.

     

    Then:

    The mouse moves off-screen. The client is unable to move the mouse to the desired location.

     

    Another example:

    Mouse.move(new Rectangle(700, 700, 700, 700));

    Moving to this position, *actually* moves the mouse to 1036, 913. Someting wong

    Posted

    Edit: it appears that any values over 700 with automatically move the mouse off-screen. Any values below 700 are working close to expected.

    Posted

    You don't need to do this, I understand there may be something wrong with the Mouse.move(Rectangle rect) as I've never used it with a rectangle position.
    However, all you need to do to click the "Deposit inventory" button is:

    Bank.depositAllItems();
    

    I'd try to avoid using such hardcoded locations especially considering it can be resized

    Posted
    1 minute ago, Axolotl said:

    You don't need to do this, I understand there may be something wrong with the Mouse.move(Rectangle rect) as I've never used it with a rectangle position.
    However, all you need to do to click the "Deposit inventory" button is:

    Bank.depositAllItems();
    

    I'd try to avoid using such hardcoded locations especially considering it can be resized

    I really don't want to use that functionality though... I am aware it exists, but it's not human-like to wait until the bank is open to click deposit. The reason I want to move the mouse there first, is to hover over the location of the deposit inventory button before the bank is open.

    Posted
    4 minutes ago, wefwefwef222 said:

    I really don't want to use that functionality though... I am aware it exists, but it's not human-like to wait until the bank is open to click deposit. The reason I want to move the mouse there first, is to hover over the location of the deposit inventory button before the bank is open.

    In that case you'll need to create your own formula for knowing where it will be based on the Viewport Height + Width, just as an example here is how I maintain my UI ontop of the chatbox even when resized:
     

    int extraHeight = Client.getViewportHeight() - 503;
    g.drawImage(background, 0, 339 + extraHeight, null);
    Posted
    4 minutes ago, Axolotl said:

    In that case you'll need to create your own formula for knowing where it will be based on the Viewport Height + Width, just as an example here is how I maintain my UI ontop of the chatbox even when resized:
     

    int extraHeight = Client.getViewportHeight() - 503;
    g.drawImage(background, 0, 339 + extraHeight, null);

    I don't think you're getting the point... if I put any values into the Mouse.move() method that are greater than 700, the mouse moves off-screen, even if those coordinates are on-screen. This is the issue.

    Posted
    7 minutes ago, wefwefwef222 said:

    I don't think you're getting the point... if I put any values into the Mouse.move() method that are greater than 700, the mouse moves off-screen, even if those coordinates are on-screen. This is the issue.

    First off use 

    Mouse.move(new Point(793, 523));
    

    Not Rectangle.
    Second, I do understand as I literally just went and tested for you and you will need to account for the viewport size.

    Posted
    1 hour ago, Axolotl said:

    First off use 

    Mouse.move(new Point(793, 523));
    

    Not Rectangle.
    Second, I do understand as I literally just went and tested for you and you will need to account for the viewport size.

    First off, I don't want to use a point.... because what human clicks the exact same point every single time? None. This is why I use rectangle.

     

    Second, please, enlighten me with the code you tested and show me how to do this correct. Paste below.

    Posted
    48 minutes ago, wefwefwef222 said:

    First off, I don't want to use a point.... because what human clicks the exact same point every single time? None. This is why I use rectangle.

     

    Second, please, enlighten me with the code you tested and show me how to do this correct. Paste below.

    Doesn't really matter what you want, what matters is what works.
     

    double viewportXAdjustment = Math.round((Client.getViewportWidth() - 765) / 2.01492);
    double viewportYAdjustment = Client.getViewportHeight() - 503;
    double depositInventoryX = Calculations.random(440 + viewportXAdjustment,
            475 + viewportXAdjustment);
    double depositInventoryY = Calculations.random(295 + viewportYAdjustment,
            330 + viewportYAdjustment);
    Mouse.move(new Point((int)depositInventoryX, (int)depositInventoryY));
    Posted

    Hey there, Java's Rectangle constructor doesn't take the two corners, it actually takes (startX, startY, width, height) so you're actually making a giant rectangle for the mouse to click instead of what you want.

    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.