# Robotgo Pro
[](https://github.com/vcaesar/robotgo-pro/actions/workflows/nodejs.yml)
[](https://goreportcard.com/report/github.com/go-vgo/robotgo)
[](https://godoc.org/github.com/go-vgo/robotgo)
[](https://github.com/vcaesar/robotgo-pro/releases/latest)
[](https://www.npmjs.com/package/robotgo/)
[](https://pypi.org/project/robotgo/)
> Multi languages Desktop Automation, auto test and AI Computer Use.
> Control the mouse, keyboard, bitmap, read the screen, Window Handle and global event listener.
RobotGo-Pro supports Mac, Windows, and Linux (X11 now). Also supports Javasprint, Python, Lua and others.
This software package is a commercial product and requires a license code to operate, [create an account](https://atomai.cc/user/singup).
The use of this software package is governed by the end-user license agreement (EULA) available at: [EULA](https://atomai.cc/about/eula/).
Go to [AtomAI](https://atomai.cc/user/singup) create an account, then setting conf.toml (Input your email and pwd to the conf.toml, one path with main.js.) to generate the licenses.
You can Login to try Python, Javascript, Lua and others lite version, and you need buy the robotgo-pro version in the [AtomAI](https://atomai.cc/finance).
## Contents
- [Docs](#docs)
- [Requirements](#requirements)
- [Installation](#installation)
- [Examples](#examples)
- [Authors](#authors)
- [Plans](#plans)
- [License](/LICENSE.md)
## Requirements:
### ALL:
```
GCC and Used language
```
#### For Mac OS X:
Xcode Command Line Tools;
And Privacy setting, add Screen Recording and Accessibility under:
`System Settings > Privacy & Security > Accessibility, Screen & System Audio Recording`.
```
xcode-select --install
```
#### For Windows:
[llvm-mingw](https://github.com/mstorsjo/llvm-mingw)
```
winget install MartinStorsjo.LLVM-MinGW.UCRT
```
Or [MinGW-w64](https://sourceforge.net/projects/mingw-w64/files)
```
winget install BrechtSanders.WinLibs.POSIX.UCRT
```
Or others GCC;
#### For everything else:
#### Wayland (Developing 70% and testing):
Not supported now, developing in the progress (100% in version2).
#### X11:
```
GCC
X11 with the XTest extension (the Xtst library)
"Clipboard": xsel xclip
"Bitmap": libpng (Just used by the "bitmap".)
"Event-Gohook": xcb, xkb, libxkbcommon (Just used by the "hook".)
```
##### Ubuntu:
```yml
# gcc
sudo apt install gcc libc6-dev
# x11
sudo apt install libx11-dev xorg-dev libxtst-dev
# Clipboard
sudo apt install xsel xclip
# Bitmap
sudo apt install libpng++-dev
# GoHook
sudo apt install xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev
```
##### Fedora:
```yml
# x11
sudo dnf install libXtst-devel
# Clipboard
sudo dnf install xsel xclip
# Bitmap
sudo dnf install libpng-devel
# GoHook
sudo dnf install libxkbcommon-devel libxkbcommon-x11-devel xorg-x11-xkb-utils-devel
```
## Installation:
### JS, PY, Lua and others
```
git clone https://github.com/vcaesar/robotgo-pro
```
[Create an account](https://atomai.cc/user/singup), input your email and password to the [conf.toml](/test), then run it.
### Javasprint (Not now):
```js
npm install robotgo // robotgo-pro
```
Lite version:
```js
npm install robotgo-lite
```
### Python (Not now):
```py
# pip install uv
# uv pip install cffi (The ctypes will be default)
uv pip install robotgo
# uv pip install robotgo-lite
```
## Examples:
[Javasprint](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.js)
[Python](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.py)
[Lua](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.lua)
#### [Mouse](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.js#L7)
#### JavaScript
```js
var robotgo = require("robotgo");
robotgo.Scroll(10, "up");
robotgo.Click("left", true);
robotgo.MoveSmooth(100, 200); // speed: 1.0, 100.0
// node main.js
// sudo node main.js // only linux
```
#### Python
```py
import sys
sys.path.append("..")
import robotgo
robotgo.Scroll(10, 10)
robotgo.Click("left", true)
robotgo.MoveSmooth(100, 200)
# uv run main.py
```
#### Lua
```lua
package.path = "../?.lua;"..package.path
local robotgo = require("robotgo")
-- Move mouse
robotgo.Move(100, 100)
-- Get screen size
local width, height = robotgo.GetScreenSize()
print(width, height)
-- Click
robotgo.Click("left")
-- luajit main.lua
```
#### [Keyboard](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.js#L41)
```js
var robotgo = require("robotgo");
robotgo.Type("test テスト");
robotgo.Type("galaxy. こんにちは世界.");
robotgo.Sleep(1);
robotgo.KeyTap("enter");
robotgo.WriteAll("Test");
var text = robotgo.ReadAll();
console.log(text);
```
#### [Screen](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.js)
```js
var robotgo = require("robotgo");
var pos = robotgo.Location();
console.log("pos: ", pos);
var color = robotgo.GetPixelColor(100, 200);
console.log("color is: ", color);
```
#### [Bitmap](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.js)
```js
var robotgo = require("robotgo");
var bitmap = robotgo.CaptureScreen(10, 20, 30, 40);
console.log("...", bitmap);
var pos = robotgo.FindBitmap(bitmap);
console.log("FindBitmap: ", pos);
robotgo.SaveBitmap(bitmap, "test.png");
// use `robotgo.FreeBitmap(bit)` to free the bitmap
robotgo.FreeBitmap(bitmap);
```
#### [OpenCV](https://github.com/vcaesar/robotgo-pro/tree/dev/examples)
Design in the progress;
#### [Event](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.js)
Design in the progress;
```js
var robotgo = require("robotgo");
var keve = robotgo.AddEvent("k");
if (keve) {
console.log("you press: ", "k");
}
var s = robotgo.AddEvents("q", "ctrl");
if (s) {
console.log("you press: ", "mouse left button");
}
```
#### [Window](https://github.com/vcaesar/robotgo-pro/blob/dev/examples/main.js)
```js
var robotgo = require("robotgo");
var fpid = robotgo.FindIds("Google");
console.log("pids... ", fpid);
if (fpid.length > 0) {
robotgo.ActivePid(fpid[0]);
robotgo.Kill(fpid[0]);
}
robotgo.ActiveName("chrome");
var isExist = robotgo.PidExists(100);
if (isExist) {
console.log("pid exists is", isExist);
robotgo.kill(100);
}
var abool = robotgo.Alert("test", "robotgo");
if (abool == 0) {
console.log("ok: ", "ok");
}
var title = robotgo.GetTitle();
console.log("title: ", title);
```
## Plans
- Wayland support
- More Window Handle