Skip to content

Commit

Permalink
linting, default params for custom_swipe()
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmiglio committed Sep 23, 2024
1 parent 2691a55 commit 3446e57
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/pyclashbot/memu/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def scroll_up_fast(vm_index):
send_swipe(vm_index, 215, 100, 215, 500)


def custom_swipe(vm_index, start_x, start_y, end_x, end_y, repeat, delay):
for _ in range(repeat):
def custom_swipe(vm_index, start_x, start_y, end_x, end_y, count=1, delay=0):
for _ in range(count):
send_swipe(vm_index, start_x, start_y, end_x, end_y)
time.sleep(delay)

Expand Down Expand Up @@ -92,10 +92,10 @@ def scroll_down(vm_index):

def scroll_down_in_request_page(vm_index):
"""Method for scrolling down faster when interacting with a scrollable menu"""
#vertical swipe
# vertical swipe
send_swipe(vm_index, 43, 350, 43, 140)

#horizontal swipe to stop the scroll
# horizontal swipe to stop the scroll
send_swipe(vm_index, 100, 385, 330, 385)


Expand Down Expand Up @@ -126,8 +126,13 @@ def scroll_up_in_shop_page(vm_index):
# click deadspace to stop the scroll
click(vm_index, 10, 200)


def send_swipe(
vm_index: int, x_coord1: int, y_coord1: int, x_coord2: int, y_coord2: int,
vm_index: int,
x_coord1: int,
y_coord1: int,
x_coord2: int,
y_coord2: int,
):
"""Method for sending a swipe command to the given vm
Expand Down

0 comments on commit 3446e57

Please sign in to comment.