From 96b1c19f0ac98a0dd55c13f7616c9052b525b0f3 Mon Sep 17 00:00:00 2001 From: Sascha Nitsch Date: Mon, 9 Sep 2024 18:43:06 +0200 Subject: [PATCH] animate relative mouse movements as well --- scriptedbrowser/commands/base.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scriptedbrowser/commands/base.php b/scriptedbrowser/commands/base.php index 1f28468..711226e 100644 --- a/scriptedbrowser/commands/base.php +++ b/scriptedbrowser/commands/base.php @@ -177,7 +177,15 @@ function _mousemoveaction($main, $control, $options, $targetX, $targetY) function mousemoverel($main, $control, $options) { $coord = explode(" ", $options['parameter']); - $control->mousemoveRel(intval($coord[0], 10), intval($coord[1], 10)); + $x = intval($coord[0], 10); + $y = intval($coord[1], 10); + if (array_key_exists('jump', $options)) { + $control->mousemoveRel($x, $y); + } else { + $mouseX = $main->getMouseX(); + $mouseY = $main->getMouseY(); + _mousemoveaction($main, $control, $options, $mouseX + $x, $mouseY + $y); + } return true; }