// random
Random rnd = new Random();
// x location
int x = 200;
// y location
int y = 200;
// offset X
int offsetX = rnd.Next(100);
// offset y
int offsetY = rnd.Next(100);
// move mouse to start location x = 200 and y = 200 on "Window" window
string result = Emulator.MouseMove("Window", x, y);
// check result
if (result != "ok" && Emulator.ErrorDetected) return "Fail";
// mouse move to a new location
result = Emulator.MouseMove("Window", x + offsetX, y + offsetY);
// check result
if (result != "ok" && Emulator.ErrorDetected) return "Fail";
// answer
return String.Format("Mouse was moved from x = {0}; y = {1} to x = {2}; y = {3}", x, y, x + offsetX, y + offsetY);
// random
$rnd = new Random();
// x location
$x = 200;
// y location
$y = 200;
// offset X
$offsetX = $rnd->Next(100);
// offset y
$offsetY = $rnd->Next(100);
// move mouse to start location x = 200 and y = 200 on "Window" window
$result = ZennoLab\Emulation\Emulator::MouseMove("Window", $x, $y);
// check result
if ($result != "ok" && ZennoLab\Emulation\Emulator::ErrorDetected) return "Fail";
// mouse move to a new location
$result = ZennoLab\Emulation\Emulator::MouseMove("Window", $x + $offsetX, $y + $offsetY);
// check result
if ($result != "ok" && ZennoLab\Emulation\Emulator::ErrorDetected) return "Fail";
// answer
return String::Format("Mouse was moved from x = {0}; y = {1} to x = {2}; y = {3}", $x, $y, $x + $offsetX, $y + $offsetY);