Gobot is an automation tool that allows you to script various keyboard and mouse actions, as well as conditional logic and variables. See Commands section for a list of commands supported by Gobot and their functionalities.
- robotgo (see dependencies of robotgo).
- gohook
- Gobot used the tiny and easy rune scripting language for scripting
From the root directory of the project run:
go build -ldflags="-s -w" .
From the root directory of the project run:
gobot <script-file>.rune
Note: Pressing
ESCwill stop the script immediately!
- Syntax:
keytap(<key1>, <key2>, ...) - Description: Presses the specified key combination and releases it.
- Example:
press(lshift, a)
- Syntax:
keypress(<key1>, <key2>, ...) - Description: Presses the specified key combination.
- Example:
keypress(lshift, a)
- Syntax:
keyrelease(<key1>, <key2>, ...) - Description: Releases the specified key combination.
- Example:
keyrelease(lshift, a)
- Syntax:
move(<x>, <y>) - Description: Moves the mouse to the specified coordinates.
- Example:
move(100, 200)
- Syntax:
getcolor(<x>, <y>) - Description: Retrieves the color at the specified screen coordinates and stores it in the given result variable. If the variable does not exist, it is created as a variable of type string.
- Example:
color = getcolor(100, 150)
- Syntax:
colormatch(<color1>, <color2>, <threshold>) - Description: Compares two colors to see if they match within the specified threshold. The result is then saved in the given result variable. If the variable does not exist, it is created. Result can be 0 = colors do not match or 1 = colors match. Colors must be hex values preceded by
#. - Example:
isMatch = colormatch(myColor, "#deadbeef", "#10")
println("Hello, World!")
println("This is Gobot.")
move(100, 200)
mouseclick("left")
wait(500)
mouseclick("left")
myColor = getcolor(175, 40)
println(myColor)
isMatch = colormatch(myColor, "#fed668", #01)
if isMatch {
println "colors match :)"
} else {
println "colors do not match"
}
"left" Left mouse button
"center" Middle mouse button
"right" Right mouse button
"A-Z a-z 0-9"
"backspace"
"delete"
"enter"
"tab"
"esc"
"escape"
"up" Up arrow key
"down" Down arrow key
"right" Right arrow key
"left" Left arrow key
"home"
"end"
"pageup"
"pagedown"
"f1"
"f2"
"f3"
"f4"
"f5"
"f6"
"f7"
"f8"
"f9"
"f10"
"f11"
"f12"
"f13"
"f14"
"f15"
"f16"
"f17"
"f18"
"f19"
"f20"
"f21"
"f22"
"f23"
"f24"
"cmd" is the "win" key for windows
"lcmd" left command
"rcmd" right command
"alt"
"lalt" left alt
"ralt" right alt
"ctrl"
"lctrl" left ctrl
"rctrl" right ctrl
"control"
"shift"
"lshift" left shift
"rshift" right shift
"capslock"
"space"
"print"
"printscreen" No Mac support
"insert"
"menu" Windows only
"audio_mute" Mute the volume
"audio_vol_down" Lower the volume
"audio_vol_up" Increase the volume
"audio_play"
"audio_stop"
"audio_pause"
"audio_prev" Previous Track
"audio_next" Next Track
"audio_rewind" Linux only
"audio_forward" Linux only
"audio_repeat" Linux only
"audio_random" Linux only
"num0"
"num1"
"num2"
"num3"
"num4"
"num5"
"num6"
"num7"
"num8"
"num9"
"num_lock"
"num."
"num+"
"num-"
"num*"
"num/"
"num_clear"
"num_enter"
"num_equal"
"lights_mon_up" Turn up monitor brightness No Windows support
"lights_mon_down" Turn down monitor brightness No Windows support
"lights_kbd_toggle" Toggle keyboard backlight on/off No Windows support
"lights_kbd_up" Turn up keyboard backlight brightness No Windows support
"lights_kbd_down" Turn down keyboard backlight brightness No Windows support
Gobot is open-source software licensed under the MIT license.