上传备份

master
王兵 2 weeks ago
parent efc0cf3f79
commit 0e00381b64

@ -202,8 +202,8 @@ public abstract class JMacro {
* @param region * @param region
*/ */
public void mouseLeftClick(Region region) { public void mouseLeftClick(Region region) {
Mouse.move(region.getCenter()); mouseMove(region.getCenter());
Mouse.at().click(); mouseLeftClick();
} }
/** /**
@ -212,8 +212,8 @@ public abstract class JMacro {
* @param location * @param location
*/ */
public void mouseLeftClick(Location location) { public void mouseLeftClick(Location location) {
Mouse.move(location); mouseMove(location);
Mouse.at().click(); mouseLeftClick();
} }
/** /**
@ -227,43 +227,50 @@ public abstract class JMacro {
* *
*/ */
public void mouseLeftDoubleClick(Region region) { public void mouseLeftDoubleClick(Region region) {
Mouse.move(region.getCenter()); mouseMove(region.getCenter());
Mouse.at().doubleClick(); mouseLeftDoubleClick();
} }
/** /**
* *
*/ */
public void mouseLeftDoubleClick(Location location) { public void mouseLeftDoubleClick(Location location) {
Mouse.move(location); mouseMove(location);
Mouse.at().doubleClick(); mouseLeftDoubleClick();
} }
/** /**
* *
*
* @param region
*/ */
public void mouseRightClick(Region region) { public void mouseRightClick() {
region.getCenter().rightClick(); mouseRightClick(Mouse.at());
} }
/** /**
* *
* *
* @param location * @param region
*/ */
public void mouseRightClick(Location location) { public void mouseRightClick(Region region) {
location.rightClick(); // 随机移动到区域中心附近(而非直接移动到中心)
Location center = region.getCenter();
// 得到随机移动到区域中心附近的半径
int radius = (int) (Math.min(region.getW(), region.getH()) / 2 * 0.9f);
int x = center.getX() + RandomUtil.randomInt(-radius, radius);
int y = center.getY() + RandomUtil.randomInt(-radius, radius);
mouseMove(new Location(x, y));
mouseRightClick();
} }
/** /**
* *
*
* @param location
*/ */
public void mouseRightClick() { public void mouseRightClick(Location location) {
mouseRightClick(Mouse.at()); mouseMove(location);
mouseRightClick();
} }
/** /**
* *
*/ */

Loading…
Cancel
Save

Powered by TurnKey Linux.