send_move

send_move($x,$y,$scroll=true,$time=0,$tremble=5,$buttons=""); - this function is used to transmit mouse movement to a specified point in the browser, even if the program is hidden in the tray.

the input Function accepts parameters:br>
  • $x – the x coordinate of the point to which you need to pass mouse movement, relative to the upper left corner of the browser. (int)
  • $y – y - coordinate of the point to move the mouse to, relative to the upper-left corner of the browser. (int)
  • $scroll – whether to scroll the browser to the specified point. If false is simply passed permashine to a given point, And true, you will be automatically scrolling to the desired point (boolean).
  • $time – the time it takes to move from the current point (parameter is available from 4.6.16). (int)
  • $tremble – the amplitude of the trajectory jitter (for more human-like emulation) (parameter is available from 4.6.48). (int)
  • $buttons - a string with a set of buttons (more than one button can be held down) that will stay pressed when moving (available from 4.9.32) :After testing, the function returns the result of its work to the script :
  • true – successfully moved to the specified point (boolean)
  • false – operation failed (boolean)

    PHP example: mouse->".basename(__FILE__)."
    "; //1 echo "1.Let's go to Google:"; echo $browser->navigate("http://www.google.ru")."
    "; //$browser->set_zoom(200); //2 echo "2.Move the mouse over the link:"; $x = $anchor->get_x_by_inner_text("Advert", false); $y = $anchor->get_y_by_inner_text("Advert", false); echo $x."".$y."".$mouse->send_move($x + 3, $y + 3)."
    "; sleep(5); //3 echo "3.Go to bigfozzy.com:"; echo $browser->navigate("http://www.bigfozzy.com")."
    "; //4 echo "4.Move the mouse over two links:"; $x = $anchor->get_x_by_number(100); $y = $anchor->get_y_by_number(100); echo "$x $y".$mouse->send_move($x + 1, $y + 1, true, 2).""; sleep(5); $x = $anchor->get_x_by_number(120); $y = $anchor->get_y_by_number(120); echo "$x $y".$mouse->send_move($x + 1, $y + 1, true, 2)."
    "; sleep(5); //five echo "5.Let's check the work with JS:"; $browser->run_java_script(" var cursorX; var cursorY; document.onmousemove = function(e) { cursorX = e.pageX; cursorY = e.pageY; } setTimeout(checkCursor, 1000); function checkCursor() {alert('Cursor at:' + cursorX + ',' + cursorY); } "); $mouse->send_move(100,100); //end echo "

    "; //Quit $app->quit(); ?>
    Python example: # Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7011" from xweb_human_emulator import * # Start echo("
    mouse.xxxxxxxxx
    ") # 1 echo("1.Let's go to google:") echo(browser.navigate("http://www.google.ru"), "
    ") browser.set_zoom(200) # 2 echo("2.Move the mouse to the 'I'm lucky' button:") x = button.get_x_by_name("btnI") y = button.get_y_by_name("btnI") echo(x, "") echo(y, "") echo(mouse.send_move(x + 3, y + 3), "
    ") sleep(2) # 3 echo("3.Go to bigfozzy.com:") echo(browser.navigate("http://www.bigfozzy.com"), "
    ") # 4 echo("4.Move the mouse over two links:") x = anchor.get_x_by_number(101) y = anchor.get_y_by_number(101) echo(str(x) + "" + str(y) + "" + str(mouse.send_move(x + 1, y + 1, true, 2)), "") x = anchor.get_x_by_number(121) y = anchor.get_y_by_number(121) echo(str(x) + "" + str(y) + "" + str(mouse.send_move(x + 1, y + 1, true, 2)), "
    ") # five echo("5.Let's check the work with JS:") echo(browser.run_java_script("\ u000Avar cursorX) \ u000Avar cursorY) \ u000Adocument.onmousemove = function(e) {\ u000A cursorX = e.pageX) \ u000A cursorY = e.pageY) \ u000A} \ u000AsetTimeout(checkCursor, 1000 )) \ u000Afunction checkCursor() \ u000A {alert('Cursor at:' + cursorX + ',' + cursorY))} ")," ") echo(mouse.send_move(100,100)) # end echo("

    ") # Quit app.quit()
    C# example: #region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program: XHEScript { static void Main(string [] args) { //init XHE server = "127.0.0.1:7010"; InitXHE(); //Start echo("
    mouse.send_move
    "); //1 step echo("1.Let's go to Google:"); echo(browser.navigate("http://www.google.ru") + "
    "); //pause sleep(3); //step 2 echo("2.Move the mouse to the 'I'm lucky' button:"); int x = btn.get_x_by_inner_text("I'm lucky!"); int y = btn.get_y_by_inner_text("I'm lucky!"); echo(mouse.send_move(x + 1, y + 1) + "
    "); //step 3 echo("3.Move the mouse to 350 350 in 5 seconds:"); echo(mouse.send_move(x + 1, y + 1, false, 5)); //end echo("

    "); app.quit(); } }
    Java Script example: //connect the object to control the emulator, if not already connected xhe_host = "127.0.0.1:7010"; echo = require("../../../Templates JS/xweb_human_emulator.js"); //Start echo("
    mouse.send_move
    "); //1 step echo("1.Let's go to Google:"); echo(browser.navigate("http://www.google.ru") + "
    "); //step 2 echo("2.Move the mouse to the 'I'm lucky' button:"); x = button.get_x_by_name("btnI"); y = button.get_y_by_name("btnI"); echo(x + "" + y + "" + mouse.send_move(x + 3, y + 3) + "
    "); browser.sleep(2); //step 3 echo("3.Let's go to bigfozzy.com:"); echo(browser.navigate("http://www.bigfozzy.com") + "
    "); //step 4 echo("4.Move the mouse over two links:"); x = anchor.get_x_by_number(100); y = anchor.get_y_by_number(100); echo(x + "" + y + "" + mouse.send_move(x + 1, y + 1, true, 4) + ""); x = anchor.get_x_by_number(120); y = anchor.get_y_by_number(120); echo(x + "" + y + "" + mouse.send_move(x + 1, y + 1, true, 4) + "
    "); //end echo("

    "); //Quit app.quit();