wefwefwef222 0 Posted September 15, 2021 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
wefwefwef222 0 Author Posted September 15, 2021 Edit: it appears that any values over 700 with automatically move the mouse off-screen. Any values below 700 are working close to expected.
Axolotl 31 Posted September 15, 2021 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
wefwefwef222 0 Author Posted September 15, 2021 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.
Axolotl 31 Posted September 15, 2021 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);
wefwefwef222 0 Author Posted September 15, 2021 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.
Axolotl 31 Posted September 15, 2021 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.
wefwefwef222 0 Author Posted September 15, 2021 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.
Axolotl 31 Posted September 15, 2021 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));
Pandemic 2818 Posted September 15, 2021 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.