Autoclicker for browser using Human Emulator

Autoclicker for browser using Human Emulator

Autoclicker is a program that records all actions related to mouse and keyboard control and then reproduces all these actions automatically. Accordingly, an autoclicker for a browser is a program that repeats the necessary actions in the browser.

All versions of the program have all the necessary tools for recording and controlling the keyboard and mouse. For recording, the Macros tool is used, which records your actions in the browser built into the program.

Macros.

Working with Macros is described in the article User actions record using tool the Macros. This work is identical in all versions of the program. The only thing is that to write an autoclicker, you will need to select the Full mouse emulation and Full keyboard emulation checkboxes in the Macros settings. In this case, a real keyboard and mouse will be used.

Keyboard simulation.

To control the keyboard, the keyboard object has been added to all versions of the program. This object provides complete control over all keyboard capabilities. And in two modes: full keyboard simulation and transfer of events from the keyboard to the browser.

Full keyboard simulation.

In full keyboard emulation mode, Human Emulator controls input from a real keyboard, that is, it sends events as if a real person presses keyboard keys. In this case, all actions with the keyboard will be performed in any active window, be it a window of the built-in browser program or an open Notepad window.

An example of working in php in full emulation mode:

An example of keyboard input into an open Notepad window for programs based on Internet Explorer:

In Human Emulator Studio, working with the input command is slightly different, so in order to perform the same action as in the example above, you either need to use the clipboard:

Or use the functionality to manage external windows.

An example on php for working in Studio:

Passing events from the keyboard to the browser.

The second mode is event transmission. In fact, when you work with the keyboard, after each keystroke, the active window of the program receives a number of messages and the corresponding action is performed based on these messages. Moreover, this event moves from one active window to the next. That is, when you enter text from the keyboard into a text field in a browser, this message is received first by the browser window, and then through the chain of parent elements and the text field, as well as all its child elements.

Thus, you can work simultaneously in several dozen browsers, while in full emulation mode you can work with only one active browser window, as is the case with real keyboard use. All commands for sending events of the keyboard object have the send_ * prefix.

An example of sending events to php:

In addition to the keyboard object commands, all HTML DOM objects have send_keyboard_input_by_ * commands. These commands pass keyboard input events to the HTML element.

Mouse simulation.

To control the mouse, the mouse object has been added to all versions of the program. As with the keyboard, you can also work with the mouse in two modes: full emulation of mouse actions and transmission of events from the mouse to the browser element. The principle of operation is the same and with the keyboard, full emulation of the use of a real mouse cursor, and in the event transmission mode, all events from the mouse are transmitted to the element.

Full mouse simulation.

Working with a real mouse. In this mode, the real mouse cursor will be used and during the execution of mouse actions, it will be possible to observe how the cursor on the monitor moves across the screen. For complete emulation, the corresponding commands were added to the object. With the help of these commands, you can perform all the actions that a person can perform with a real mouse: perform clicks on different buttons, spin the wheel, pinch and release buttons, move the cursor.

An example of using full emulation in php:

The example above moves the mouse cursor to a specified point on the page, holds down the left mouse button and moves the cursor to new coordinates. After completing this example, a portion of the text on the page will be selected.

Example of mouse clicks in an outer window in an IE based Human Emulator:

An example of mouse clicks in an outer window in Chromium-based Human Emulator Studio:

Passing mouse events.

To send events directly to the browser, use the send_ * prefix commands. Unlike full emulation commands, these commands allow you to work even with a minimized program window and are suitable for multi-threaded work.

An example of sending mouse events to php:

Through the functionality of the windowinterface object (an interface for managing external windows), you can not only work in full emulation mode, but also send mouse events to these windows.

Element interface.

Another way to work with the mouse and keyboard with page elements in a browser is to use the functionality of connecting to an element through an interface.

To obtain this interface, one of the commands available from any DOM object of the program is used.

After we have received a link to the interface, we use the commands: Full mouse emulation over the element, Mouse emulation at the event level over the element, Full keyboard emulation over the element, Keyboard emulation at the event level above the element.

In this case, our example for a full keyboard and mouse emulation to work with a google textbox would be:

and sending the event to the same field will look like this:

A random trajectory of the mouse.

When the command move the mouse cursor move or send_move is called, the mouse cursor moves in a straight line from the starting point to the point specified in the command. But sometimes it becomes necessary to move the mouse along complex and random trajectory, that is, as a person would do by viewing the page or reading text on it. For this purpose, the move_to and send_move_to commands have been added to the program. These commands move the cursor along random trajectory in the form of a line, curve, chaotic movement, along a circular path and along a trajectory to simulate text reading.

Php example:

Autoclicker based on Human Emulator.

As you can see from this article, all versions of the Human Emulator have enough functionality to use it to make not only a browser autoclicker, but also an autoclicker for external windows.