Skip to content

Commit

Permalink
increase send emoji speed
Browse files Browse the repository at this point in the history
  • Loading branch information
latorc committed Apr 19, 2024
1 parent f808602 commit 701b81c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions game/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ActionStep:

@dataclass
class ActionStepMove(ActionStep):
""" Move mouse to x,y"""
""" Move mouse to x,y (client res)"""
x:float
y:float
steps:int = field(default=5) # playwright mouse move steps
Expand Down Expand Up @@ -475,10 +475,13 @@ def automate_send_emoji(self):

idx = random.randint(0, 8)
x,y = Positions.EMOJI_BUTTON
steps = self.steps_randomized_move_click(x,y)
steps = [ActionStepMove(x*self.scaler, y*self.scaler)]
steps.append(ActionStepDelay(random.uniform(0.1, 0.2)))
steps.append(ActionStepClick())
x,y = Positions.EMOJIS[idx]
steps += self.steps_randomized_move_click(x,y)
steps.append(ActionStepMove(x*self.scaler,y*self.scaler))
steps.append(ActionStepDelay(random.uniform(0.1, 0.2)))
steps.append(ActionStepClick())
self._task = AutomationTask(self.executor, f"SendEmoji{idx}", f"Send emoji {idx}")
self._task.start_action_steps(steps, None)
self.last_emoji_time = time.time()
Expand Down

0 comments on commit 701b81c

Please sign in to comment.