Skip to content

Commit 81ffa02

Browse files
author
gabriel-archanjo
committed
Merge branch 'main' of https://github.com/botcity-dev/botcity-framework into main
2 parents 8dd1ba2 + 3fa3bee commit 81ffa02

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/main/java/dev/botcity/framework/bot/DesktopBot.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,17 @@ public void clickAt(int px, int py) {
589589
this.x = px;
590590
this.y = py;
591591
moveAndclick();
592-
592+
sleep(sleepAfterAction);
593+
}
594+
595+
public void clickAt(int px, int py, int numClicks) {
596+
this.x = px;
597+
this.y = py;
598+
for (int i = 0; i < numClicks; i++) {
599+
moveAndclick();
600+
sleep(100);
601+
}
602+
sleep(sleepAfterAction);
593603
}
594604

595605
public void rightClickAt(int x, int y) {
@@ -689,7 +699,7 @@ public void tripleClickRelative(int x, int y) {
689699
moveAndclick();
690700
sleep(sleepAfterAction);
691701
}
692-
702+
693703
/**
694704
* Scroll down wheel action.
695705
* @param y wheel actions.
@@ -855,8 +865,8 @@ private void moveAndRightClick() {
855865
robot.mouseRelease(InputEvent.BUTTON3_MASK);
856866
}
857867

858-
private void click(int waitAfter) {
859-
moveAndclick();
868+
public void click(int waitAfter) {
869+
clickRelative(visualElem.getWidth()/2, visualElem.getHeight()/2);
860870
sleep(waitAfter);
861871
}
862872

0 commit comments

Comments
 (0)