botslave 0 Posted September 4, 2017 Hi I'm just going through the tutorials, making a tea stealer.. I was wondering how to have the mouse move back to the empty tea stall in anticipation for the next steal. Thanks.
Koschei 147 Posted September 4, 2017 getMouse.move() Should just stay at the same point unless something in your antiban causes it to move the mouse btw.
ArmyofDragons 28 Posted September 4, 2017 You need the Mouse class, do this by #getMouse(). There are many interesting methods to use, so I suggest referring to the API. Here is an example of a Mouse anti-ban (sloppy for various reasons) -- the fixed client screen dimensions are 765x503 pixels: { getMouse().move(new Point(Calculations.random(0, 765), Calculations.random(0, 503))); } or { getMouse().move(getGameObjects().getClosest(TEA_STALL_ID).getClickablePoint()); } Edit: Read your post wrong. I posted the correct solution above. getClickablePoint() is randomized I believe.
Before 97 Posted September 4, 2017 Instead of moving the mouse to a point, do this getMouse().move(getGameObjects().getTopObjectOnTile(new Tile(@@@, ###, $$$))); and fill "@@@, ###, $$$" with the tea stall's coordinates. Now, the mouse will move to a random spot that's still on the stall.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.